[issue23765] Remove IsBadStringPtr calls in ctypes
Roundup Robot added the comment: New changeset 585e555247ac by Steve Dower in branch 'default': Issue #23765: Remove IsBadStringPtr calls in ctypes https://hg.python.org/cpython/rev/585e555247ac -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23314] Disabling CRT asserts in debug build
Steve Dower added the comment: I haven't seen any of these in a while, and the buildbot at http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x (the only one running VS 2015 right now AFAIK) hasn't either, so I'm calling this fixed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23314 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23763] Chain exceptions in C
Serhiy Storchaka added the comment: I think it would be safer to defer automatically chaining exceptions to 3.6. After releasing 3.5 we can got reports about exceptions ignored by mistake. After fixing all bugs not covered by the testsuite, we could try automatically chain exceptions. May be this will require longer transient period, 3.6-3.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23763 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23773] importlib does not properly remove frames when invoking external import hooks
Changes by Ned Deily n...@acm.org: -- nosy: +brett.cannon stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23773 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23546] Windows, 'Edit withIDLE', and multiple installed versions
Steve Dower added the comment: I've committed a change that adds a submenu for IDLE almost exactly like Liam's mockup. Thanks for pushing me on this, I probably wouldn't have worked this hard to get something as robust otherwise :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23546 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23765] Remove IsBadStringPtr calls in ctypes
Changes by Steve Dower steve.do...@microsoft.com: -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments
Changes by Steve Dower steve.do...@microsoft.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23465 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9445] Fix undefined symbol errors on VS8.0 build
Roundup Robot added the comment: New changeset d094eeeb1496 by Steve Dower in branch 'default': Closes #9445: Removes detection of GetFinalPathNameByHandle https://hg.python.org/cpython/rev/d094eeeb1496 -- nosy: +python-dev stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23619] Python 3.5.0a2 installer fails on Windows
Steve Dower added the comment: Migrated the test failures to #23774 and closing this. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19351] python msi installers - silent mode
Steve Dower added the comment: I'm not exactly sure how msiexec does its parsing, but it's possible that ALLUSERS=1 may not actually be the same as ALLUSERS=1. I use the latter regularly with most versions of Python in existence and it works fine. There may also be problems upgrading from the previous installation. If you run the old installers then they may offer to remove Python, even if it doesn't show up in Programs and Features. -- versions: -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23774] Test failures when unable to write to install location
New submission from Steve Dower: The following tests fail when run in an all-users installation because they cannot write to the install directory: test_compileall test_tcl test_tools test_zipfile See the attached file for traces. From Ned Deily: Regarding tests trying to write into the install directory tree, I'm pretty sure that there have been fixes added for those but I can't recall off the top of my head specific examples. I think the best approach is to use a temporary, writable directory instead; if that's not practical, then the test case should be skipped. I support fixing any tests that still currently fail due to this. (New issue cloned from discussion on #23619) -- components: Tests, Windows files: 35a2-failures.txt messages: 239225 nosy: ned.deily, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: Test failures when unable to write to install location type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file38682/35a2-failures.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23774 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22904] make profile-opt includes -fprofile* flags in _sysconfigdata CFLAGS
Ned Deily added the comment: Slavek, this issue and its superseder are both closed so comments here will likely not be acted on. -- nosy: +ned.deily stage: needs patch - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22904 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23767] Library and include paths not added when cross compiling on localized sytem
Changes by Ned Deily n...@acm.org: -- nosy: +doko stage: - patch review versions: +Python 2.7, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23767 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23573] Avoid redundant allocations in str.find and like
Serhiy Storchaka added the comment: Many thanks Victor for fixing crashes. Unfortunately I couldn't reproduce a crash on my computers, perhaps it is was 64-bit only. Yes, I'll look how the code can be optimized. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23573 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21319] WindowsRegistryFinder never added to sys.meta_path
Steve Dower added the comment: I've seen some module paths be registered there, but no, it doesn't really get used much (maybe because it's been broken?) os.name is certainly the right test here. FWIW, I'd rather be prioritising file system over registry for finding packages anyway. It makes it much easier to set up app-local installs of Python (there are also conflicts between e.g. Canopy and CPython virtual environments because of the registry...). I know this is mostly getpath.c's fault and not importlib though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21717] Exclusive mode for ZipFile and TarFile
Roundup Robot added the comment: New changeset b2a8c30d8ddb by Serhiy Storchaka in branch 'default': Issue #21717: The zipfile.ZipFile.open function now supports 'x' (exclusive https://hg.python.org/cpython/rev/b2a8c30d8ddb -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files
Serhiy Storchaka added the comment: The only difference is in error message. For now: unicodedata.name(123) Traceback (most recent call last): File stdin, line 1, in module TypeError: must be str, not int unicodedata.name('123') Traceback (most recent call last): File stdin, line 1, in module TypeError: need a single Unicode character as parameter Patched: unicodedata.name(123) Traceback (most recent call last): File stdin, line 1, in module TypeError: must be a unicode character, not int unicodedata.name('123') Traceback (most recent call last): File stdin, line 1, in module TypeError: must be a unicode character, not str If you think old messages were better, we can change standard error messages for 'C' format unit. We already changed standard and specialized error messages in 3.5 and earlier. In 3.4 it looks as: unicodedata.name(123) Traceback (most recent call last): File stdin, line 1, in module TypeError: must be str, not int unicodedata.name('123') Traceback (most recent call last): File stdin, line 1, in module TypeError: need a single Unicode character as parameter -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20181 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23774] Test failures when unable to write to install location
Serhiy Storchaka added the comment: There is a guard for zipfile tests (requiresWriteAccess). The question is why it doesn't work for this test but works for other tests. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23774 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23775] Fix pprint of OrderedDict
New submission from Serhiy Storchaka: Currently pprint prints the repr of OrderedDict if it fits in one line, and prints the repr of dict if it is wrapped. import collections, pprint pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)])) OrderedDict([(4, 3), (2, 1)]) pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)]), width=25) {4: 3, 2: 1} Proposed patch makes pprint always produce an output compatible with OrderedDict's repr. pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)]), width=25) OrderedDict([(4, 3), (2, 1)]) -- assignee: serhiy.storchaka components: Library (Lib) files: pprint_ordered_dict.patch keywords: patch messages: 239234 nosy: fdrake, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fix pprint of OrderedDict type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file38683/pprint_ordered_dict.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23775 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files
Larry Hastings added the comment: I read it quickly. It looks basically okay, but I have one issue to discuss right now. Changing from the format unit 'O!' and calling getuchar to the format unit 'C' means a change in semantics. The text in the exception will change. Unfortunately, people do depend on that in real-world code. It'd be nice if we could change those semantics; this won't ship until 3.5 so maybe it's okay. I don't know. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20181 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23763] Chain exceptions in C
STINNER Victor added the comment: Le mercredi 25 mars 2015, Serhiy Storchaka rep...@bugs.python.org a écrit : I think it would be safer to defer automatically chaining exceptions to 3.6. After releasing 3.5 we can got reports about exceptions ignored by mistake. Hum, what change can ignore exceptions by mistake? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23763 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21717] Exclusive mode for ZipFile and TarFile
Berker Peksag added the comment: LGTM. I left two minor comments on Rietveld. Sorry for the delay. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21717] Exclusive mode for ZipFile and TarFile
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23769] valgrind reports leaks for test_zipimport
Robert Kuska added the comment: I tried leak2.py with valgrind, I've uncommented the lines you mentioned. $ valgrind python3 leak2.py ==28421== Memcheck, a memory error detector ==28421== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==28421== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==28421== Command: python3 leak2.py ==28421== ==28421== ==28421== HEAP SUMMARY: ==28421== in use at exit: 1,599,354 bytes in 11,594 blocks ==28421== total heap usage: 284,971 allocs, 273,377 frees, 37,976,898 bytes allocated ==28421== ==28421== LEAK SUMMARY: ==28421==definitely lost: 0 bytes in 0 blocks ==28421==indirectly lost: 0 bytes in 0 blocks ==28421== possibly lost: 597,482 bytes in 2,319 blocks ==28421==still reachable: 1,001,872 bytes in 9,275 blocks ==28421== suppressed: 0 bytes in 0 blocks ==28421== Rerun with --leak-check=full to see details of leaked memory ==28421== ==28421== For counts of detected and suppressed errors, rerun with: -v ==28421== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) I've removed `import readline` from leak2.py, everything else left as in previous run (also ofc removed tracemalloc). $ valgrind python3 leak3.py ==28515== Memcheck, a memory error detector ==28515== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==28515== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==28515== Command: python3 leak2.py ==28515== ==28515== ==28515== HEAP SUMMARY: ==28515== in use at exit: 1,599,384 bytes in 11,595 blocks ==28515== total heap usage: 285,648 allocs, 274,053 frees, 38,126,379 bytes allocated ==28515== ==28515== LEAK SUMMARY: ==28515==definitely lost: 30 bytes in 1 blocks ==28515==indirectly lost: 0 bytes in 0 blocks ==28515== possibly lost: 597,375 bytes in 2,317 blocks ==28515==still reachable: 1,001,979 bytes in 9,277 blocks ==28515== suppressed: 0 bytes in 0 blocks ==28515== Rerun with --leak-check=full to see details of leaked memory ==28515== ==28515== For counts of detected and suppressed errors, rerun with: -v ==28515== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Duh? Why does readline have this effect? -- Added file: http://bugs.python.org/file38684/leak3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23769 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23776] Don't use assert for checking arguments in pprint
Serhiy Storchaka added the comment: Similar issues are issue8361 and issue17840. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23777] argparse subcommand action can't be specified
New submission from SpaceOne: parser.add_subparsers(dest='arguments', action='append') will raise the following exception: File /usr/lib/python2.7/argparse.py, line 1675, in add_subparsers action = parsers_class(option_strings=[], **kwargs) TypeError: __init__() got an unexpected keyword argument 'prog' Instead of 'argparse._SubParsersAction' the class 'argparse._AppendAction' is used. Could maybe fixed by passing the 'action' parameter to the _SubParsersAction class which then instanciates a _AppendAction and somehow uses this internally for further things. -- components: Library (Lib) messages: 239246 nosy: spaceone priority: normal severity: normal status: open title: argparse subcommand action can't be specified type: crash versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21319] WindowsRegistryFinder never added to sys.meta_path
Paul Moore added the comment: I think the main (only?) user of having sys.path entries in the registry is pywin32. It might be worth asking them if they can switch to a more mainstream approach, and then maybe the whole registry finder thing can be removed completely. -- nosy: +paul.moore ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators
Antoine Pitrou added the comment: Given interned strings can already be compared by pointer, I'd recommend people call sys.intern() on their strings if they want really fast equality comparisons. -- nosy: +pitrou, tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23712 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23775] Fix pprint of OrderedDict
Changes by Alexei Romanov drednout...@gmail.com: -- nosy: +alexei.romanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23775 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23765] Remove IsBadStringPtr calls in ctypes
eryksun added the comment: c_char_p.__repr__ (defined in __init__.py) also checks IsBadStringPtrA via FFI. Defining the repr differently on Windows is a wart, IMO. The following repr should be used on all platforms for c_char_p: %s(%s) % (self.__class__.__name__, c_void_p.from_buffer(self).value) On a related note, wide-character c_wchar_p uses the default _SimpleCData.__repr__, which calls the getfunc. It should be overridden in the same manner as c_char_p because this can easily segfault Python on a non-Windows platform. Even on Windows, calling IsBadStringPtrW in Z_get can't make guarantees given multiple threads. The GIL helps, but with ctypes there's a good chance that many threads are running concurrently. -- nosy: +eryksun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23776] Don't use assert for checking arguments in pprint
New submission from Serhiy Storchaka: The assert statement should be used only for checking internal logic, and not for checking user data. These assertions should be either removed or converted into explicit raising ValueError. -- components: Library (Lib) messages: 239241 nosy: fdrake, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Don't use assert for checking arguments in pprint type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23776] Don't use assert for checking arguments in pprint
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file38685/pprint_args_check.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23776] Don't use assert for checking arguments in pprint
Berker Peksag added the comment: Looks good. Two things: * I'd apply this only to the default branch. Changing exceptions from AssertionError to ValueError in bugfix releases may break third party code. I couldn't find a similar bug report in the tracker, so it's probably not worth to take that risk. * We should audit the standard library for similar issues -- assignee: - serhiy.storchaka nosy: +berker.peksag stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
Martin Panter added the comment: Another behaviour change in v7 is the seekable() return value is now inherited from underlying file, instead of always being True. I mentioned on Reitveld why this could be a bad idea, but as it is undocumented and untested and will leave the new behaviour unless someone complains. Posting v8, with these changes from v7: * Reverted _read_exact() and read() loop changes to fix tests * Restored myfileobj attribute and test that it is closed * Clean up gzip read() loop so that it always returns data if available, rather than raising EOFError * Document the read(None) is now allowed * Other minor changes addressing review comments -- Added file: http://bugs.python.org/file38686/LZMAFile-etc.v8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators
Marc-Andre Lemburg added the comment: I wouldn't make this the default, since the probability is small, but not zero. However, it may be worth exploring this as dict sub-type for applications to use which could benefit from it. For internal strings, we already use interning, so no win there. The probabilistic approach would only make sense for dictionaries which store non-interned Unicode keys and get lots of dict lookups. -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23712 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod
R. David Murray added the comment: Well, clearly you are the interested party that solved it :) Thanks. Unfortunately I don't know that we have a place where this could be documented, since currently mingw isn't a fully supported platform. Perhaps in the distutils docs somewhere? -- assignee: - docs@python components: +Documentation nosy: +docs@python type: crash - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23743 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)
Bob added the comment: What I see is that structs lager that 8 bytes are not passed correctly to a callback funtion. I've attached a patchfile that includes my fix and a test to demonstrate the problem. -- Added file: http://bugs.python.org/file38687/large_struct_callback.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20160 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23766] json.dumps: solidus (/) should be escaped
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - duplicate stage: - resolved status: open - closed superseder: - json encoder does not support JSONP/JavaScript safe escaping ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23766 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23765] Remove IsBadStringPtr calls in ctypes
Steve Dower added the comment: Thanks, I forgot to scan .py files. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators
Serhiy Storchaka added the comment: In case of class or module dicts attribute names usually are interned. So no string comparison is needed if the key is found. It is needed only when the key is not found, but found a key with the same hash (with the chance 5e-28). The benefit of optimization is 5e-28 * time of string comparison per key lookup. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23712 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23773] importlib does not properly remove frames when invoking external import hooks
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23773 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Cyd Haselton added the comment: Ryan, From where do you want me to download Python for testing? I'm assuming I need to test by a) downloading an unpatched 3.4.2, b) applying patches, c) running ./configure make make install.. If this is not correct let me know -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
Nick Coghlan added the comment: Correctly processing a function's signature involves following the __wrapped__ chains to get to the underlying callable (or to a callable that defines an explicitly modified __signature__ value). inspect.signature follows these chains automatically, and in 3.4+ inspect.getargspec and inspect.getfullargspec have been updated to use inspect.signature internally. Using these functions will also allow introspection of builtin and extension module functions that have been processed through Argument Clinic to produce appropriate signature information in their docstrings. If an IDE or other tool is still producing incorrect signature information for functions wrapped with functools.wraps in 3.4+ then that's either a bug in the affected tool, or else a bug report against the inspect module. -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
R. David Murray added the comment: I think you need to explain exactly what it is you are looking for, because it doesn't seem to me that you can change the argspec of a function. What is it that decorator is doing that is helpful? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23774] Test failures when unable to write to install location
R. David Murray added the comment: We need a buildbot that runs tests on an installed python. The general problem is not windows-only. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23774 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23742] expandvars removes single quotes ( ' )
Roundup Robot added the comment: New changeset 9f4d2bdced9c by Serhiy Storchaka in branch '2.7': Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. https://hg.python.org/cpython/rev/9f4d2bdced9c New changeset 613c4bd1c29c by Serhiy Storchaka in branch '3.4': Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. https://hg.python.org/cpython/rev/613c4bd1c29c New changeset 16e6515c9476 by Serhiy Storchaka in branch 'default': Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. https://hg.python.org/cpython/rev/16e6515c9476 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23742 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23778] Add a visual distinction to multiline versionchanged blocks
New submission from Demian Brecht: This came up during #2211, where a multiline versionchanged entry was suggested. Currently, there is no visual distinction between any but the first line of the description and the rest of the body of the docs. The attached patch adds a consistent level of indentation (30px) to all but the first child. This change makes it much more obvious where the versionchanged block ends and the rest of the docs continue. -- assignee: docs@python components: Documentation files: versionchanged_indent.patch keywords: patch messages: 239261 nosy: demian.brecht, docs@python priority: normal severity: normal stage: patch review status: open title: Add a visual distinction to multiline versionchanged blocks type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file38689/versionchanged_indent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Demian Brecht added the comment: it would be better to consolidate the three adjacent versionchanged entries into one I created the three versionchanged items because there's no visual distinction between the second and third lines and the rest of the doc tests in the rendered output. I've changed it as suggested as you're obviously more familiar with other instances of this, but I would still suggest reverting it to the three individual points if this isn't a docs best practice (or updating the versionchanged CSS class to have some visual distinction between it and the rest of the docs). -- Added file: http://bugs.python.org/file38688/http_cookies_morsel_deprecated_set_1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Demian Brecht added the comment: FWIW, I created #23778 to address the indentation issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod
Steve Dower added the comment: I think these days as soon as a repro includes import distutils or import setuptools the docs go straight to http://pypa.io :) -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23743 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23742] expandvars removes single quotes ( ' )
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23742 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21319] WindowsRegistryFinder never added to sys.meta_path
Tim Golden added the comment: I think they stopped using them a while back in favour of a pywin32.pth file. I don't think I even knew you could use the registry for sys.path. If no-one's shouted since the changes to importlib (which was 3.3?) I think we can quietly drop this and hope no-one notices... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21319] WindowsRegistryFinder never added to sys.meta_path
Tim Golden added the comment: Adding Mark Hammond in case I'm wrong about the (lack of) impact on pywin32 -- nosy: +mhammond ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21319 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
R. David Murray added the comment: The body of the versionchanged has to be a single paragraph (no blank lines). Usually we start each sentence on a newline in the source, but it comes out rendered as a single flowed paragraph. Perhaps eventually someone will add support to Sphinx for unordered lists in a directive, but a single paragraph is good enough. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Ryan Gonzalez added the comment: No; you need the CPython tip. You can use https://github.com/python/cpython. Other than that, it's the configure+make thing. As I said before, the pyconfig.h changes aren't there yet. Trying to figure out how I want to approach those. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23778] Add a visual distinction to multiline versionchanged blocks
R. David Murray added the comment: Heh, you clearly know more about docutils/css than I do. I don't think we want multiple blank delimited paragraphs under a versionchanged directive, though, from a style point of view. A compact unordered list would be best. -- nosy: +georg.brandl, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8800] add threading.RWLock
Changes by Dan O'Reilly oreil...@gmail.com: -- nosy: +dan.oreilly ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23546] Windows, 'Edit withIDLE', and multiple installed versions
Liam Marsh added the comment: thank you for all this hard work. really. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23546 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23487] argparse: add_subparsers 'action' broken
paul j3 added the comment: OK, so you are thinking about what happens to the subparsers `dest` when the user names a command. That isn't handled by the `store` action, but by the call of the subparsers action class _SubParsersAction(Action): def __call__ # set the parser name if requested if self.dest is not SUPPRESS: setattr(namespace, self.dest, parser_name) ... namespace, arg_strings = parser.parse_known_args(arg_strings, namespace) Storing the parser_name is a minor part of this action. The important, distinctive part is passing the parsing action to that subparser. That storing could be done in an append way, but why? There can only one `subparsers`, and it can be invoked only once. None of the existing Action classes can replace _SubParsersAction, which is entered in the `registry` as `parsers`: In [11]: parser._registry_get('action','parsers') Out[11]: argparse._SubParsersAction If you want to write your own version of this action, you can use it, either by replacing the existing class, or by changing this registry entry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23487 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23778] Add a visual distinction to multiline versionchanged blocks
Demian Brecht added the comment: Sounds good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23778] Add a visual distinction to multiline versionchanged blocks
Demian Brecht added the comment: I noted in #2211 that nested lists are supported by Sphinx, so that solves that specific issue. Perhaps it /may/ still be useful to have this though in order to support multiple paragraphs for more detailed change descriptions when needed? That said, I'm not sure that's something that's necessarily even wanted as such messages are intended to be terse. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23487] argparse: add_subparsers 'action' broken
paul j3 added the comment: As to the nature of the error when 'add_subparsers' is given an 'action' parameter: 'add_subparsers' does several things to 'kwargs' before it passes them to the relevant Action class. def add_subparsers(self, **kwargs): # adds 'parser_class' # removes 'title', 'description' (used in an argument group) # add 'prog' parsers_class = self._pop_action_class(kwargs, 'parsers') action = parsers_class(option_strings=[], **kwargs) What I wrote earlier about using the registry is partly wrong. The Action class is determined by either the 'action' parameter or the registry entry. In [17]: p._pop_action_class({}, 'parsers') Out[17]: argparse._SubParsersAction In [18]: p._pop_action_class({'action':'test'}, 'parsers') Out[18]: 'test' So the 'action' parameter works - if you specify a compatible Action class. sp=p.add_subparsers(dest='cmd',action=argparse._SubParsersAction) Such a class must have the same __init__ signature, otherwise you'll get errors such the OP's. It might be worth rewriting the documentation line so this is clearer. Otherwise I recommend closing this issue. action = parsers_class(option_strings=[], **kwargs) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23487 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Berker Peksag added the comment: I think David's suggestion in msg239260 was good enough for now :) You'll need to create a custom versionchanged directive to generate a valid and semantic markup for the usage in http_cookies_morsel_deprecated_set_2.patch. I also left a couple comments on Rietveld. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23778] Add a visual distinction to multiline versionchanged blocks
R. David Murray added the comment: Yes, exactly, they are supposed to be terse. So I think we should reject this. -- resolution: - rejected stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Demian Brecht added the comment: Problem (pretty much) solved. Nested unordered lists are supported. I've updated the versionchanged information to use the list. -- Added file: http://bugs.python.org/file38690/http_cookies_morsel_deprecated_set_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22931] cookies with square brackets in value
Tim Graham added the comment: Will this regression be fixed in Python 2.7, 3.2, and 3.3? If not, Django may need to vendor Python's cookie class to workaround this bug to prevent users from losing sessions and/or being unable to login to Django powered sites as reported in https://code.djangoproject.com/ticket/24492. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23487] argparse: add_subparsers 'action' broken
Changes by paul j3 ajipa...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23487 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1191964] add non-blocking read and write methods to subprocess.Popen
Josiah Carlson added the comment: I'm going to be honest; seeing None being returned from a pipe read feels *really* broken to me. When I get None returned from an IO read operation, my first instinct is there can't be anything else coming, why else would it return None? After changing writing to raise BrokenPipeError on a closed pipe, I've also changed reading to do the same and added a test to verify the behavior. -- Added file: http://bugs.python.org/file38691/subprocess_8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ 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
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ 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
[issue22609] Constructors of some mapping classes don't accept `self` keyword argument
Serhiy Storchaka added the comment: Here is a patch for UserDict, that keep current behavior, but allows to pass keys self and dict if positional parameter dict is specified. UserDict(self=42) {'self': 42} UserDict({}, dict=42) {'dict': 42} UserDict(dict={'a': 42}) {'a': 42} -- Added file: http://bugs.python.org/file38692/UserDict_self_and_dict_keywords.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22609 ___ ___ 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
Roundup Robot added the comment: New changeset 068365acbe73 by Serhiy Storchaka in branch 'default': Issue #22364: Improved some re error messages using regex for hints. https://hg.python.org/cpython/rev/068365acbe73 -- nosy: +python-dev ___ 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
[issue1191964] add non-blocking read and write methods to subprocess.Popen
Akira Li added the comment: I'm going to be honest; seeing None being returned from a pipe read feels *really* broken to me. When I get None returned from an IO read operation, my first instinct is there can't be anything else coming, why else would it return None? It is how it is done in similar cases (returning `None` to indicate would block). Do you know a better method that would allow to distinguish between EOF (no future data, ever) and would block (future data possible) without calling process.poll()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17305] IDNA2008 encoding missing
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue433028] SRE: (?flag:...) is not supported
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file38693/re_scoped_flags_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue433028 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue433028] SRE: (?flag:...) is not supported
Serhiy Storchaka added the comment: Updated to the tip. Could anyone please help with documentation? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue433028 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23775] Fix pprint of OrderedDict
Berker Peksag added the comment: LGTM. Added minor comments on Rietveld. -- nosy: +berker.peksag stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23775 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
Changes by Eric V. Smith e...@trueblade.com: -- stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23765] Remove IsBadStringPtr calls in ctypes
eryksun added the comment: So the repr that's there for c_char_p is currently:: %s(%s) % (self.__class__.__name__, cast(self, c_void_p).value) I suggested switching to using from_buffer: c_void_p.from_buffer(self).value from_buffer is more efficient. cast() is imlemented as an FFI call. There's also another approach using the buffer protocol: int.from_bytes(self, sys.byteorder) I prefer the former (remove c_char_p.__repr__ completely), but the latter is clearly there for some reason. Any opinions? It's there for same reason I suggested overriding c_wchar_p.__repr__. Getting the repr of an object shouldn't segfault the interpreter. The existing check with IsBadStringPtrA is bogus in a multithreaded environment. The repr should just show the address. At least that won't crash. A topic for another discussion is disabling the SEH handler because it's not used consistently anyway (e.g. to guard pointer and CData base pointer access). To compensate, the faulthandler could be enhanced. It could call the CRT's __pxcptinfoptrs (not documented, but it should be) to get the Windows EXCEPTION_POINTERS record. This would enable at least an improved error message, e.g. Segmentation fault reading [addr] and Segmentation fault writing [addr]. The funny thing is the current faulthandler example uses ctypes.string_at, which, because it's implemented as an FFI call guarded by the SEH handler, just raises OSError on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23765] Remove IsBadStringPtr calls in ctypes
Steve Dower added the comment: So the repr that's there for c_char_p is currently:: %s(%s) % (self.__class__.__name__, cast(self, c_void_p).value) But if I remove the override then it renders the value as b'abc'. Basically, we can have one of: from ctypes import * cast(create_string_buffer(b'abc'), c_char_p) c_char_p(b'abc') or cast(create_string_buffer(b'abc'), c_char_p) c_char_p(52808208) I prefer the former (remove c_char_p.__repr__ completely), but the latter is clearly there for some reason. Any opinions? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
Nick Coghlan added the comment: Backport proposal: https://github.com/aliles/funcsigs/issues/12 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1191964] add non-blocking read and write methods to subprocess.Popen
STINNER Victor added the comment: Returning None for non blocking I/O is standard in Python. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Demian Brecht added the comment: Updated patch should address review comments. I did run with David's suggestion as I also noticed that my initial assessment was wrong (thanks for the note/review Berker). -- Added file: http://bugs.python.org/file38695/http_cookies_morsel_deprecated_set_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort
New submission from Craig Holmquist: If the authenticator object passed to the IMAP authenticate method tries to abort the handshake by returning None, TypeError is raised instead of sending the * line to the server. import imaplib imap = imaplib.IMAP4_SSL('imap.gmail.com') imap.authenticate(b'PLAIN', lambda x: None) Traceback (most recent call last): File pyshell#5, line 1, in module imap.authenticate(b'PLAIN', lambda x: None) File C:\Python34\lib\imaplib.py, line 380, in authenticate typ, dat = self._simple_command('AUTHENTICATE', mech) File C:\Python34\lib\imaplib.py, line 1133, in _simple_command return self._command_complete(name, self._command(name, *args)) File C:\Python34\lib\imaplib.py, line 940, in _command self.send(literal) File C:\Python34\lib\imaplib.py, line 276, in send self.sock.sendall(data) File C:\Python34\lib\ssl.py, line 723, in sendall v = self.send(data[count:]) File C:\Python34\lib\ssl.py, line 684, in send v = self._sslobj.write(data) TypeError: 'str' does not support the buffer interface The problem is that _Authenticator.process returns a string instead of bytes in this case. -- components: Library (Lib) files: imap_auth.patch keywords: patch messages: 239283 nosy: craigh priority: normal severity: normal status: open title: imaplib authenticate raises TypeError if authenticator tries to abort type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file38694/imap_auth.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
Nick Coghlan added the comment: Regarding the PyPI decorator module, the difference there is between using a def f(*args, **kwargs) wrapper (which requires following wrapper chains to read the signature correctly) and using functools.partial (which reports the correct surface signature directly). You can define your own wrapper decorators like this to reproduce that behaviour with standard library components: def wrapper(func): return functools.wraps(func)(functools.partial(func)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] Accept a separate target
Nick Coghlan added the comment: Right, I started asking myself the same question, and then began poking around in the functools.partial implementation (https://hg.python.org/cpython/file/9be2405385ec/Modules/_functoolsmodule.c#l12) -- resolution: not a bug - stage: resolved - status: closed - open title: functools.wraps should be able to change function argspec as well - Accept a separate target ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod
Nick Coghlan added the comment: pypa.io hosts the internal dev docs for PyPA, I believe you meant packaging.python.org, and that would indeed be the right home. However, this kind of C/C++ linker related problem is way too advanced for the current state of the binary extension docs which basically say C/C++ is hard relative to Python, let someone else deal with creating your extension modules for you: https://packaging.python.org/en/latest/extensions.html For the scientific stack in particular we go even further and say to get someone else to build and link the extension modules for you: https://packaging.python.org/en/latest/science.html Folks encountering the kind of problem described in this issue is thus mostly useful as a data point in *why* we give those instructions: because DIY cross-platform C/C++ development is a teeming morass of fun interoperability bugs like this one just waiting to be discovered :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23743 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
productivememberofsociety666 added the comment: def wrapper(func): return functools.wraps(func)(functools.partial(func)) ^ doesn't that just return something that is completely equivalent to func itself? Where do I put the actual wrapper functionality, i.e. code that is executed with each call to the new (wrapped) function? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] Accept a separate call_target parameter to functools.partial
Nick Coghlan added the comment: Well, there's an expected keyboard shortcut (accidentally hitting Shift-Enter submits the page...) Anyway, the idea I came up with after looking at that is potentially adjusting functools.partial to accept a call_target parameter, which would allow it to *claim* to be a partial object calling func (and reporting its signature accordingly) while *actually* calling wrapped_func (which may not have accurate signature information). That underlying feature could then be used as the basis for a new wraps_validated API that works by creating a partial object around the underlying function with the call target set to the decorated wrapper function. -- title: Accept a separate target - Accept a separate call_target parameter to functools.partial ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] Reference inspect.Signature.bind from functools.wraps documentation
productivememberofsociety666 added the comment: Sounds good! I think the docs on functools.wraps already list precisely which data is updated, but maybe mentioning explicitly that it can not affect the argspec could indeed make it clearer. Either way, thank you for your help! -- components: +Library (Lib) -Documentation versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
Nikolaus Rath added the comment: Except for the pointless 'myfileobj' stuff in gzip.py, rev 8 of the patch looks good to me. (Btw, I'm not actually in favor of e.g. the seekable() change. The previous patch was intended as a proof-of-concept to see what would be necessary to inherit more from DecompressReader and if it's actually worth it. But having thought about it for a while more, I don't think there's a significant gain. But I'm happy to see that you were able to cherry-pick some useful pieces out of it nevertheless). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
Nick Coghlan added the comment: Full example showing the functools.partial based implementation: def wrapper(func): ... return functools.wraps(func)(functools.partial(func)) ... def to_be_wrapped(x): ... pass ... import inspect inspect.getargspec(wrapper(to_be_wrapped)) ArgSpec(args=['x'], varargs=None, keywords=None, defaults=None) Th usage of functools.partial is also what gives the PyPI decorator module eager validation of the argument structure, even if the original function is never actually called. When you use the pass-through *args, **kwds signature on a wrapper function it really is just a pass-through - even setting __signature__ won't get the *interpreter* to change the way it processes the arguments, as that's baked directly into the compiled code object: def f(*args, **kwds): ... pass ... import dis dis.show_code(f) Name: f Filename: stdin Argument count:0 Kw-only arguments: 0 Number of locals: 2 Stack size:1 Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, NOFREE Constants: 0: None Variable names: 0: args 1: kwds -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] Reference inspect.Signature.bind from functools.wraps documentation
Nick Coghlan added the comment: Ah, unfortunately, on closer inspection, even partial itself ends up suffering from the same problem as the current inspect.wraps - validation ultimately happens at the point of calling the original wrapper function, so if you don't actually call it, you won't get any argument validation. You can use https://docs.python.org/3/library/inspect.html#inspect.Signature.bind to force early validation without actually calling the underlying callable, but that's always going to be substantially slower than just try it and see if it works. functools is also further down in the stdlib dependency hierarchy than the inspect module so it isn't possible to offer that behaviour without creating a circular dependency. What would be possible is to point out explicitly that wraps only updates introspection metadata, and if you're after eager argument validation (e.g. before queuing a command for delayed execution), then you likely want inspect.Signature.bind. -- assignee: - docs@python components: +Documentation -Library (Lib) nosy: +docs@python title: Accept a separate call_target parameter to functools.partial - Reference inspect.Signature.bind from functools.wraps documentation versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1191964] add non-blocking read and write methods to subprocess.Popen
Martin Panter added the comment: Josiah’s code now seems to handle the four special cases like this: * Reading a closed pipe raises BrokenPipeError. This is novel to me, and bends the current definition of the exception. But it appears to be the way Windows works at a lower level, and does make a bit of sense to me. However it is inconsistent with how normal reading from files, pipes and sockets works, which return the special value b in the equivalent case. Also various communications protocols use an empty packet to signal EOF. * Reading an empty pipe returns b. This is consistent with partial reads, which I like. However it could be surprising for someone used to b signalling EOF. Alternatives are returning None like RawIOBase.read(), and raising BlockingIOError like os.write() and socket.send(). * Writing to a closed pipe raises BrokenPipeError. This is consistent with how other APIs work, but since it is an asynchronous condition, a naive program may work sometimes without handling it, and then see suprious tracebacks or worse in other situations. Maybe dropping the data and setting a flag could be an alternative. * Writing to a full pipe returns zero. This is consistent with partial writes, which I like. Alternatives are returning None like RawIOBase.write(), and raising BlockingIOError like os.write(), socket.send(), BufferedIOBase.write(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] Reference inspect.Signature.bind from functools.wraps documentation
productivememberofsociety666 added the comment: Sorry, did not mean to change the Components and Versions thingies... -- components: +Documentation -Library (Lib) versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22931] cookies with square brackets in value
Demian Brecht added the comment: As I understand it, the change should also be applied to security releases as the regression manifested by a security related patch being applied. That said, there may be some debate as there apparently isn't much (if anything) in the way of precedence here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
productivememberofsociety666 added the comment: You're probably right and it's next to impossible to implement what I want in a clean manner. I'll get back to that at the end, but first for completeness's sake two examples to illustrate what this issue is even about. import functools def wrapper(func): @functools.wraps(func) def new_func(*args, **kwargs): pass return new_func def to_be_wrapped(a): pass wrapped = wrapper(to_be_wrapped) wrapped(1) # Ok wrapped(1, 2, 3) # Also ok, but shouldn't be! Should raise TypeError The second call to wrapped() should fail because it's supposed to be a wrapper around to_be_wrapped(), which only takes 1 argument. But it succeeds because functools.wraps only changes superficial function attributes such as its signature or docstring. This creates a mismatch between expected and actual behaviour of wrapped(). Contrast this with how it works when using the decorator package I mentioned: import decorator def to_be_wrapped(x): print(f(x) called) pass def _wrapper(func, *args, **kwargs): # Put actual functionality of your decorator here pass def wrapper(func): return decorator.decorator(_wrapper, func) wrapped = wrapper(to_be_wrapped) wrapped(1) # Ok, because to_be_wrapped takes exactly 1 argument wrapped(1, 2, 3) # raises TypeError for too many arguments, as it should Like I said, the details of how it is used are different from those of functools.wraps. But the important thing is that, at the end, wrapped()'s argspec matches that of to_be_wrapped() and an appropriate error is raised by the second call. Note that this does NOT work via propagation from a call to to_be_wrapped() or anything of the sort, as can be verified by the lack of output to stdout. Now, the only problem is: I had a look at how this is achieved in the decorator package's source code and if I understand it correctly, they are doing some nasty nasty things with exec() to create a function with an argspec of their choosing at runtime. If this is in fact the only way to do it, I agree that it has no place in the standard library and should only be available via 3rd party libraries. Sorry for wasting your time then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23764] functools.wraps should be able to change function argspec as well
Nick Coghlan added the comment: I double checked the current behaviour, and rediscovered something I had forgotten: when inspect.getargspec and inspect.getfullargspec were converted to be based on the inspect.signature machinery, we had to decide whether or not to follow wrapper chains to report the underlying signature or not. We opted to continue reporting the surface signature for compatibility with the behaviour of these APIs in previous versions of Python (including introspection tools that handle wrapper chains themselves), while encouraging introspection tools to migrate to using the more capable inspect.signature API instead: https://docs.python.org/3/library/inspect.html#inspect.getfullargspec If a particular introspection tool reports incorrect signatures in 3.4+, then that's an issue with that particular tool needing to be made wrapper chain aware. I'll also ping Aaron Iles about potentially bringing https://funcsigs.readthedocs.org/ up to date with the features in the Python 3.4 version of the library, including the helper to traverse wrapper chains correctly: https://docs.python.org/3/library/inspect.html#inspect.unwrap -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23487] argparse: add_subparsers 'action' broken
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag, spaceone ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23487 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23777] argparse subcommand action can't be specified
Berker Peksag added the comment: Thanks for the report. This is a duplicate of issue 23487. -- nosy: +berker.peksag resolution: - duplicate stage: - resolved status: open - closed superseder: - argparse: add_subparsers 'action' broken type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com