[issue22434] Use named constants internally in the re module
Roundup Robot added the comment: New changeset fc7dbba57869 by Serhiy Storchaka in branch 'default': Issue #22434: Constants in sre_constants are now named constants (enum-like). https://hg.python.org/cpython/rev/fc7dbba57869 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22434 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22824] Update reprlib to use set literals
Serhiy Storchaka added the comment: The repr of empty array() should be fixed too. -- nosy: +serhiy.storchaka Added file: http://bugs.python.org/file37165/issue22824_3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22824 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21301] pathlib missing Path.expandvars(env=os.environ)
Wolfgang Langner added the comment: expandvars(), and expanduser() is part of os.path. Boot functions are needed for path objects and very useful. And yes it is a simple string substitution but very common. -- nosy: +tds333 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21301 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19767] pathlib: iterfiles() and iterdirs()
Wolfgang Langner added the comment: Why not implement this pattern with def dirs(pattern) and def files(pattern) where both are a simple shortcut for (p for p in mypath.glob(pattern) if p is_file()) or is_dir() ? -- nosy: +tds333 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19767 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22821] Argument of wrong type is passed to fcntl()
Roundup Robot added the comment: New changeset 61e99438c237 by Serhiy Storchaka in branch '2.7': Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian https://hg.python.org/cpython/rev/61e99438c237 New changeset 45e8aed69767 by Serhiy Storchaka in branch '3.4': Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian https://hg.python.org/cpython/rev/45e8aed69767 New changeset 2d203a0b7908 by Serhiy Storchaka in branch 'default': Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian https://hg.python.org/cpython/rev/2d203a0b7908 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22821 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22821] Argument of wrong type is passed to fcntl()
Serhiy Storchaka added the comment: Fixed in 3.5 as part of 6e6532d313a1 as it was easier to integrate it as part of the Clinic patch. 6e6532d313a1 has introduced other bug (l was parsed to int). Changed to I for reasons described in the comment in fcntl_ioctl_impl(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22821 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22821] Argument of wrong type is passed to fcntl()
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: commit review - resolved status: open - closed versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22821 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile
Ronald Oussoren added the comment: The environment variable itself cannot be removed from CPython, it is necessary to implement the correct behavior of pyvenv with framework builds of Python. That said, I do think that the environment variable should be unset as soon as possible in the CPython startup code to avoid accidentally affecting other interpreters. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22490 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22813] No facility for test randomisation
Michael Foord added the comment: The point is that it is easy to have unintentional dependencies between tests. Test a sets up some state that test b relies on. This means that test b passes, so long as test a has already run. This is bad, tests should be isolated - it also means you can break test b when you change test a. Randomising test run order means you discover these unintentional dependencies earlier. With test randomisation you ideally need the seed to be displayed as part of the test run, and you need to be able to run with a particular seed. This enables you to reproduce failures, or odd results, from any particular test run. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22813 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22827] Backport ensurepip to 2.7 (PEP 477)
Michael Foord added the comment: mock in the Python standard library is licensed under the PSF license. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22827 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22836] Broken Exception ignored in: message on exceptions in __repr__
New submission from Florian Bruhin: When there's an unraisable exception (e.g. in __del__), and there's an exception in __repr__ as well, PyErr_WriteUnraisable returns after writing Exception ignored in: immediately. I'd expect it to fall back to the default __repr__ instead. See the attached example script. Output with 3.4: === Obj === Exception ignored in: bound method Obj.__del__ of __main__.Obj object at 0x7fd842deb4a8 Traceback (most recent call last): File test.py, line 4, in __del__ raise Exception('in del') Exception: in del === BrokenObj === Exception ignored in: (no newline) Output with 2.7: === Obj === Exception Exception: Exception('in del',) in bound method Obj.__del__ of __main__.Obj object at 0x7fa824dbfa50 ignored === BrokenObj === Exception Exception: Exception('in del',) in ignored The output with 2.7 is a bit more useful, but still confusing. -- components: Interpreter Core files: repr_exception.py messages: 230950 nosy: The Compiler priority: normal severity: normal status: open title: Broken Exception ignored in: message on exceptions in __repr__ type: behavior versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file37166/repr_exception.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12728] Python re lib fails case insensitive matches on Unicode data
Roundup Robot added the comment: New changeset 4caa695af94c by Serhiy Storchaka in branch '2.7': Issue #12728: Different Unicode characters having the same uppercase but https://hg.python.org/cpython/rev/4caa695af94c New changeset 47b3084dd6aa by Serhiy Storchaka in branch '3.4': Issue #12728: Different Unicode characters having the same uppercase but https://hg.python.org/cpython/rev/47b3084dd6aa New changeset 09ec09cfe539 by Serhiy Storchaka in branch 'default': Issue #12728: Different Unicode characters having the same uppercase but https://hg.python.org/cpython/rev/09ec09cfe539 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12728 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12728] Python re lib fails case insensitive matches on Unicode data
Serhiy Storchaka added the comment: This solution (with hardcoded table of equivalent lowercases) is temporary. In future re engine will be changed to support correct caseless matching of different lowercase forms internally. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12728 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22578] Add additional attributes to re.error
Ezio Melotti added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22578 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys
New submission from Florian Bruhin: When using getpass.getpass() on Windows and typing a tilde (~) with a layout with dead keys (e.g. Swiss German), one would typically type ~ to get a single tilde. However, this returns '\x00\x83~' with getpass. It seems this is what msvcrt.getch() returns. Microsofts documentation at http://msdn.microsoft.com/en-us/library/aa297934(v=vs.60).aspx only says When reading a function key or an arrow key, _getch and _getche must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code. which doesn't really apply to this. It seems to work fine with other dead keys like ` or ^. Unless someone knows more about what's happening here I'd suggest replacing '\x00\x83~' by '~' in getpass. -- components: Library (Lib) messages: 230954 nosy: The Compiler, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: getpass returns garbage when typing tilde on Windows with deadkeys type: behavior versions: Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22837 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22836] Broken Exception ignored in: message on exceptions in __repr__
Martin Panter added the comment: This is one that has often bugged me. When your repr() implementation is broken, it is quite confusing figuring out what is going wrong. Falling back to object.__repr__() is one option, however I would probably be happy with a simple “exception in repr()” message, and a proper newline. Another way that I have come across this is: $ python -c 'import sys; sys.stdout.detach()' Exception ignored in: [no newline] The workaround there is to set sys.stdout = None. In that case I think repr(sys.stdout) is trying to say “ValueError: underlying buffer has been detached”. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21724] resetwarnings doesn't reset warnings registry
Changes by Robert Muil robertm...@gmail.com: -- nosy: +robertmuil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21724 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22836] Broken Exception ignored in: message on exceptions in __repr__
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22837 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22578] Add additional attributes to re.error
Roundup Robot added the comment: New changeset 292c4d853662 by Serhiy Storchaka in branch 'default': Issue #22578: Added attributes to the re.error class. https://hg.python.org/cpython/rev/292c4d853662 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22578 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22431] Change format of test runner output
Michael Foord added the comment: I agree with Robert that the text output of the default runner should not be considered a part of the api that we make backwards compatible guarantees about. People who want to customise that should be customising the text runner/result. (Unfortunately it requires tinkering with both at the moment.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22431 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22578] Add additional attributes to re.error
Roundup Robot added the comment: New changeset 07f082b200a7 by Serhiy Storchaka in branch 'default': Fixed IDLE tests after changing re error messages (issue #22578). https://hg.python.org/cpython/rev/07f082b200a7 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22578 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22198] Odd floor-division corner case
Petr Viktorin added the comment: ping, could someone please review the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22578] Add additional attributes to re.error
Serhiy Storchaka added the comment: Thank you Ezio for your review. -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22578 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys
Florian Bruhin added the comment: Maybe this is related: U+0083 is the no break here char: http://www.fileformat.info/info/unicode/char/0083/index.htm http://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_set From wikipedia: Follows the graphic character that is not to be broken. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22837 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part
R. David Murray added the comment: This is a duplicate of issue 6302. Re-reading that issue (again), I'm not quite sure why we didn't fix it, but it may be too late to fix it now for backward compatibility reasons. Since that issue strayed off into other topics, I'm going to leave this one open to consider whether or not we can/should fix this. The new email API does avoid this problem, though. Is there a reason you are choosing not to use the new API? -- versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22833 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22834] Unexpected FileNotFoundError when current directory is removed
R. David Murray added the comment: Looks like importlib doesn't handle the case of a directory on the path being deleted? If so, I'm surprised this hasn't been reported before. -- nosy: +brett.cannon, eric.snow, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22834 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22835] urllib2/httplib is rendering 400s for every authenticated-SSL request, suddenly
R. David Murray added the comment: If you haven't updated Python, then it is hard to see how this could be a python bug. Not impossible, but you'll have to narrow down the problem before you'd be able to demonstrate it as a python bug, I'm afraid. If you want help diagnosing this, you might try the python-list mailing list, though it sounds like a nginx forum might be equally useful at this stage (determining what exactly is going on protocol wise that is different between your two test cases). -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22835 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22836] Broken Exception ignored in: message on exceptions in __repr__
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22364] Improve some re error messages using regex for hints
Serhiy Storchaka added the comment: Here is a patch which makes re error messages match regex. It doesn't look to me that all these changes are enhancements. -- keywords: +patch Added file: http://bugs.python.org/file37167/re_errors_regex.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22364 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22838] Convert re tests to unittest
New submission from Serhiy Storchaka: Current re tests consists of two parts. One part use unittest and other part import test cases from Lib/test/re_tests.py, checks conditions and prints messages to stdout if they are false. Proposed patch converts all test_re to using unittest. -- assignee: serhiy.storchaka components: Regular Expressions, Tests files: re_tests.patch keywords: patch messages: 230966 nosy: ezio.melotti, mrabarnett, pitrou, serhiy.storchaka, zach.ware priority: normal severity: normal stage: patch review status: open title: Convert re tests to unittest type: enhancement versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37168/re_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22838 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11907] SysLogHandler can't send long messages
Domen Kožar added the comment: Note: same bug is relevant to DatagramHandler since it uses UDP transport. -- nosy: +iElectric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22839] Incorrect link to statistics in tracemalloc documentation
New submission from Jonathan Sharpe: The link to statistics in the documentation for tracemalloc.Snapshot.compare_to (https://docs.python.org/3/library/tracemalloc.html#tracemalloc.Snapshot.compare_to) should be to the statistics method (https://docs.python.org/3/library/tracemalloc.html#tracemalloc.Snapshot.statistics), per the description, not to the statistics module (https://docs.python.org/3/library/statistics.html#module-statistics), where it currently points. -- assignee: docs@python components: Documentation messages: 230968 nosy: docs@python, jonrsharpe priority: normal severity: normal status: open title: Incorrect link to statistics in tracemalloc documentation versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22839 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask
pmoody added the comment: # We only support CIDR for IPv6, because expanded netmasks are not # standard notation. Yes, that's correct. I can double check this, but when I wrote ipaddress, I had yet to encounter a v6 netmask in anything other than cider notation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask
pmoody added the comment: Hey Chris, What's the usecase for this? the netmask notation doesn't appear to be common for v6 (at all), so I'm hesitant to add support for this if it's just something like an academic exercise. Cheers, peter -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask
Chris PeBenito added the comment: I understand the resistance; I'm fine closing this as won't implement, though this is not for academic use. In a nutshell, my package currently has a set of classes to represent an SELinux policy, and the SELinux policy language represents networks with extended netmask[1]. I control the package, so I can change the internal representation from extended netmask to CIDR, so it's not the end of the world. [1] example statement: nodecon ff00:: ff00:: system_u:object_r:multicast_node_t -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22800] IPv6Network constructor sometimes does not recognize legitimate netmask
pmoody added the comment: If you have the ability to use cidr, then closing this as wontfix is my preference. I've heard that there might be some network vendors that are starting support the mask notation for v6 addresses though, so this may end up getting implemented at some point in future anyway. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22581] Other mentions of the buffer protocol
Serhiy Storchaka added the comment: Here is a patch which fixes remnants. It also corrects descriptions of parsing arguments format units. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file37169/bytes_like.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22581 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22839] Incorrect link to statistics in tracemalloc documentation
Roundup Robot added the comment: New changeset 387bbada31e8 by Berker Peksag in branch '3.4': Issue #22839: Fix Snapshot.statistics() link. https://hg.python.org/cpython/rev/387bbada31e8 New changeset 524a004e93dd by Berker Peksag in branch 'default': Issue #22839: Fix Snapshot.statistics() link. https://hg.python.org/cpython/rev/524a004e93dd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22839 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22839] Incorrect link to statistics in tracemalloc documentation
Berker Peksag added the comment: Fixed. Thanks for the report, Jonathan. -- nosy: +berker.peksag resolution: - fixed stage: - resolved status: open - closed type: - behavior versions: -Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22839 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part
py.user added the comment: R. David Murray wrote: Is there a reason you are choosing not to use the new API? My program is for Python 3.x. I need to decode wild headers to pretty unicode strings. Now, I do it by decode_header() and try...except for AttributeError, since a unicode string has no .decode() method. I don't know what is new API, but I guess it's not compatible with Python 3.0. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22833 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
New submission from Doug Gorley: strptime() is returning the wrong date if I try to parse today's date (2014-11-10) as a string with no separators, and if I ask strpdate() to look for nonexistent hour and minute fields. datetime.datetime.strptime('20141110', '%Y%m%d').isoformat() '2014-11-10T00:00:00' datetime.datetime.strptime('20141110', '%Y%m%d%H%M').isoformat() '2014-01-01T01:00:00' -- components: Library (Lib) messages: 230977 nosy: dgorley priority: normal severity: normal status: open title: strpdate('20141110', '%Y%m%d%H%S') returns wrong date type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22835] urllib2/httplib is rendering 400s for every authenticated-SSL request, suddenly
Antoine Pitrou added the comment: No upgrades on the server either? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22835 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Ethan Furman added the comment: What result did you expect? -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Doug Gorley added the comment: I expected the second call to strpdate() to throw an exception, because %Y consumed '2014', %m consumed '11', and %d consumed '10', leaving nothing for %H and %M to match. That would be consistent with the first call. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part
R. David Murray added the comment: Certainly not with 3.0, but nobody in their right mind should be using that version any more :). The new API for decoding headers is available as of Python 3.3, with additional new API features in 3.4. See https://docs.python.org/3/library/email-examples.html#examples-using-the-provisional-api for an example. Note that although the API is 'provisional', I anticipate no non-trivial changes when it becomes final in 3.5. (The only API change that has happened has been done such that you get warnings if you use it wrong in 3.4, and is in a relatively obscure method (is_attachment). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22833 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22719] os.path.isfile os.path.exists bug in while loop
Aaron added the comment: Python 3.3.0, Windows 7, both 64 bit. Has it been resolved with the newer version, then? On Mon, Nov 3, 2014 at 11:15 PM, Zachary Ware rep...@bugs.python.org wrote: Zachary Ware added the comment: Aaron, what version of Python are you using on what version of Windows? Also, 32 or 64 bit on both? I can't reproduce this with any Python 3.3.6 or newer on 64-bit Windows 8.1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22719 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22719 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Ethan Furman added the comment: The documentation certainly appears to say that %m, for example, will consume two digits, but it could just as easily be only for output (i.e. strftime). I suspect this is simply a documentation issue as opposed to a bug, but let's see what the others think. -- nosy: +belopolsky, lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22841] Avoid to use coroutine with add_signal_handler()
New submission from Ludovic Gasc: Hi, Victor Stinner suggested me during PyCON-FR to send you this: It's a pico-patch to forbid a coroutine as parameter of add_signal_handler(). I've added a test for that, the patch is based on the latest commit in Tulip. Thanks for your feedback. Regards. -- components: asyncio files: add_signal_handler_no_coroutines.patch keywords: patch messages: 230984 nosy: Ludovic.Gasc, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: Avoid to use coroutine with add_signal_handler() versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37170/add_signal_handler_no_coroutines.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22841 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22719] os.path.isfile os.path.exists bug in while loop
Zachary Ware added the comment: I haven't built 3.3.0 again yet to try to reproduce with it, but there have been enough bug and security fixes in the more recent 3.3 releases that I'd strongly advise updating on general principle and seeing if this issue goes away. If not to 3.4.2, at least to 3.3.5 (the last 3.3 version to have a Windows installer). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22719 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Alexander Belopolsky added the comment: I have recently closed a similar issue (#5979) as won't fix. The winning argument there was that Python behavior was consistent with C. How does C strptime behave in this case? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Alexander Belopolsky added the comment: With the following C code: #include time.h #include stdio.h #include stdlib.h #include string.h int main(){ char buf[255]; struct tm tm; memset(tm, 0, sizeof(tm)); strptime(20141110, %Y%m%d%H%M, tm); strftime(buf, sizeof(buf), %Y-%m-%d %H:%M, tm); printf(%s\n, buf); return 0; } I get $ ./a.out 2014-11-10 00:00 So I think Python behavior is wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22842] zipfile simultaneous open broken and/or needlessly(?) consumes unreasonable number of file descriptors
New submission from David Wilson: There is some really funky behaviour in the zipfile module, where, depending on whether zipfile.ZipFile() is passed a string filename or a file-like object, one of two things happens: a) Given a file-like object, zipfile does not (since it cannot) consume excess file descriptors on each call to '.open()', however simultaneous calls to .open() the zip file's members (from the same thread) will produce file-like objects for each member that appear intertwingled in some unfortunate manner: Traceback (most recent call last): File my.py, line 23, in module b() File my.py, line 18, in b m.readline() File /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/zipfile.py, line 689, in readline return io.BufferedIOBase.readline(self, limit) File /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/zipfile.py, line 727, in peek chunk = self.read(n) File /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/zipfile.py, line 763, in read data = self._read1(n) File /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/zipfile.py, line 839, in _read1 data = self._decompressor.decompress(data, n) zlib.error: Error -3 while decompressing data: invalid stored block lengths b) Given a string filename, simultaneous use of .open() produces a new file descriptor for each opened member, which does not result in the above error, but triggers an even worse one: file descriptor exhaustion given a sufficiently large zip file. This tripped me up rather badly last week during consulting work, and I'd like to see both these behaviours fixed somehow. The ticket is more an RFC to see if anyone has thoughts on how this fix should happen; it seems to me a no-brainer that, since the ZIP file format fundamentally always requires a seekable file, that in both the constructed using file-like object case, and the constructed using filename case, we should somehow reuse the sole file object passed to us to satisfy all reads of compressed member data. It seems the problems can be fixed in both cases without damaging interface semantics by simply tracking the expected 'current' read offset in each ZipExtFile instance. Prior to any read, we simply call .seek() on the file object prior to performing any .read(). Of course the result would not be thread safe, but at least in the current code, ZipExtFile for a constructed from a file-like object edition zipfile is already not thread-safe. With some additional work, we could make the module thread-safe in both cases, however this is not the current semantic and doesn't appear to be guaranteed by the module documentation. --- Finally as to why you'd want to simultaneously open huge numbers of ZIP members, well, ZIP itself easily supports streamy reads, and ZIP files can be quite large, even larger than RAM. So it should be possible, as I needed last week, to read streamily from a large number of members. --- The attached my.zip is sufficient to demonstrate both problems. The attached my.py has function a() to demonstrate the FD leak and b() to demonstrate the interwingly state. -- components: Library (Lib) files: mymy.zip messages: 230987 nosy: dw priority: normal severity: normal status: open title: zipfile simultaneous open broken and/or needlessly(?) consumes unreasonable number of file descriptors versions: Python 3.4 Added file: http://bugs.python.org/file37171/mymy.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Alexander Belopolsky added the comment: Here is the case that I think illustrates the current logic better: datetime.strptime(20141234, %Y%m%d%H%M) datetime.datetime(2014, 1, 2, 3, 4) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22842] zipfile simultaneous open broken and/or needlessly(?) consumes unreasonable number of file descriptors
David Wilson added the comment: As a random side-note, this is another case where I really wish Python had a .pread() function. It's uniquely valuable for coordinating positioned reads in a threaded app without synchronization (at user level anyway) or extraneous system calls. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Alexander Belopolsky added the comment: Looking at the POSIX standard http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html It appears that Python may be compliant: %H The hour (24-hour clock) [00,23]; leading zeros are permitted but not required. %m The month number [01,12]; leading zeros are permitted but not required. %M The minute [00,59]; leading zeros are permitted but not required. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22269] Resolve distutils option conflicts with priorities
Tim Smith added the comment: Ping! Any chance for feedback here? This behavior took me by surprise again today. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22269 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date
Alexander Belopolsky added the comment: Here is another interesting bit from the standard: The application shall ensure that there is white-space or other non-alphanumeric characters between any two conversion specifications. This is how they get away from not specifying whether parser of variable width fields should be greedy or not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22843] doc error: 6.2.4. Match Objects
New submission from Clayton Kirkwood: Documentation says: Match objects always have a boolean value of True. Since match() and search() return None when there is no match, you can test whether there was a match with a simple if statement: match = re.search(pattern, string) if match: process(match) What happens: blah = _sre.SRE_Match object; span=(0, 28), match='BRNov. 10, 08:16:09 PM EST' if blah == True: print(True) if blah: print('blah True') blah True /// Blah is not True One suggestion: instead, the passage above should say “evaluates true in a boolean context”. -- assignee: docs@python components: Documentation messages: 230994 nosy: crkirkwood, docs@python priority: normal severity: normal status: open title: doc error: 6.2.4. Match Objects type: resource usage versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22843 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22842] zipfile simultaneous open broken and/or needlessly(?) consumes unreasonable number of file descriptors
R. David Murray added the comment: This is a duplicate of issue 16569 and issue 14099. Since the former links to the latter I'm using that as the superseder. -- nosy: +r.david.murray resolution: - duplicate stage: - resolved status: open - closed superseder: - Preventing errors of simultaneous access in zipfile ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22843] doc error: 6.2.4. Match Objects
R. David Murray added the comment: That's what have a boolean value of True means. (ie: bool(matchobject) is True). I'm neutral on whether or not it is worth changing the wording. -- nosy: +r.david.murray type: resource usage - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22843 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22844] test_gdb failure on Debian Wheezy for Z
New submission from David Edelsohn: I added a Buildbot on another zLinux system running Debian Wheezy and it shows a different GDB error message: linux-vdso64.so. Can you please add something like the following to allow test_gdb to pass? diff -r 524a004e93dd Lib/test/test_gdb.py --- a/Lib/test/test_gdb.py Mon Nov 10 23:15:56 2014 +0200 +++ b/Lib/test/test_gdb.py Mon Nov 10 20:51:49 2014 -0500 @@ -169,6 +169,8 @@ 'linux-vdso.so', 'warning: Could not load shared library symbols for ' 'linux-gate.so', +'warning: Could not load shared library symbols for ' +'linux-vdso64.so', 'Do you need set solib-search-path or ' 'set sysroot?', 'warning: Source file is more recent than executable.', -- components: Tests messages: 230997 nosy: David.Edelsohn, haypo priority: normal severity: normal status: open title: test_gdb failure on Debian Wheezy for Z type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22844 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16569] Preventing errors of simultaneous access in zipfile
David Wilson added the comment: Compared to the cost of everything else ZipExtFile must do (e.g. 4kb string concatenation in a loop, zlib), its surprising that lseek() would measurable at all. The attached file 'patch' is the minimal change I tested. It represents, in terms of computation and system call overhead, all required to implement the seek before read solution to simultaneous access. On OSX, churning over ever member of every ZIP in my downloads directory (about 400mb worth), this change results in around 0.9% overhead compared to the original module. Subsequently I'm strongly against the patch here. It is in effect papering over an implementation deficiency of the current zipfile module, one that could easily and cheaply be addressed. (My comment on this ticket is in the context of the now-marked-duplicate issue22842). -- nosy: +dw Added file: http://bugs.python.org/file37172/patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16569 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22813] No facility for test randomisation
sbspider added the comment: Right makes sense. I'll see what I can do. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22813 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22719] os.path.isfile os.path.exists bug in while loop
Zachary Ware added the comment: I have had a chance to build 3.3.0 and I was able to reproduce the bug with it, so it is in fact fixed in later versions. -- resolution: - out of date stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22719 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22835] urllib2/httplib is rendering 400s for every authenticated-SSL request, suddenly
Dustin Oprea added the comment: I think I was getting mixed results by using requests and urllib2/3. After nearly being driven crazy, I performed the following steps: 1. Recreated client certificates, and verified that the correct CA was being used from Nginx. 2. Experimenting using an SSL-wrapped client-socket directly, in tandem with s_client. 3. I then removed all of my virtualhosts except for a new one that pointed to a flat directory, just to make sure that I wasn't activating the wrong virtualhost, and there weren't any other complexities. 4. Implemented a bonafide, signed, SSL certificate on my local system, and overriding the hostname using /etc/hosts. 5. This got me past the 400. I switched back to using my local hostname with my self-signed certificate, and told wrap_socket to not verify (at this point, I stopped checking with s_client). 6. I started reactivating all of my normal virtualhost includes, one include at a time. 7. Reverted back to using the standard, proprietary client, and verified that it worked. I'm guessing that a) something happened to my original certificates, b) I might've had an incorrect CA certificate for authentication, and/or c) I had added a default virtualhost on the non-standard port that I am using that always returns Forbidden, and this might've been unexpectedly catching the wrong requests. Since I verified my client certificates against my internal issuer in the beginning, I don't think it's (a) or (b). I could've done without these problems. I can't even say what started it all. -- nosy: +dsoprea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22835 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22823] Use set literals instead of creating a set from a list
Larry Hastings added the comment: Serhiy: set_literal_2.patch doesn't apply cleanly, so I don't get a review link. And apparently Raymond checked in some other changes separately. Could you redo your patch so it has the Clinic changes, and ensure I get a review link? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22845] Minor tweaks dis documentation
New submission from Serhiy Storchaka: Proposed patch changes dis documentation: * formats the *file* parameter with stars, not ``backticks``. * adds missed links to opcodes. * fixes POP_STACK to POP_TOP. I hesitate about TOS and TOS1 words. Should they be highlighted in any manner? -- assignee: docs@python components: Documentation files: doc_dis.patch keywords: patch messages: 231003 nosy: docs@python, georg.brandl, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Minor tweaks dis documentation type: enhancement versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37173/doc_dis.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22845 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22845] Minor tweaks dis documentation
Georg Brandl added the comment: LGTM. While at it, could you add a period after these: + Added *file* parameter -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22845 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22823] Use set literals instead of creating a set from a list
Serhiy Storchaka added the comment: Here is updated patch for clinic only. -- keywords: +patch Added file: http://bugs.python.org/file37174/set_literal_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com