[issue20164] Undocumented KeyError from os.path.expanduser

2014-09-30 Thread Chris Adams
Chris Adams added the comment: I agree that making the code match the docs would be preferable – an unexpected KeyError might be easier to track down that way but it'd still surprise most developers. re:pwd docs, the formatting in https://hg.python.org/cpython/file/8e9df3414185/Doc/library

[issue20774] collections.deque should ship with a stdlib json serializer

2014-02-25 Thread Chris Adams
New submission from Chris Adams: Currently the stdlib json module requires a custom serializer to avoid throwing a TypeError on collections.deque instances: Python 3.3.4 (default, Feb 12 2014, 09:35:54) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin Type help, copyright

[issue20164] Undocumented KeyError from os.path.expanduser

2014-01-07 Thread Chris Adams
New submission from Chris Adams: This is a more general version of #10496: os.path.expanduser is documented as returning the unmodified string if it cannot be expanded (http://docs.python.org/3/library/os.path.html#os.path.expanduser) but there's one edge case where this can fail: when

[issue20164] Undocumented KeyError from os.path.expanduser

2014-01-07 Thread Chris Adams
Chris Adams added the comment: Other than hoisting the warnings import to the top (PEP-8) that seems entirely reasonable to me. The user report which we got was confusing because it was non-obvious where it came from - a warning or other pointer would have helped the original reporter get

[issue19065] sqlite3 timestamp adapter chokes on timezones

2013-09-21 Thread Chris Adams
New submission from Chris Adams: If you use detect_types=sqlite3.PARSE_DECLTYPES with sqlite3 and insert a timezone-aware datetime instance, you will get a ValueError if you attempt to read it back out: File /usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib

[issue17381] IGNORECASE breaks unicode literal range matching

2013-03-11 Thread Chris Adams
Chris Adams added the comment: Ezio: given the non-obvious failure, what do you think of at least documenting this and issuing a warning any time both re.UNICODE and re.IGNORECASE are set? -- ___ Python tracker rep...@bugs.python.org http

[issue17381] IGNORECASE breaks unicode literal range matching

2013-03-08 Thread Chris Adams
Chris Adams added the comment: Ah, that explains it - I'd been hoping based on the re.DEBUG output that the explicit unicode ranges were preserved. I found #3511 before opening this one but don't believe the decision should be the same since this isn't a mixed numeric/alphabetic range

[issue17381] IGNORECASE breaks unicode literal range matching

2013-03-07 Thread Chris Adams
New submission from Chris Adams: I noticed an interesting failure while using re.match / re.sub to look for non-Cyrillic characters in allegedly Russian text: re.sub(r'[\s\u0400-\u0527]+', ' ', 'Архангельская губерния', flags=re.IGNORECASE) 'Архангельская губерния' re.sub(r'[\s\u0400