[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: I opened the issue #23605: Use the new os.scandir() function in os.walk(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22524 ___

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread Steve Dower
Steve Dower added the comment: I didn't know about winerror_to_errno(), so that might help. But there are other dependencies on _Py_fstat's error code throughout posixmodule.c, so I don't think this is sufficient. (For example, patherror() is already switched on OS to handle it correctly. I

[issue22227] Simplify tarfile iterator

2015-03-07 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7 ___

[issue23588] Errno conflicts in ssl.SSLError

2015-03-07 Thread Martin Panter
Martin Panter added the comment: Okay I see your point about backwards compatibility now. Indeed, I have written code myself before Python 3.3 that used to inspect err.args[0], and it would suffer a similar problem if I had not updated it to use the new Python 3.3 exception subclasses. Below

[issue23603] Embedding Python3.4 - PyUnicode_Check fails (MinGW-W64)

2015-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Your interpretation of PyUnicode_Check() is correct. I don't know why your program fails but I would suggest some kind of compiler bug or incompatibility. You can find the definition of the unicode type in Objects/unicodeobject.c. There you'll find that

[issue23591] Add IntFlags

2015-03-07 Thread Martin Panter
Martin Panter added the comment: It would make more sense and be more consistent if the str() and repr() used one’s complement in all cases, i.e.: self.assertEqual(str(Perm(~0)), ~0) Also, the repr() seems to be doing a bad attempt at Python pseudo code. Instead of Perm.R|W: 3 maybe it

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: test_os fails on Windows since the changeset 75aadb4450fd: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5798/steps/test/logs/stdio == FAIL: test_15261

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: Oh oh, OpenIndiana doesn't support d_type: the dirent structure has no d_type field and DT_xxx constants like DT_UNKNOWN are not defined. gcc -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -I/usr/local/include/ncursesw -m64

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-03-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 60e5c34ec53a by Victor Stinner in branch 'default': Issue #22524: Fix os.scandir() for platforms which don't have a d_type field in https://hg.python.org/cpython/rev/60e5c34ec53a -- ___ Python tracker

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread Steve Dower
Steve Dower added the comment: This is because of the _Py_fstat change to use errno instead of GetLastError. It seems other callers are relying on GetLastError to raise the correct exception, and that seems to be the standard throughout posixmodule as far as stat calls are concerned. Best

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: fstat_ebadf.patch: _Py_fstat() now also set errno on Windows. It's a little bit different than your patch, because it still calls SetLastError(ERROR_INVALID_HANDLE) to explicitly set the Windows error on bad file descriptor. We must set errno et

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: fstat_ebadf.patch: _Py_fstat() now also set errno on Windows. It's a little bit different than your patch, because it still calls SetLastError(ERROR_INVALID_HANDLE) to explicitly set the Windows error on bad file descriptor. We must set errno et

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- Removed message: http://bugs.python.org/msg237501 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23524 ___

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file38383/fstat_ebadf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23524 ___

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- Removed message: http://bugs.python.org/msg237501 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23524 ___

[issue23556] Scope for raise without argument is different in Python 2 and 3

2015-03-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23556 ___

[issue23591] Add IntFlags

2015-03-07 Thread Ethan Furman
Ethan Furman added the comment: The current patch is more along the lines of a proof-of-concept. The final IntFlag type (if there is one) would be quite a bit more extensive since part of the reason for its existence is to not lose type -- so pretty much every __op__ would have to be

[issue23556] Scope for raise without argument is different in Python 2 and 3

2015-03-07 Thread Martin Panter
Martin Panter added the comment: For the Python 3 case, the documentation is vague and probably wrong, depending on what you understand “the current scope” to mean. I think it should read something like . . . raise re-raises the current exception that is being handled. If no exception is

[issue23570] Change with subprocess.Popen(): (context manager) to ignore broken pipe error

2015-03-07 Thread Martin Panter
Martin Panter added the comment: After understanding the Windows test failure in Issue 21619, I am starting to believe that code relying on a BrokenPipeError or EPIPE is flawed. It is an inherent unavoidable race condition with the receiving end of the pipe, as long as another thread or

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset d8e49a2795e7 by Steve Dower in branch 'default': Issue #23524: Change back to using Windows errors for _Py_fstat instead of the errno shim. https://hg.python.org/cpython/rev/d8e49a2795e7 -- ___ Python

[issue23144] html.parser.HTMLParser: setting 'convert_charrefs = True' leads to dropped text

2015-03-07 Thread Martin Panter
Martin Panter added the comment: A context manager here would seem a bit strange. Is there any precedent for using context managers with feed parsers? The two others that come to mind are ElementTree.XMLParser and email.parser.FeedParser. These two build an object while parsing, and close()

[issue23588] Errno conflicts in ssl.SSLError

2015-03-07 Thread Ben Darnell
Ben Darnell added the comment: I agree that SSLError should have used a different attribute, but it's too late for that - changing it would break any code currently relying on SSL errnos (in particular asynchronous code using the SSL_ERROR_WANT_{READ,WRITE} error codes for normal operation).

[issue23605] Use the new os.scandir() function in os.walk()

2015-03-07 Thread Ben Hoyt
Ben Hoyt added the comment: Attaching a first cut at this -- basically the implementation I use for walk() in scandir.py on GitHub. One thing that's really weird to me: are the os.walk() unit tests actually being run? In test_os.py, I notice everything's in WalkTest.setUp, which is kinda

[issue23606] ctypes.util.find_library(c) no longer makes sense

2015-03-07 Thread Steve Dower
New submission from Steve Dower: With the changes to the CRT on Windows, it no longer makes any sense to call find_library(c) or (m) as there is no single C Runtime DLL. The new structure has a grouped and layered approach that is better for versioning, so we now link to

[issue23606] ctypes.util.find_library(c) no longer makes sense

2015-03-07 Thread eryksun
eryksun added the comment: Shouldn't find_library(c) return ucrtbase.dll or ucrtbased.dll (debug)? Introducing the Universal CRT http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx -- nosy: +eryksun ___ Python

[issue22252] ssl blocking IO errors should inherit BlockingIOError

2015-03-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium title: ssl blocking IO errors - ssl blocking IO errors should inherit BlockingIOError ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22252

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2015-03-07 Thread STINNER Victor
STINNER Victor added the comment: I commited scandir-8.patch with the documentation of scandir-5.patch. I wanted os.scandir() to be part of Python 3.5 alpha 2. Thanks for your patience Ben ;-) We should now watch buildbots to check how they appreciate os.scandir().

[issue23605] Use the new os.scandir() function in os.walk()

2015-03-07 Thread STINNER Victor
New submission from STINNER Victor: The PEP 471 announces a huge speed up of the os.walk() function, but os.walk() was not modified yet. I just merged the implementation of os.scandir() (issue #22524), it's now time to work on os.walk(). We need a patch and benchmarks on Linux and Windows.

[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2015-03-07 Thread Demian Brecht
Demian Brecht added the comment: After sleeping on this, I think that the best route to go would be to drop the trailer implementation (if it's not practical it doesn't belong in the standard library). Also, to better preserve backwards compatibility it may be better to circumvent the

[issue23588] Errno conflicts in ssl.SSLError

2015-03-07 Thread Martin Panter
Martin Panter added the comment: Sorry I take back my claim that the error codes were undocumented; see the example code in https://docs.python.org/3.2/library/ssl.html#ssl-nonblocking. Perhaps the most compatible way to fix this would be to change the SSL error codes to something (custom

<    1   2