[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2015-08-21 Thread eryksun
eryksun added the comment: It is not clear why the absence of _setmode(fd, os.O_BINARY) is not detected by tests. It's only a problem when an existing text-mode file descriptor is passed in. For example, in text mode the CRT handles b'\x1a' as an EOF marker: Python 3.5.0b4

[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-21 Thread Josh Rosenberg
Changes by Josh Rosenberg shadowranger+pyt...@gmail.com: -- nosy: +josh.r ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___

[issue24908] sysconfig.py and distutils.sysconfig.py disagree on directory spelling on Windows

2015-08-21 Thread Hartmut Niemann
New submission from Hartmut Niemann: Lib\sysconfig.py uses '{installed_base}/Include' as the include directory on Windows, Lib\distutils\sysconfig.py uses elif os.name == nt: return os.path.join(prefix, include) which is normally harmless because windows file systems are

[issue24352] Provide a way for assertLogs to optionally not hide the logging output

2015-08-21 Thread R. David Murray
R. David Murray added the comment: My test harness already dumps the logging buffer on test failure. What I need this for is debugging. My test harness verbose = 2 flag turns on logging globally, and I need to see the logging from the code under test correctly interspersed with the other

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread eryksun
eryksun added the comment: I forgot to set errcheck: import ctypes userenv = ctypes.WinDLL('userenv', use_last_error=True) def errcheck_bool(result, func, args): if not result: raise ctypes.WinError(ctypes.get_last_error()) return args

[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2015-08-21 Thread Mark Roseman
Mark Roseman added the comment: Just came across this one (Terry I'm sure can figure out why). I'm sympathetic with Guilherme's wish that Tk had done this one differently, as an option to specify an existing text widget peer when creating a text widget, rather than having the original spawn a

[issue24903] Do not verify destdir argument to compileall

2015-08-21 Thread Jake Garver
Jake Garver added the comment: I agree. I couldn't find a use for the check, so I removed it entirely in the provided patch. I'm running that way now with success, but of course I'm covering just one use case. Digging back a bit further, the isdir() check came in here:

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-08-21 Thread Cyd Haselton
Cyd Haselton added the comment: Question for Ryan Gonzalez: Given this information... On August 20, 2015 8:03:13 PM CDT, Russell Keith-Magee rep...@bugs.python.org wrote: Russell Keith-Magee added the comment: What hardware architecture are you compiling for? If it's ARM64, and you're not

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-08-21 Thread Ryan Gonzalez
Ryan Gonzalez added the comment: On August 21, 2015 9:25:10 AM CDT, Cyd Haselton rep...@bugs.python.org wrote: Cyd Haselton added the comment: Question for Ryan Gonzalez: Given this information... On August 20, 2015 8:03:13 PM CDT, Russell Keith-Magee rep...@bugs.python.org wrote: Russell

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread eryksun
eryksun added the comment: Albert, this issue was opened for Python 2.4 and was closed over 6 years ago. Open a new issue if you believe there's a bug or room for improvement in a currently supported Python version. FYI, on Windows _PyOS_URandom first initializes the Crypto API by calling

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread Albert Zeyer
Albert Zeyer added the comment: Ah thanks, that explains why it failed for me, and why it works after my fix, which was anyway what I intended. I mostly posted my comment here in case someone else hits this, so he has another thing to check/debug. I don't think that there is a bug on

[issue24908] sysconfig.py and distutils.sysconfig.py disagree on directory spelling on Windows

2015-08-21 Thread eryksun
eryksun added the comment: Within the standard library, I think only the site module uses the top-level sysconfig module, which IIRC it uses to set up sys.path. Note that WINDOWS_SCHEME in distutils.command.install uses Include. Also for virtual environments,

[issue24903] Do not verify destdir argument to compileall

2015-08-21 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24903 ___ ___

[issue19084] No way to use TLS-PSK from python ssl

2015-08-21 Thread Nicolas Jouanin
Changes by Nicolas Jouanin n...@beerfactory.org: -- nosy: +njouanin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19084 ___ ___ Python-bugs-list

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread Adam Meily
Adam Meily added the comment: Attached is a test Python script that you can run to see the race condition in action. There are two Python scripts: pipe.py and reader.py. - pipe.py: make two subprocess.Popen() calls from two different threads. - reader.py: (its content is in the bottom

[issue11943] Add TLS-SRP (RFC 5054) support to ssl, _ssl, http, and urllib

2015-08-21 Thread Nicolas Jouanin
Changes by Nicolas Jouanin n...@beerfactory.org: -- nosy: +njouanin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11943 ___ ___ Python-bugs-list

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread Adam Meily
New submission from Adam Meily: ** This issue and attached patch only affect Windows ** Currently, the Popen constructor will duplicate any stdout, stdin, and/or stderr handle passed in and make them inheritable, by calling DuplicateHandle. If two threads call Popen at the same time, the

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread R. David Murray
R. David Murray added the comment: Is it possible to construct a test for this? -- components: +Windows nosy: +gregory.p.smith, paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware stage: - patch review versions: -Python 3.2, Python 3.3

[issue24903] Do not verify destdir argument to compileall

2015-08-21 Thread R. David Murray
R. David Murray added the comment: OK, so I think the goal was to prevent more than one *directory* from being specified, since as I said earlier that wouldn't make sense given we have only a single destdir path. However, for backward compatibility reasons we should probably not restrict it,

[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared

2015-08-21 Thread R. David Murray
R. David Murray added the comment: pkg_resources is 3rd party code (from the point of view of this tracker). If you are saying its code is revealing a bug in python, can you expand on what exactly the bug is? -- nosy: +r.david.murray ___ Python

[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2015-08-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +haypo, serhiy.storchaka versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24881 ___

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-08-21 Thread Ryan Gonzalez
Ryan Gonzalez added the comment: Bus error is basically unaligned memory access. ... ...do you feel like trying to get a backtrace from GDB again? :) (The last time likely didn't end well because the machine stack got somehow corrupted.) On Fri, Aug 21, 2015 at 2:04 PM, Cyd Haselton

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread Adam Meily
Adam Meily added the comment: Ok, I can re-implement the patch to meet what you all are looking for. I just want to double check that I'm on the same page: I'll get rid of the lock, because the fix should really be done in the call to CreateProcessW. I imagine that I'll be editing

[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2015-08-21 Thread Akira Li
Akira Li added the comment: To make _pyio correspond to the C version I've added sys.platform in {'win32', 'cygwin'} condition. See the attached pyio_setmode.diff It is not clear why the absence of _setmode(fd, os.O_BINARY) is not detected by tests. (a) a corresponding test should be

[issue19469] Duplicate namespace package portions (but not on Windows)

2015-08-21 Thread Brett Cannon
Brett Cannon added the comment: I can't reproduce under Python 3.4.3, the 3.4 branch, 3.5 branch, or default with a plain namespace package. Can anyone come up with a test case that can reproduce this problem? Otherwise I'll assume it was a bug that got fixed in 3.4.2. -- status:

[issue17945] tkinter: change API of non-functioning peer_create, does not instantiate Text

2015-08-21 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +serhiy.storchaka title: tkinter/Python 3.3.0: peer_create doesn't instantiate Text - tkinter: change API of non-functioning peer_create, does not instantiate Text type: behavior - enhancement versions: +Python 3.6 -Python 3.3,

[issue24848] Warts in UTF-7 error handling

2015-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a reason for behavior in case 2. This is likely a truncated data and it is safer to raise an exception than silently produce lone surrogate. Current UTF-7 encoder always adds '-' after ending shift sequence. I suppose this is not a bug. However

[issue24911] Context manager of socket.socket is not documented

2015-08-21 Thread zodalahtathi
New submission from zodalahtathi: socket.socket has a context manager to automatically close the socket with the `with` statement: https://hg.python.org/cpython/file/d1bf181afa82/Lib/socket.py#l138 However it is not documented, unlike socket.create_connection. -- assignee:

[issue8987] Distutils doesn't quote Windows command lines properly

2015-08-21 Thread Chris Hogan
Chris Hogan added the comment: Here's a change that might fix the trailing backslash problem for now without breaking anything. libpath-fix.patch only affects arguments that we know are paths. This happens before anything is quoted. This avoids the problem when something like 'C:\path with

[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared

2015-08-21 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24907 ___ ___ Python-bugs-list

[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2015-08-21 Thread Mark Roseman
Mark Roseman added the comment: Did a quick check... this approach seems to work. Only change was in step 4 should set both ._w and ._name for the widget object -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17945

[issue24910] Windows MSIs don't have unique display names

2015-08-21 Thread Steve Dower
New submission from Steve Dower: The MSIs for debug symbols and binaries have the same descriptions as the main installers, so you can't distinguish between the packages in lists like (get-package python).Name (in Powershell): Python 3.5.0rc1 Development Libraries (64-bit) Python 3.5.0rc1

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread STINNER Victor
STINNER Victor added the comment: Yeah, when stdin, stdout or stderr is a pipe, subprocess.Popen() calls CreateProcess() with the STARTF_USESTDHANDLES flag and bInheritHandles=TRUE. This issue was fixed on UNIX for file descriptor inheritance. The fix is a major change: Python 3.4 now only

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread Adam Meily
Adam Meily added the comment: @r.david.murray: Yes I could make a test. @haypo: I did not know about the PROC_THREAD_ATTRIBUTE_HANDLE_LIST structure, thanks for the heads up. You pointed me in the right direction, and I see now that you've been following this, and similar, subprocessing

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread STINNER Victor
STINNER Victor added the comment: Yeah, when stdin, stdout or stderr is a pipe, subprocess.Popen() calls CreateProcess() with the STARTF_USESTDHANDLES flag and bInheritHandles=TRUE. This issue was fixed on UNIX for file descriptor inheritance. The fix is a major change: Python 3.4 now only

[issue993766] bdist_dumb and --relative on Windows fails

2015-08-21 Thread Chris Hogan
Chris Hogan added the comment: I think ensure_relative is incorrect. The comment in the function states: Take the full path 'path', and make it a relative path. This is useful to make 'path' the second argument to os.path.join(). However, according to the docs for os.path.join, if a

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread STINNER Victor
STINNER Victor added the comment: It looks like the structure you reference to, PROC_THREAD_ATTRIBUTE_HANDLE_LIST (STARTUPINFOEX), is only available in Windows Vista and after. Which means that Windows XP/Server 2003 would still have this issue. Windows XP is no more supported in Python

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-08-21 Thread Cyd Haselton
Cyd Haselton added the comment: Thanks Ryan. Running ./python -m test (with the edit to the __init__.py for ctypes) produces the following error: [151/390/18] test_hash Fatal Python error: Bus error Current thread 0xb6f72ec8 (most recent call first): File

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- Removed message: http://bugs.python.org/msg248964 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24909 ___

[issue19469] Duplicate namespace package portions (but not on Windows)

2015-08-21 Thread Carl Meyer
Carl Meyer added the comment: FWIW, this bug has bitten Django; see https://code.djangoproject.com/ticket/25246 We can easily work around it for future versions, but we have code in released versions that assumed that `__path__` wouldn't contain dupes; it causes us to raise an error in a

[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-08-21 Thread Zachary Ware
Zachary Ware added the comment: STINNER Victor added the comment: For Windows Server 2003, yes, we will have to keep the current code which has the race condition. Server 2003 is also unsupported in 3.5+ (MS extended support ended in July). --

[issue24913] newblock() Uninitialized Variable

2015-08-21 Thread John Leitch
New submission from John Leitch: Python 3.5 suffers from a vulnerability caused by the behavior of the newblock() function used by the collections.deque module. When called, newblock() allocates memory using PyMem_Malloc() and does not initialize it: static block * newblock(Py_ssize_t len) {

[issue24913] newblock() Uninitialized Variable

2015-08-21 Thread John Leitch
Changes by John Leitch john.leit...@gmail.com: Added file: http://bugs.python.org/file40225/newblock_Uninitialized_variable.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24913 ___

[issue24913] newblock() Uninitialized Variable

2015-08-21 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24913 ___ ___

[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared

2015-08-21 Thread Vadim Kantorov
New submission from Vadim Kantorov: If module's __init__.py contains __import__('pkg_resources').declare_namespace(__name__), the module is not loaded, even though it's located in the current directory and should mask other modules. Originally I stumbled upon this issue while installing a

[issue24906] asyncore asynchat hanging on ssl

2015-08-21 Thread Michele Comitini
New submission from Michele Comitini: When sending a message larger than 4096 bytes with smtpd on a ssl socket, everything hangs. This is due to polling before synchronizing the SSL channel with the underlying socket. The issue can be solved by properly modifying the poll function and

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread Albert Zeyer
Albert Zeyer added the comment: Note that there are still people who get this error in some strange cases, me included. E.g.: http://stackoverflow.com/questions/27904936/python-exe-file-crashes-while-launching-on-windows-xp/32137554#32137554 This happened at a call to `os.urandom` for me.

[issue24905] Allow incremental I/O to blobs in sqlite3

2015-08-21 Thread Jim Minter
New submission from Jim Minter: SQLite supports incremental I/O to blobs, i.e. the capability to stream reads and writes to blobs without having to load the entire blob into memory first. See https://www.sqlite.org/c3ref/blob_open.html for more details on the C API. It'd be nice if it were