[issue31871] Support for file descriptor params in os.path

2017-10-25 Thread Mateusz Kurek
New submission from Mateusz Kurek : Since Python 3.3, some os module functions, like os.stat (https://docs.python.org/3/library/os.html#os.stat), support passing file descriptor instead of a path. os.path functions, on the other hand (like os.path.exists -

[issue20486] msilib: can't close opened database

2017-10-25 Thread Berker Peksag
Berker Peksag added the comment: xoviat, would you like to send your patch as a pull request on GitHub? It would be nice to add a simple test that the new Close() works correctly. I can do that if you don't have time, thank you! Steve, can we apply this to bugfix

[issue31870] add timeout parameter for get_server_certificate in ssl.py

2017-10-25 Thread Vex Woo
New submission from Vex Woo : The original get_server_certificate in ssl.py does not support socket timeout, def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None): """Retrieve the certificate from the server at the specified address, and return it

[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-25 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> needs patch versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-25 Thread Eryk Sun
Eryk Sun added the comment: Setting the exit code to the negative of a C signal value isn't generally meaningful in Windows. It seems multiprocessing doesn't have a significant use for this, other than getting a formatted exit code in the repr via its _exitcode_to_name

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: Serhiy's PR avoids the cryptic BytesWarning on Py3 while minimising the overhead of the new typecheck, so I've closed Berker's PR in favour of that one (which now has approved reviews from both Brett and I, so Serhiy will merge it when he's

[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: If one starts IDLE from a command-line console (python -m idlelib) or Python console (import idlelib.idle), sys.__stdout__ is the TextIOWraper for that console and .fileno() returns 1. .get_terminal_size() will then return the console

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset 32318930da70ff03320ec50813b843e7db6fbc2e by Alexander Belopolsky (Mario Corchero) in branch 'master': Closes bpo-31800: Support for colon when parsing time offsets (#4015)

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-25 Thread Guido van Rossum
Guido van Rossum added the comment: SGTM. -- ___ Python tracker ___ ___ Python-bugs-list

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to merge PR 4015 submitted for issue 31800. That issue asks to make %z strptime format accept offsets with : separators. Given that a similar feature has been added to glibc several years ago, I don't see

[issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters

2017-10-25 Thread Berker Peksag
Berker Peksag added the comment: PR 2262 has been merged and backported to bugfix branches so I think this issue can be closed now. -- nosy: +berker.peksag resolution: -> fixed stage: needs patch -> resolved status: open -> closed type: -> enhancement

[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2017-10-25 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +vinay.sajip ___ Python tracker ___ ___

[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'd stick with ValueError in that case as well. if someone dislikes the valueerrors because they _want_ to use an invalid one, they can file a bug and we'll reconsider only if they have a meaningful use case. On Wed, Oct 25, 2017 at 9:36 AM

[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +4091 stage: -> patch review ___ Python tracker ___

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Nathaniel Smith
Nathaniel Smith added the comment: > I'm not sure that it's a good idea to provide a "aligned malloc" fallback if > such fallback would be inefficient. For example, we would have to > overallocate the memory block not only for the requested alignement, but also > allocates

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7c622be4f2e86c1999baba4f64671a5987d43d73 by Serhiy Storchaka in branch '2.7': bpo-30855: Fix winfo_id related Tkinter test on Windows. (#4121)

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Python 2 hex() adds the 'L' suffix for longs. -- stage: patch review -> resolved ___ Python tracker

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4090 stage: resolved -> patch review ___ Python tracker

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Xavier de Gaye
Xavier de Gaye added the comment: Android has both memalign() [1] and posix_memalign() [2] and does not have aligned_alloc(), posix_memalign() is a wrapper around memalign() [3]. [1] https://android.googlesource.com/platform/bionic/+/master/libc/include/malloc.h#38 [2]

[issue17942] IDLE Debugger: Improve GUI

2017-10-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: IDLE now uses ttk unconditionally by requiring tk 8.5. The patch can therefore be simplified accordingly. -- ___ Python tracker

[issue15335] IDLE - debugger steps into print and over rpc.py code

2017-10-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: The debugger also steps into importlib, if one steps 'into' an import statement. Most of the time, this is a nuisance. If one is importing from one's own module, stepping over 'import mymod' is not a satisfactory way to avoid this.

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Tal Einat
Tal Einat added the comment: I understand that there is a workaround. I'm just thinking about the many existing large codebases where re-writing thousands of imports because of this is unlikely to be done, yet having somewhat longer process launch times would be

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Brett Cannon
Brett Cannon added the comment: As Nick said, if the overhead of an import statement is that critical, then you should NOT use the `from ... import ...` form at all and just stick with `import ...` and if necessary, bind local names to objects off of the final module or a

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would like to add my voice to MAL's objections. I was not aware of time.clock() depreciation before Victor brought this issue to my attention. time.clock() is a very well-known API eponymous to a venerable UNIX system

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Stefan Krah
Stefan Krah added the comment: > In Python 3.7, should we also add the "aligned alloc" requirement? Linux, BSD, OSX, MSVC should be covered. According to Stackoverflow MinGW has an internal function. Android, I don't know. Xavier? -- nosy: +xdegaye

[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What to do with values outside of the valid range (2**4 to 2**31 for Blowfish, 1000 to 9 for SHA*). Raise ValueError, OverflowError, or bound it, or just generate an invalid salt and allow crypt() to handle it?

[issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir()

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following Antoine's suggestion the patch now makes shutil.rmtree() using os.scandir() on all platforms. I doubt about one thing. This patch changes os.listdir passed to the onerror handler to os.scandir. This can break a user

[issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir()

2017-10-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think we should change to os.scandir. No need to accumulate compatibility baggage like that. -- ___ Python tracker

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the current behavior. Do you suggest to undeprecate time.clock() after 4 releases of deprecation? -- ___ Python tracker

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In this case it would be safe to not erase bytes at all. PR 4119 is too complex for a bugfix (especially if backport it to 3.5 and 3.4). It can introduce other regressions. The performance hit is not the only issue. Allocating

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 25.10.2017 01:31, STINNER Victor wrote: > > Marc-Andre: "Yes, to avoid yet another Python 2/3 difference. It should be > replaced with the appropriate variant on Windows and non-Windows platforms. > From Serhiy's response that's

[issue31869] commentary on ssl.PROTOCOL_TLS

2017-10-25 Thread J Sloot
New submission from J Sloot : on https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_TLS for ssl.PROTOCOL_TLS When the commentary from ssl.PRTOCOL_TLS moved from PROTOCOL_SSLv23 to PROTOCOL_TLS the note {Despite the name, this option can select "TLS" protocols as well as

[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: > Does it make sense to backport ac317700ce7439e38a8b420218d9a5035bba92ed to > 3.6? No, async was not a keyword in Python 3.6 on purpose. Making it a keyword can break a lot of code. I confirm that Python 3.6 still crashs with a

[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +yselivanov ___ Python tracker ___ ___

[issue25083] Python can sometimes create incorrect .pyc files

2017-10-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue25083] Python can sometimes create incorrect .pyc files

2017-10-25 Thread Petr Viktorin
Petr Viktorin added the comment: tzickel, could you sign the CLA? It will formally allow PSF to distribute your patch with Python. (You retain the copyright.) See the dev guide for instructions: https://docs.python.org/devguide/pullrequest.html#cla I can't do that for you,

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: > The current code in not correct on all platforms. My PR 4119 only changes the behaviour on OpenBSD, but I'm not sure about that. Maybe it's simpler to apply this fix on all platforms, as I asked on the PR itself? --

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: > PR 3844 restores the behavior of 2.7 and 3.3. I propose to merge it first, > and develop other enhancements later. Please don't. This PR reintroduced a bug that I fixed in bpo-18408: commit c4266360fc70745d49b09f2c29cda91c1a007525

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The current code in not correct on all platforms. We don't know how many of random bugs, hangs and crashes on other platforms are caused by this bug. I'm not surprised that it was caught on OpenBSD since the robustness and

[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tests on s390x SLES 3.x are passed. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: Currently, the main question on my PR 4089 was raised by Antoine Pitrou: "Do people have to provide aligned_alloc and aligned_free? Or can they leave those pointers NULL and get a default implementation?" My reply: "Currently, you

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: "I tried to build CPython on 64-bit OpenBSD. It was built successfully, but tests crash." It's the first time that anyone complains about _PyMem_DebugRawRealloc(). The behaviour seems to be very specific to OpenBSD. Even if the

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4089 ___ Python tracker ___ ___

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: > Using nested _PyMem_DebugRawRealloc() looks suspicions to me. This may be a > bug. PyObject_Malloc() calls PyMem_RawMalloc() for allocations larger than 512 bytes. When debug hooks are enabled, PyObject_Malloc() and

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Tal Einat
Tal Einat added the comment: I can't say I agree that the performance here is practically insignificant. This will affect the startup time of Python process, and adding even 10% to that in some cases is significant. In some of the larger codebases I've worked on, even

[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0f261583bae7e60e410709ed96398dd1b14c5454 by Serhiy Storchaka in branch 'master': bpo-31664: Fix test_crypt for the openwall implementation of crypt. (#4116)

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other differences between Python 2.7 and Python 3. PR 4118 restores the Python 2.7 logic. It adds type checking, but its overhead is smaller. $ ./python -m timeit 'from encodings import aliases' 50 loops, best of

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4088 ___ Python tracker ___ ___

[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: Thank you Anselm Kruis for spotting this nice optimization opportunity! Sadly, as I wrote, I don't want to backport the optimization to the stable Python 3.6 branch. -- ___ Python tracker

[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 086c3ae5f0995a62092b9080f32dd118c2923453 by Victor Stinner in branch 'master': bpo-31835: Optimize also FASTCALL using __future__ (#4087) https://github.com/python/cpython/commit/086c3ae5f0995a62092b9080f32dd118c2923453

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat
Tal Einat added the comment: See PR 4117 on GitHub with the itertools AC conversion. -- ___ Python tracker ___

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +4087 stage: needs patch -> patch review ___ Python tracker ___

[issue31868] Null pointer dereference in ndb.ndbm get when used with a default value.

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please create a pull request on GitHub Tomasz? -- nosy: +serhiy.storchaka ___ Python tracker

[issue31867] Duplicated keys in MIME type_map with different values

2017-10-25 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: So for excel, 'application/excel' is not listed at http://www.iana.org/assignments/media-types as suggested by the comment at: https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L397 whereas 'applicaton/vnd.ms-excel'

[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4086 stage: resolved -> patch review ___ Python tracker ___

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-25 Thread Andy
Andy added the comment: Thanks for adding the test! If the official stance is that only the latest OpenSSL is supported then this is definitely WAI. Sounds like a good policy... I'll close this issue. -- resolution: -> not a bug stage: -> resolved status:

[issue31868] Null pointer dereference in ndb.ndbm get when used with a default value.

2017-10-25 Thread Tomasz Miąsko
New submission from Tomasz Miąsko : Using ndb.ndbm get when key is missing and default value has to be returned results in invocation of Py_INCREF on null pointer. Test case to reproduce the issue: ``` import dbm.ndbm with dbm.ndbm.open('db', 'n') as db:

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is. Actually the #include should be before lists of methods and static PyTypeObject initializers. I think it is better to move all method lists and type initializers to the bottom of the file. --

[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This issue is fixed in the master branch (version 3.7.0 alpha 2). The issue was fixed in this PR: https://github.com/python/cpython/pull/1669 The cause is that async was not a proper keyword and the parser segfaults when checking

[issue31867] Duplicated keys, but with different values in dictionary literals

2017-10-25 Thread Mark Shannon
Mark Shannon added the comment: I hadn't noticed the comments on the lines above saying "Duplicates :(", so I'm obviously not the first to notice. -- ___ Python tracker

[issue31867] Duplicated keys, but with different values in dictionary literals

2017-10-25 Thread Mark Shannon
New submission from Mark Shannon : Here https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L416 and here https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L526 I have no idea which is the correct value for either, but the code is misleading at best.

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat
Tal Einat added the comment: As far as I can tell, with the creation of a separate clinic/itertools.c.h, the typedefs etc. need to be moved to the top of the file so that the #include can come after the typedefs and before the rest of the code which references clinic

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The from import already is much slower than simple import: $ ./python -m timeit 'from encodings import aliases' 50 loops, best of 5: 475 nsec per loop $ ./python -m timeit 'import encodings.aliases as aliases' 100 loops,

[issue24564] shutil.copytree fails when copying NFS to NFS

2017-10-25 Thread Albert Zeyer
Albert Zeyer added the comment: I'm also affected by this, with Python 3.6. My home directory is on a ZFS-backed NFS share. See here for details: https://github.com/Linuxbrew/homebrew-core/issues/4799 Basically: Copying setuptools.egg-info to

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: I'm fine with the approach in the latest version of the PR - it does make "from x import y" slightly slower due to the extra error checking, but folks should be avoiding doing that in performance critical loops or functions anyway. It would

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread STINNER Victor
STINNER Victor added the comment: Too bad, the bug is not dead: http://buildbot.python.org/all/#/builders/45/builds/14 test_use (test_tkinter.test_widgets.ToplevelTest) ... ERROR test_visual (test_tkinter.test_widgets.ToplevelTest) ... ok test test_tk failed --

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Berker Peksag
Berker Peksag added the comment: > I don't think the index in error message is needed. I'm fine with either format. It's ultimately up to Nick. Should I switch back to the 2.7 version? > Import is successful because the iterator was exhausted by "'*' in fromlist".

[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2017-10-25 Thread Ed Schouten
Ed Schouten added the comment: Having looked at various implementations of crypt() and crypt_r(), I can't think of a reason why there would be any significant difference in performance. On systems like FreeBSD, crypt() is just a simple wrapper around crypt_r():

[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2017-10-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure performance matters. Modern crypt() algorithms should actually be slow enough (using a large number of rounds) to make brute-force attacks impractical... -- nosy: +pitrou versions: +Python 3.7 -Python 3.6

[issue31866] clean out some more AtheOS code

2017-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about configure.ac? "On some platforms (AtheOS)" in the comment in Modules/_cryptmodule.c is redundant. crypt() should return NULL on error, and it often returns NULL for an invalid salt. -- nosy:

[issue31866] clean out some more AtheOS code

2017-10-25 Thread Benjamin Peterson
Change by Benjamin Peterson : -- keywords: +patch pull_requests: +4085 stage: -> patch review ___ Python tracker ___

[issue31866] clean out some more AtheOS code

2017-10-25 Thread Benjamin Peterson
New submission from Benjamin Peterson : We stopped support AtheOS in 2007. But, there are still references in the code: $ git grep -i AtheOS Doc/whatsnew/2.3.rst:Other new platforms now supported by Python include AtheOS Doc/whatsnew/2.3.rst:(http://atheos.cx/), GNU/Hurd,

[issue23699] Add a macro to ease writing rich comparisons

2017-10-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Tue, Oct 24, 2017, at 02:23, Petr Viktorin wrote: > > Petr Viktorin added the comment: > > Both tp_richcompare and PyObject_RichCompareBool have op as the last > argument: Yes, indeed. Sorry, I wasn't thinking