nknganda / django-mailer

Automatically exported from code.google.com/p/django-mailer
MIT License
0 stars 0 forks source link

object has no attribute 'get_name' #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?
if ./manage.py send_mail
output:
AttributeError: '_MainThread' object has no attribute 'get_name'

What version of the product are you using? On what operating system?

svn
python2.6

Please provide any additional information below.
File: lockfile.py
line: 167

change:
tname = "%s-" % threading.current_thread().get_name()
to:
tname = "%s-" % threading.current_thread().getName()

Original issue reported on code.google.com by sfe...@gmail.com on 5 Feb 2009 at 4:04

GoogleCodeExporter commented 8 years ago
This fixes the problem we're having too. Any chance this can be updated in 
trunk?
Thanks.

Original comment by Chris.Sh...@gmail.com on 12 Feb 2009 at 5:39

GoogleCodeExporter commented 8 years ago
This has been fixed in lockfile 0.7. We will update to it very soon. Thanks!

Original comment by bros...@gmail.com on 12 Feb 2009 at 7:56

GoogleCodeExporter commented 8 years ago
Actually it has not been fixed in 0.7.  In my python 2.6.1 my
threading.current_thread was bound to threading.currentThread so the 
try...except
statement executed with out throwing the AttributeError.  I simply changed this 
to 
try:
    threading.Thread.get_name
except AttributeError:
    threading.Thread.get_name = threading.Thread.getName

Original comment by cesar.al...@gmail.com on 9 Mar 2009 at 6:21

Attachments:

GoogleCodeExporter commented 8 years ago
Cesar,

Good catch. It appears this issue is specific to 2.6 as it has 
threading.current_thread and prior versions did not. I 
will get a fix in shortly.

Original comment by bros...@gmail.com on 9 Mar 2009 at 8:51

GoogleCodeExporter commented 8 years ago
I've updated to lockfile 0.7 in r63. In r64 I fixed the Python 2.6 issue. 
Thanks guys.

Original comment by bros...@gmail.com on 9 Mar 2009 at 9:00

GoogleCodeExporter commented 8 years ago
just a question, why is lockfile.py being copied? Why not delete lockfile.py 
and get 
lockfile from pypi and add lockfile==0.8 into requirements.txt?

It's also copied in django-notification with the same bug.

Original comment by dalo...@gmail.com on 9 Mar 2010 at 7:54