[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2008-02-23 Thread Pedro Werneck

Pedro Werneck added the comment:

It seems the right thing to do would be to have it raise a base
exception, but SMTPConnectError docstring states "Error during
connection establishment.", so I chosen to use it with the errno and
message from socket.error, even if it's supposed to happen only after
connection is already stablished, since it's a subclass of
SMTPResponseException.

As a bonus I removed a explicit raise socket.error from line 290, when
an user pass a non-integer port.

--
nosy: +werneck
Added file: http://bugs.python.org/file9499/issue_2118_smtplib.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2118>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2008-02-23 Thread Pedro Werneck

Pedro Werneck added the comment:

Previous patch didn't passed the tests right. This patch fixes both the
code, unindenting port number conversion to integer and the test.

Added file: http://bugs.python.org/file9509/issue_2118_fixed.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2118>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1375] hotshot IndexError when loading stats

2008-02-23 Thread Pedro Werneck

Pedro Werneck added the comment:

Fixed by raising StopIteration when the stack is empty.

--
nosy: +werneck
Added file: http://bugs.python.org/file9510/issue_1375_hotshot.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1375>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1193577] add server.shutdown() method and daemon arg to SocketServer

2008-02-25 Thread Pedro Werneck

Pedro Werneck added the comment:

I had some code here to do the exact same thing with XML-RPC server. The
patch adds the feature to SocketServer, with a server.shutdown() method
to stop serve_forever(), and change the unittest to use and test the
feature.

I disagree on adding the daemon_threads arg as a keyword to TCPServer
since that's a feature of ThreadingMixIn

--
keywords: +patch
nosy: +werneck
Added file: http://bugs.python.org/file9553/issue1193577.patch

_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1193577>
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2325] isinstance(anything, MetaclassThatDefinesInstancecheck) raises instead of returning False

2008-05-02 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

In 3.0 it happens with any class. Just the cls argument missing on the
call to instancecheck.

--
keywords: +patch
nosy: +werneck
Added file: http://bugs.python.org/file10174/issue2325.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2325>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2325] isinstance(anything, MetaclassThatDefinesInstancecheck) raises instead of returning False

2008-05-02 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10174/issue2325.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2325>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2325] isinstance(anything, MetaclassThatDefinesInstancecheck) raises instead of returning False

2008-05-02 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

Seems like that's the wrong usage and the PEP 3119 notices that it's
hard to get the right semantics. To use it that way you need to define
the methods as a classmethod().

http://www.python.org/dev/peps/pep-3119/#one-trick-ponies

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2325>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2736] datetime needs and "epoch" method

2008-05-02 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

That's expected as mktime is just a thin wrapper over libc mktime() and
it does not expect microseconds. Changing time.mktime doesn't seems an
option, so the best alternative is to implement a method in datetime
type. Is there a real demand for C code implementing this to justify it?

--
nosy: +werneck

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2736>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2008-05-10 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file9499/issue_2118_smtplib.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2118>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue837234] Tk.quit and sys.exit cause Fatal Error

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

I tried reproducing the bug with the info provided but neither case
worked. Since it doesn't mention platform, I'm including the file in
case anyone wants to try it on anything other than Linux/Python2.5.

--
nosy: +werneck
Added file: http://bugs.python.org/file10242/issue837234.py


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue837234>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

Just a bare self._getints will raise an exception with no item selected
and an empty string returned, so I'm adding a patch to check for it and
return an empty tuple in that case, or the tuple with ints.

It's open for discussion if we should follow Tk documentation strictly
and return an empty string if no item selected, or keep consistency with
Python and other Tkinter parts and always return a tuple.

--
keywords: +patch
nosy: +werneck
Added file: http://bugs.python.org/file10246/issue869780_2.6.patch


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10248/issue869780_3.patch


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10246/issue869780_2.6.patch


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10248/issue869780_3.patch


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

I used the tuple from splitlist() in both cases. I'm not sure if it
should return None on an empty selection since that is not documented
anywhere.

Added file: http://bugs.python.org/file10252/issue869780.py


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

Neither I do, but the current version already returns an empty tuple.
Since the map(int, curselection) idiom is widely used, changing to int
is not likely to break any code, but returning None on empty selection is.


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1410739] Add notes to the manual about `is` and methods

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

I agree it's not a good idea to be too much specific about this. The
patch attached adds the following footnote to the 'is' operator:

Due to automatic garbage-collection, free lists, and the dynamic nature
of descriptors, you may notice unusual behaviour in certain combinations
of :keyword:`is` operator, like those involving identity comparisons
between class and instancemethods, and free instances in the same
expression. Check their docs for more info.

--
nosy: +werneck
Added file: http://bugs.python.org/file10263/issue1410739.patch

_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1410739>
_
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2378] UnboundLocalError when trying to raise exceptions inside execfile

2008-05-10 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

Just note the error happens even without the try/except block inside the
'if' statement.

--
nosy: +werneck

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2378>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck

Changes by Pedro Werneck <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10252/issue869780.py


Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue869780>

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2378] UnboundLocalError when trying to raise exceptions inside execfile

2008-05-11 Thread Pedro Werneck

Pedro Werneck <[EMAIL PROTECTED]> added the comment:

I get it with r63075, r63085, on Linux.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2378>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com