[issue33033] Clarify that the signed number convertors to PyArg_ParseTuple... *do* overflow checking

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This doesn't look a good idea to me. It is implied that all checks are performed. For example it is implied that an error will be raised if the argument is of wrong type. I think that adding "with overflow checking" to every

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-08 Thread Nathan Henrie
Nathan Henrie added the comment: It seems to work if you close proto.transport (as is done in `test_write_pty()`). -- ___ Python tracker

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-08 Thread Nathan Henrie
Change by Nathan Henrie : -- keywords: +patch pull_requests: +5799 stage: needs patch -> patch review ___ Python tracker ___

[issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings

2018-03-08 Thread A.M. Kuchling
Change by A.M. Kuchling : -- pull_requests: +5798 ___ Python tracker ___ ___ Python-bugs-list

[issue33033] Clarify that the signed number convertors to PyArg_ParseTuple... *do* overflow checking

2018-03-08 Thread Antony Lee
New submission from Antony Lee : At https://docs.python.org/3/c-api/arg.html#numbers, it is explicitly documented that the unsigned number convertors do not perform overflow checking. Implicitly, this suggests that the signed convertors *do* perform overflow checking,

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
Nick Coghlan added the comment: The note on https://docs.python.org/3/library/re.html#re.compile provides a useful precedent for possible wording here, as the struct cache and the regex cache are quite similar. -- ___ Python

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > We know that the path is valid because we have a handle (in this case the > file system ensures that no parent directory in the path can be unlinked or > renamed). Thank you for pointing this out. I erroneously stated that the length

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
New submission from Nick Coghlan : The struct.Struct docs claim that creating and re-using a Struct object will be noticeably faster than calling the module level methods repeatedly with the same format string, as it will avoid parsing the format string multiple times:

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > unless users are not prepared to deal with it ARE prepared > What do you think about handling this failure by calling GetFullPathName > instead (e.g. "C:\Temp\NUL" => "\\.\NUL")? I think it would indeed be nice if pathlib handled such

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Because we only try VOLUME_NAME_DOS, this function always fails for a volume > that's not mounted as either a drive letter or a junction mount point. If a volume is not mounted, users have to use \\?\ or \\.\ either directly or

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: Leaving this open for commit review (and buildbots) for a little while, but then I'll close it if we're all good. -- assignee: -> steve.dower stage: patch review -> commit review ___ Python

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 32efcd13069a89abf007373274ee1bc0909d1996 by Steve Dower in branch '3.6': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032)

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Copying the comment of @eryksun from PR 6010 for reference. Because we only try VOLUME_NAME_DOS, this function always fails for a volume that's not mounted as either a drive letter or a junction mount point. The error in this case is

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @eryksun Very interesting! BTW, I looked at CreateFile docs, and the fact that it may set the last error to zero is even documented there. @steve.dower > maybe we don't have to preserve errno on Windows? There are still places where

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Eryk Sun
Eryk Sun added the comment: FYI, here's a sampling of successful calls that modify the last error value. Most Create- functions intentionally set the last error to 0 on success, such as CreateFile, CreateFileMapping, CreateSymbolicLink, CreateJobObject, CreateEvent,

[issue32642] add support for path-like objects in sys.path

2018-03-08 Thread Jay Yin
Jay Yin added the comment: The issue was resolved by updating my version of the rest of the package apparently and remaking the whole thing, must have been some outdated stuff on my end causing the issue -- ___ Python

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Vitaly Kruglikov
Vitaly Kruglikov added the comment: Also, updating ssl.SSLContext documentation about intentional inability to copy generically and suggestion how to go about it if you need to obtain a clone or similar would be terrific and save developers time so they won't run into

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Vitaly Kruglikov
Vitaly Kruglikov added the comment: Hi Christian, thank you for following up. Here is my use case, and perhaps you can suggest something else that will work: I am refactoring the transport layer in the Pika AMQP client library. The user provides an ssl.SSLContext

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
Steve Dower added the comment: > Before take_gil() knows whether it has to do any work I thought we had a check for when the GIL was not even initialized, but that doesn't seem to exist in master any more. Preserving GetLastError() at the same place we do errno is

