[issue9527] Add aware local time support to datetime module

2012-06-11 Thread James Henstridge
James Henstridge added the comment: One problem I can see with using a fixed offset tzinfo for localtime is that it might confuse people when doing date arithmetic. For example: >>> d = datetime.localtime() + timedelta(days=7) While it will give a correct answer as a point i

[issue12029] Catching virtual subclasses in except clauses

2012-05-11 Thread James Henstridge
Changes by James Henstridge : -- type: behavior -> enhancement ___ Python tracker <http://bugs.python.org/issue12029> ___ ___ Python-bugs-list mailing list Un

[issue12029] Catching virtual subclasses in except clauses

2012-05-11 Thread James Henstridge
James Henstridge added the comment: Benjamin: if you are after a use case for this feature, see https://code.djangoproject.com/ticket/15901 In Django, there are multiple database backends, each of which currently catch the adapter's DatabaseError and reraise it as Django's Databa

[issue12029] ABC registration of Exceptions

2012-05-10 Thread James Henstridge
James Henstridge added the comment: The documentation for ABCMeta.register() says that it makes the other class a "virtual subclass". That would make the ABC a "virtual base class". So whether the current behaviour is correct depends on whether you consider a "vi

[issue7366] weakref module example relies on behaviour not guaranteed by id()

2009-11-19 Thread James Henstridge
James Henstridge added the comment: Forgot to include a link to the documentation I was talking about: http://docs.python.org/library/weakref#example This example also appears in the 2.7a0 and 3.2a0 documentation. -- ___ Python tracker <h

[issue7366] weakref module example relies on behaviour not guaranteed by id()

2009-11-19 Thread James Henstridge
New submission from James Henstridge : The documentation for the weakref module contains an example that uses WeakValueDictionary to implement a id2obj() lookup function that doesn't store strong references to those objects. This example implicitly assumes that the id() of an object wi

[issue5305] imaplib should support international mailbox names

2009-02-19 Thread James Henstridge
James Henstridge added the comment: I'll have a go at implementing the algorithm. It looks like the modifications to UTF-7 are large enough that you can't do a search and replace on the output of the existing UTF-7 codec, so it'll probably require new code. Would Str

[issue5305] imaplib should support international mailbox names

2009-02-17 Thread James Henstridge
New submission from James Henstridge : The IMAP4rev1 specification allows for non-ASCII mailbox names using a modified UTF-7 encoding (section 5.1.3 of RFC 2060 or 3501). However, the imaplib routines taking a mailbox name just pass the string straight through without any encoding. It would be

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2009-02-16 Thread James Henstridge
New submission from James Henstridge : The datetime module does not support time zones whose offset from UTC is not an integer number of minutes. The Olson time zone database (used by most UNIX systems and Mac OS X) has a number of time zones with historic offsets that use second resolution

[issue2422] Automatically disable pymalloc when running under valgrind

2009-02-03 Thread James Henstridge
James Henstridge added the comment: Attached is an updated version of the patch against trunk (2.7). It simply fixes the conflicts that have occurred since the previous patch. Added file: http://bugs.python.org/file12935/disable-pymalloc-on-valgrind-py27.patch

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: If I create a test case with a command like: test = DocFileSuite('foo.txt', globs={'somelist': [42]}) The doctest isn't doing anything wrong if it modifies somelist. Furthermore, Glyph has said he thi

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-10 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: Is repeating a test with the same TestCase instance ever safe? It'd be better to create a new instance and run that. If any of the variables in test.globs are changed by the test (e.g. appending to a list), then rerunning th

[issue2422] Automatically disable pymalloc when running under valgrind

2008-04-01 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: There are probably a few other performance optimisations that would be good to turn off when running under valgrind. A big one is the tuple cache: if there are tuple reference counting issues, they won't necessarily be seen by

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-26 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: An updated version of the patch. The previous ones were missing the valgrind check, resulting in the pymalloc code paths being executed (which in turn cause unintialised read warnings from valgrind). Added file: http://bugs.pyth

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-23 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: Here's the updated version of my patch (the obmalloc.c bits applied without conflicts to the newer source tree). The configure changes are a bit different to Lauro's ones, in that they check for the existence of the he

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-19 Thread James Henstridge
Changes by James Henstridge <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9780/disable-pymalloc-on-valgrind-v2.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-19 Thread James Henstridge
Changes by James Henstridge <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file9781/disable-pymalloc-on-valgrind-v3.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-19 Thread James Henstridge
James Henstridge <[EMAIL PROTECTED]> added the comment: A slightly cleaned up version of the previous patch. I only needed to include . Added file: http://bugs.python.org/file9780/disable-pymalloc-on-valgrind-v2.patch __ Tracker <[EMAIL PROTECTE

[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-19 Thread James Henstridge
New submission from James Henstridge <[EMAIL PROTECTED]>: When I want to use valgrind to check for leaks in a Python program (or test suite), I generally want pymalloc disabled. When not running valgrind I generally want it enabled. Attached is a patch that automatically bypasses the py

[issue1339] smtplib starttls() should ehlo() if it needs to

2008-01-12 Thread James Henstridge
James Henstridge added the comment: >From RFC 2487 section 5.2: "The client MUST discard any knowledge obtained from the server, such as the list of SMTP service extensions, which was not obtained from the TLS negotiation itself. The client SHOULD send an EHLO command as the first comma