[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> __ __

[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.

[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://

[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 descri

[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 select

[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/iss

[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.

[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.

[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.

[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 discuss

[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: +we

[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.pytho

[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 the

[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/#

[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.pytho

[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 __ T

[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

[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/

[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 &l

[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