[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: Attaching a patch to fix this. Please review. -- keywords: +patch Added file: http://bugs.python.org/file45136/issue28471.patch ___ Python tracker _

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes
Christian Heimes added the comment: LGTM, thanks Yury! -- stage: -> patch review type: -> crash versions: +Python 3.7 ___ Python tracker ___ ___

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: > LGTM, thanks Yury! NP :) Should this be committed to 3.6/default, or in 3.5 too? -- ___ Python tracker ___ _

[issue28334] netrc does not work if $HOME is not set

2016-10-18 Thread Dimitri Merejkowsky
Dimitri Merejkowsky added the comment: During review SilentGhost suggested that maybe a test was not essential. In any case, I think patching documentation about the new behavior won't hurt. Do you want me to do that? -- ___ Python tracker

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes
Christian Heimes added the comment: 3.5 is not affected by the crasher. I only added the error check to default (3.6). -- ___ Python tracker ___

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: > Fatal Python error: Python memory allocator called without holding the GIL Oh, I didn't expect that my new check would catch such bug. Nice. In release mode, the check is disabled by default (can be enabled at runtime), and I don't think that the code can cra

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4b5b233d4c98 by Yury Selivanov in branch '3.6': Issue #28471: Fix crash (GIL state related) in socket.setblocking https://hg.python.org/cpython/rev/4b5b233d4c98 New changeset 554fb699af8c by Yury Selivanov in branch 'default': Merge 3.6 (issue #2847

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: > In release mode, the check is disabled by default (can be enabled at runtime), and I don't think that the code can crash. It actually crashed in release mode for me. Maybe the exact location of SF was different, but whatever... Anyways, closing the issue. T

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Ned Deily
Changes by Ned Deily : -- priority: release blocker -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: re_cache_ordered_dict_popitem.patch: LGTM, it can be pushed to the default branch. -- "This is unlikely possible with current API of lru_cache. Testing flags before looking up in a cache adds an overhead." Oh wait, I looked at the code and this case is compl

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: I'm curious. I tested in release mode, the example does crash: $ ./python x.py Segmentation fault (core dumped) I'm able to get a Python traceback using PYTHONMALLOC=debug: $ PYTHONMALLOC=debug ./python x.py Fatal Python error: Python memory allocator calle

[issue24381] Got warning when compiling ffi.c on Mac

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: Modules/_ctypes/libffi_osx/ffi.c comes from libffi, can you please propose a bugfix upstream? * https://sourceware.org/libffi/ * https://github.com/libffi/libffi I'm not sure where is the upstream. -- nosy: +haypo

[issue28334] netrc does not work if $HOME is not set

2016-10-18 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue24381] Got warning when compiling ffi.c on Mac

2016-10-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: of course, I will do it. Thank for your review -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm curious. I tested in release mode, the example does crash: Well, since the GIL wasn't properly acquired, it's only a matter of time until something else crashes. -- ___ Python tracker

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Martin Panter
Martin Panter added the comment: Thanks for tackling this one Tim. I agree with Berker that the :const:`True` changes are out of scope (some introduce errors and inaccuracies). class CalledProcessError(SubprocessError): -"""Raised when a check_call() or check_output() process returns non-z

[issue28441] Change sys.executable to include executable suffix

2016-10-18 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: I agree to add the suffix to solve ambiguous path on Cygwin. And I think the patch should apply to all platforms having executable suffix. Therefore, I modified your patch to remove #if directive for Cygwin, and I changed title to spread covered platforms.

[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Roman Podoliaka
New submission from Roman Podoliaka: There are a couple of errors in SystemTap examples from "Instrumenting CPython with DTrace and SystemTap" page (https://docs.python.org/dev/howto/instrumentation.html): 1) in SystemTap double quotes are used to denote string literals. As is examples fail w

[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread Garrett Nievin
New submission from Garrett Nievin: Using Claws Mail, and mailbox.MH crashes on two different conditions: 1) sequence spans lines, suchly: unseen: 1-222 225-300 990-1024 1048-2048 Not Pythonic, but I fixed it with this update: def get_sequences(self): """Return a name-to-key-list d

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: I think this patch should be reverted. It breaks backwards compatibility: import socket sock0 = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno()) sock0.clos

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: IOW, what is happening in uvloop: 1. A user has a Python socket object and passes it asyncio (run with uvloop) API. 2. uvloop extracts the FD of the socket, and passes it to low-level libuv. 3. At some point of time, libuv closes the FD. 4. When user tries t

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Martin Panter
Martin Panter added the comment: I think your code example is not very robust, because the “sock” object refers to a freed file descriptor, and could easily close an unrelated file: $ python3.5 -q >>> import socket >>> sock0 = socket.socket() >>> sock = socket.socket(fileno=sock0.fileno()) >>>

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Martin Panter
Martin Panter added the comment: If libuv closes the FD (step 3), won’t you get the same sort of problem if the uvloop user tries to do something else with the Python socket object, e.g. call getpeername()? I see the fileno=... parameter for sockets as a parallel to the os.fdopen() function,

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: Another example: some asyncio (run with uvloop) code: conn, _ = lsock.accept() f = loop.create_task( loop.connect_accepted_socket( proto_factory, conn)) # More code loop.run_forever() conn.clos

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: My proposal: ignore EBADF in socket.close(). It means that the socket is closed already. It doesn't matter why. -- ___ Python tracker ___ ___

[issue26685] Raise errors from socket.close()

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: > My proposal: ignore EBADF in socket.close(). It means that the socket is > closed already. It doesn't matter why. As Martin explained, getting EBAD means that your code smells. Your code may close completely unrelated file descriptor... Say hello to race co

[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov
Yury Selivanov added the comment: Maybe we should fix asyncio. Maybe if a user passes an existing socket object into loop.create_connection, it should duplicate the socket. -- ___ Python tracker _

[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread R. David Murray
R. David Murray added the comment: What do you mean by "crashes"? I'm sure you don't mean a segfault. Can you paste the traceback? Neither of those two cases are valid in mh, as far as I know, so I'm not sure there is anything to fix here. -- nosy: +r.david.murray type: crash -> beh

[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread R. David Murray
R. David Murray added the comment: I just checked, and nhm 1.3 produces a warning for case 1 and either fails to interpret anything past a token that starts with a '-' or it hangs. You should report the invalid sequence problem to claws mail. -- resolution: -> third party stage: -> r

[issue28448] C implemented Future doesn't work on Windows

2016-10-18 Thread INADA Naoki
INADA Naoki added the comment: I think _WaitCancelFuture can do same thing by overriding callers of _schedule_callbacks. Attached patch does it, and make _schedule_callbacks private by renaming it to __schedule_callbacks. -- Added file: http://bugs.python.org/file45139/dont-override-sc

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell
Tim Mitchell added the comment: Am now working from tip of default in mercurial (Python 3.6). * Removed all changes to subprocess.rst. subprocess.__doc__ * Trimmed down even further - removed function signatures. * added note to see Python docs for complete description. Exception docs * just l

[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Ned Deily
Changes by Ned Deily : -- nosy: +lukasz.langa versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue28465] python 3.5 magic number

2016-10-18 Thread 曹忠
曹忠 added the comment: I try, still the same: On debian 9 and python 3.5.2: >>> importlib.util.MAGIC_NUMBER b'\x17\r\r\n' On windows and python 3.5.2 >>> importlib.util.MAGIC_NUMBER b'\x16\r\r\n' -- ___ Python tracker

[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 23188 (referenced above) covers making this a public API for 3.7. I think it's a good idea, but it's too late to add it to 3.6, and getting the documentation right is going to require some discussion (as using this new API isn't necessary if you're already

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2016-10-18 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- title: PyUnicode_FromFromat interger format handling different from printf about zeropad -> PyUnicode_FromFormat integer format handling different from printf about zeropad ___ Python tracker

[issue28465] python 3.5 magic number

2016-10-18 Thread Zachary Ware
Zachary Ware added the comment: I suspect Debian 9's Python 3.5.2 has patches beyond v3.5.2, including the patch from #27286 (34d24c51eab6). What problem is this causing for you? -- nosy: +doko, serhiy.storchaka, zach.ware ___ Python tracker

[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c21df505684 by Benjamin Peterson in branch '3.6': always use double quotes for SystemTap string literals (closes #28472) https://hg.python.org/cpython/rev/5c21df505684 New changeset dc10bd89473b by Benjamin Peterson in branch 'default': merge 3.6 (

<    1   2