New submission from James Hutchison:

Windows 7 64-bit, Python 3.2.3

This is a very odd issue and I haven't figured out what caused it. I have a 
python script that runs continuously. When it receives a request to do a task, 
it creates a new thread (not a new process), does the task, then sends out an 
e-mail to indicate it was done. It doesn't do this a lot (maybe 10 - 30 times a 
day). This is all the script does.

Well today, it randomly broke. It was working fine, then suddenly I was getting 
the following error when it would create an SMTP object:

socket.error: [Errno 10013] An attempt was made to access a socket in a way 
forbidden by its access permissions

What I found was, even after trying a different script that did nothing but 
create a simple SMTP connection to localhost, running with admin privileges, 
and even after rebooting the machine, I was getting this error. I checked my 
firewall and didn't see any changes (I share a group policy so I do not have 
full control). I also tried the script on a different machine and found no 
issue. The issue also persisted between IDLE and simply running python.exe

When I tried to debug the issue, I discovered the following piece of code made 
the issue go away:

s = socket.socket()
s.bind(('',50007))
s.listen(1);
s.close();

And it hasn't come back since. I've tried to reproduce the circumstances that 
my script was running by creating SMTP instances in a loop but haven't been 
able to recreate the error. Checking my log, there isn't anything abnormal that 
occurred just before this issue (like attempting to do the task several times 
at once or something).

----------
components: Library (Lib)
messages: 169055
nosy: Jimbofbx
priority: normal
severity: normal
status: open
title: socket error [Errno 10013] when creating SMTP object
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15779>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to