Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2,431 views
Skip to first unread message

Antony J

unread,
Oct 24, 2013, 11:46:51 AM10/24/13
to django-d...@googlegroups.com
Hi,

Good morning.

Your help is needed:

I am relatively new to Django. After developing a Django app, I am trying to write my first patch for Django.

I checked out Django from github: VERSION = (1, 7, 0, 'alpha', 0).

When I run the unit tests with the command "python runtests.py", I get 6 errors and 2 failures.
But in the Django Jenkins server, the builds are successful.

The error is: OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I tried the following:

1) Ran a command prompt as administrator.
2) Added python.exe to firewall inbound rules.
3) There are some suggestions for this error in stack overflow:
http://stackoverflow.com/questions/2778840/socket-error-errno-10013-an-attempt-was-made-to-access-a-socket-in-a-way-forb
http://stackoverflow.com/questions/16908529/python-3-x-socket-error-errno-10013-an-attempt-was-made-to-access-a-socket-in

The first suggestion seem require code changes in Django, and the second suggestion seem require code changes in Python http/server.py.

But these suggestions do not seem right to me.

I am running a Windows 7 Enterprise OS (version 6.1) with Python 3.3.2 32-bit version.

Is this a supported config to build Django?
Have any of you faced this error?

I appreciate any help that you can provide to solve the errors and failures.
Please find the error and failure tracebacks in the text file attached herewith.

Thanks,
Antony

Django_UT_errors.txt

Sam Lai

unread,
Oct 24, 2013, 7:18:36 PM10/24/13
to django-d...@googlegroups.com
Do you have anything running on port 8081 (running netstat will tell you)?

I just ran Django's test suite on my machine (Windows 7, Python
3.3.2), from the trunk cloned an hour ago, and it completed mostly
without an issue (there's a UnicodeDecodeError but that's likely
because it's printing a character to stdout that isn't supported by
the Windows console codepage).

Can you move this discussion over to django-users (just post your
reply with the rest of the email chain over there)? I don't think it's
an issue with Django itself.
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-develop...@googlegroups.com.
> To post to this group, send email to django-d...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/8f23755c-be2b-4a24-a00e-aaaead7f78ab%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Marc Tamlyn

unread,
Oct 25, 2013, 12:35:30 AM10/25/13
to django-d...@googlegroups.com

As this is about running the Django teat suite in order to try to write a patch it does belong on this mailing list.

I don't have any concrete ideas what's wrong - but it does look like all your issues are related to running the LiveServer (selenium) tests. Something bound to a certain port already is likely the culprit, or some sort of version mismatch. Is your code running in a virtual python environment? I don't like selenium tests should run by default so of you set yourself up a virtualenv where selenium isn't installed but your Django checkout is then you shouldn't get these tests running. This may be the difference Sam was seeing.

In any case, if the patch you were looking to write is not related to this area of the tests, I suggest you try just running the tests on the area you know works (and your new tests) or ignoring the failures.

Alternatively, spin up a Linux VM ;)

Marc

Antony J

unread,
Oct 30, 2013, 9:12:24 AM10/30/13
to django-d...@googlegroups.com
Sam, Marc,

Thank you for your responses. Sorry I could not get back on this sooner.

I ran the command “netstat -anob | findstr 8081” and found that the McAfee framework service was listening in port 8081.

After killing the frameworkservice.exe, the errors went away.

However, there still are 2 failures and the UnicodeDecodeError.
I am going to investigate them more, because the Django documentation states that all tests should pass.

Thank you for your help. I will get back with more info on the 2 failures soon.

Regards,
Antony

Ramiro Morales

unread,
Oct 30, 2013, 1:42:23 PM10/30/13
to django-d...@googlegroups.com

If you update your git clone these Windows-specific extra errors and failures shouldn't be there anymore either.

Please report back if that isn't the case.

Ramiro Morales
@ramiromorales

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
Reply all
Reply to author
Forward
0 new messages