[issue32981] Catastrophic backtracking in poplib (CVE-2018-1060) and difflib (CVE-2018-1061)

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- keywords: +security_issue nosy: +larry priority: normal -> critical title: Catastrophic backtracking in poplib and difflib -> Catastrophic backtracking in poplib (CVE-2018-1060) and difflib (CVE-2018-1061) versions: +Python 2.7, Python 3.4,

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about __floor__ and __ceil__? I think all these three method do not deserve separate paragraphs in Doc/reference/datamodel.rst, but they should be grouped together with __round__. -- nosy: +serhiy.storchaka

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Nathaniel Smith
Nathaniel Smith added the comment: You should also think about loop lifecycle: right now it's using the same loop for all test cases, so callbacks can leak between tests. Twisted actually goes a step further and explicitly checks for left over callbacks and fails the test if

[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +5797 ___ Python tracker ___ ___ Python-bugs-list

[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +5796 ___ Python tracker ___ ___ Python-bugs-list

[issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions

2018-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.8 ___ Python tracker ___

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Petter S
Petter S added the comment: > 1. Do we need support for async versions of setUp, setUpClass, etc? In my > opinion: yes. I completely agree. I would imagine many or most real-world tests requiring async setUp. There is also the question on how a custom loop etc.

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Ideally, if we don't have to do any work to reacquire the GIL, we shouldn't > do any work to preserve the error code either. Before take_gil() knows whether it has to do any work, it calls MUTEX_LOCK(_PyRuntime.ceval.gil.mutex), which

[issue33031] Questionable code in OrderedDict definition

2018-03-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The array of PyMethodDef for OrderedDict contains explicit definitions of methods like __delitem__, __eq__ and __init__. The purpose is aligning docstrings with Python implementation. But this doesn't work. Slot wrappers

[issue29871] Enable optimized locks on Windows

2018-03-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker ___ ___

[issue32592] Drop support of Windows Vista in Python 3.7

2018-03-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker ___ ___

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Yury Selivanov
Yury Selivanov added the comment: > That code does not seem to work for me: > https://gist.github.com/PetterS/f684095a09fd1d8164a4d8b28ce3932d > I get "RuntimeWarning: coroutine 'test_async_with_mock' was never awaited" > @mock.patch needs to work correctly for test

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
Steve Dower added the comment: > GetLastError() docs officially scare us I believe this is a case where the docs were updated from intended/correct behavior to actual behavior, which happens from time to time and is never clearly marked. As I say, they are _supposed_

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: FWIW, GetLastError() docs[1] officially scare us: Most functions that set the thread's last-error code set it when they fail. However, some functions also set the last-error code when they succeed. If the function is not documented to

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
miss-islington added the comment: New changeset 8c163bbf370f6f6cedd2c07f7d54c9b36c97d8f2 by Miss Islington (bot) in branch '3.7': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6010)

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
New submission from Steve Dower : Most Win32 API calls are made within Py_BEGIN_ALLOW_THREADS blocks, as they do not access Python objects and so we can release the GIL. However, in general, error handling occurs after the Py_END_ALLOW_THREADS line. Due to the design

[issue28113] Remove Py_CreateSymbolicLinkW

2018-03-08 Thread Steve Dower
Steve Dower added the comment: We should look at merging this, though we need a few things to be done first (anyone can jump in and do these, doesn't have to be Eryk): * patch needs to be converted to a GitHub PR * we should use unique names within %TEMP% to avoid

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5795 ___ Python tracker ___ ___

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +5794 ___ Python tracker ___

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 3b20d3454e8082e07dba93617793de5dc9237828 by Steve Dower (Alexey Izbyshev) in branch 'master': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010)

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily
Ned Deily added the comment: New changeset 2f3ba27185a369bcb6b36b13aa3518ffcc970ffa by Ned Deily (Miss Islington (bot)) in branch '3.6': [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) (GH-5954)

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- type: enhancement -> ___ Python tracker ___ ___ Python-bugs-list

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- nosy: +lars.gustaebel versions: +Python 3.7, Python 3.8 ___ Python tracker ___

[issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions

2018-03-08 Thread Siddhesh Poyarekar
New submission from Siddhesh Poyarekar : gcc 8 has added a new warning heuristic to detect invalid function casts and a stock python build seems to hit that warning quite often. bug 33012 fixes the most trivial case of METH_NOARGS, this bug is to track a

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-08 Thread Siddhesh Poyarekar
Change by Siddhesh Poyarekar : -- keywords: +patch pull_requests: +5792 stage: -> patch review ___ Python tracker ___

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: PR 5944 changes ABC.__subclasscheck__ (not issubclass) to check its first argument, so if it's merged there will be no crash even with the revert. -- ___ Python tracker

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Can > https://github.com/python/cpython/commit/fc7df0e664198cb05cafd972f190a18ca422989c > be reverted? Even if subclass() will check explicitly that its first argument is a type, ABC.__subclasscheck__() can be called

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Isn't it just a limitation? > Most Python-implemented objects supports weakref. I don't think "requiring > weakref support implies it must be type object". Formally, there is no implication. It is the abc module authors who know the

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Erik Bray
Erik Bray added the comment: This has a backport PR now for 3.6. Once that PR is merged I think we can close this as fixed. -- stage: patch review -> backport needed versions: +Python 3.6 ___ Python tracker

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Petter S
Petter S added the comment: > No, it shouldn't break them if you wrap async methods carefully. > Here's a metaclass that I wrote recently doing just that That code does not seem to work for me: https://gist.github.com/PetterS/f684095a09fd1d8164a4d8b28ce3932d I get

[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-08 Thread Christian Heimes
Change by Christian Heimes : -- assignee: christian.heimes -> ___ Python tracker ___ ___

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Christian Heimes
Christian Heimes added the comment: This is rather a feature than a bug. It is not possible to make a copy of a SSLContext object because OpenSSL doesn't support the operation. A context contains elements that can't be cloned easily, e.g. session resumption tickets.

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread INADA Naoki
INADA Naoki added the comment: > 1. ABCMeta.register() accepts types only. Yes. While ABC.register() and issubclass() have different users (e.g. ABC.register() will be used by framework author, and issubclass will be used by framework users), it's positive reason to

[issue33024] asyncio.WriteTransport.set_write_buffer_limits orders its args unintuitively and inconsistently with its companion function's return value

2018-03-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: We cannot change the method signature without breaking backward compatibility. I doubt if we should do something with the issue. -- ___ Python tracker

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-08 Thread Nir Soffer
Nir Soffer added the comment: Python cannot protect raw file descriptor from bad multi-threaded application. For example the application may close a file descriptor twice which may lead to closing unrelated file descriptor created by another thread just after it was closed,

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I do not see any point in allowing non-types in ABCMeta.__subclasscheck__. Currently, ABCs are clearly not designed to support non-types: 1. ABCMeta.register() accepts types only. 2. ABCMeta.__subclasscheck__ implicitly requires its

[issue17288] cannot jump from a 'return' or 'exception' trace event

2018-03-08 Thread Xavier de Gaye
Xavier de Gaye added the comment: Sorry, for some reason github did not send me the emails of your review and I did not think about checking the PR :-( Thanks for your review, I will work on it shortly. -- ___ Python tracker

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Richard Neumann
New submission from Richard Neumann : The tempfile.TemporaryDirectory is incorrectly documented at https://docs.python.org/3.6/library/tempfile.html#tempfile.TemporaryDirectory. It is described as a function, though actually being a class (unlinke

[issue33027] handling filename encoding in Content-Disposition by cgi.FieldStorage

2018-03-08 Thread Paweł
Change by Paweł : -- keywords: +patch pull_requests: +5790 stage: -> patch review ___ Python tracker ___

[issue33027] handling filename encoding in Content-Disposition by cgi.FieldStorage

2018-03-08 Thread Paweł
New submission from Paweł : It appears that cgi.FieldStorage does not handle Content-Disposition with filenames with defined encoding. (according to RFC5987) Example: ''' Content-Disposition: form-data; name="file";

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Nathaniel Smith
Nathaniel Smith added the comment: Class decorators are also worth considering in cases where you find yourself reaching for a metaclass. -- nosy: +njs ___ Python tracker

[issue17288] cannot jump from a 'return' or 'exception' trace event

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Xavier. I had pleasure from reviewing your patch. But please update tests for using the jump_test() decorator. -- ___ Python tracker

[issue33026] Fix jumping out of "with" block

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, it is not hard to fix this in older versions. -- versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker