[issue36116] test_multiprocessing_spawn fails on AMD64 Windows8 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

> It's also possible that the child process is causing the segfault because of 
> misconfiguration (e.g. broken environment variables).

Maybe, but the test also produces core dump on FreeBSD: bpo-36114. It looks 
more like a real bug.

I set the priority again to release blocker to not forget this regression.

--
priority: high -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

> I suspect changes for this issue may be creating test_io failures on my 
> windows builders, (...)

I created bpo-36177 to track this regression.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36177] test_io: test_daemon_threads_shutdown_stdout_deadlock() fails on x86 Windows7 3.x

2019-03-04 Thread STINNER Victor


New submission from STINNER Victor :

I don't recall this failure previously, it looks like a regression.

https://buildbot.python.org/all/#/builders/58/builds/2001

==
FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_io.py", 
line 4138, in test_daemon_threads_shutdown_stdout_deadlock
self.check_daemon_threads_shutdown_deadlock('stdout')
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_io.py", 
line 4129, in check_daemon_threads_shutdown_deadlock
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in ''

--

Copy of David Bolen's (the buildbot worker owner) message on bpo-33608, 
msg336897:

"""
I suspect changes for this issue may be creating test_io failures on my windows 
builders, most notably my x86 Windows 7 builder where test_io has been failing 
both attempts on almost all builds.  It fails with a lock failure during 
interpreter shutdown, and commit ef4ac967 appears the most plausible commit out 
of the set introduced at the first failing build on Feb 24.

See https://buildbot.python.org/all/#/builders/58/builds/1977 for the first 
failure.  test_io has failed both attempts on all but 3 of the subsequent 16 
tests of the 3.x branch.

It might be worth noting that this builder is slow, so if there are timeouts 
involved or a race condition of any sort it might be triggering it more readily 
than other builders.  I do, however, see the same failures - albeit less 
frequently and not usually on both tries - on the Win8 and Win10 builders.

For what it's worth one other oddity is that while having test_multiprocessing* 
failures are relatively common on the Win7 builder during the first round of 
tests due to exceeding the timeout, they usually pass on the retry, but over 
this same time frame have begun failing - not due to timeout - even on the 
second attempt, which is unusual.  It might be coincidental but similar 
failures are also showing up sporadically on the Win8/Win10 builders where such 
failures are not common at all.
"""

--
components: Tests
messages: 337073
nosy: db3l, eric.snow, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_io: test_daemon_threads_shutdown_stdout_deadlock() fails on x86 
Windows7 3.x
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 
custom -> test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 
3.x

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36177] test_io: test_daemon_threads_shutdown_stdout_deadlock() fails on x86 Windows7 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, David also wrote:

"""
If I can help with testing or builder access or anything just let me know.  It 
appears that I can pretty reliably trigger the error through just the 
individual tests (test_daemon_threads_shutdown_std{out,err}_deadlock) in 
isolation, which is definitely less tedious than a full buildbot run to test a 
change.

BTW, while not directly related since it was only just merged, and I won't 
pretend to have any real understanding of the changes here, I do have a 
question about PR 12024 ... it appears HEAD_UNLOCK is used twice in 
_PyInterpreterState_LookUpID.  Shouldn't one of those be HEAD_LOCK?
"""

https://bugs.python.org/issue33608#msg336975

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35828] test_multiprocessing_fork - crashes in PyDict_GetItem - segmentation error

2019-03-04 Thread Michael Felt


Michael Felt  added the comment:

I see I already asked howto better utilize this info:

ConnectionRefusedError: [Errno 79] Connection refused
Warning -- files was modified by test_multiprocessing_fork
  Before: []
  After:  ['core']

-- so, more specific -- which module, or file, is doing this check - as I would 
like to do postmortem analysis of the core dump.

Thx.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36116] test_multiprocessing_spawn fails on AMD64 Windows8 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

test_mymanager and test_mymanager_context of 
test_multiprocessing_spawn.WithManagerTestMyManager failed in this build:

> https://buildbot.python.org/all/#/builders/58/builds/1983/steps/3/logs/stdio

ERROR: test_multiprocessing (test.test_venv.BasicTest)
FAIL: test_async_gen_asyncio_gc_aclose_09 
(test.test_asyncgen.AsyncGenAsyncioTest)
FAIL: test_daemon_threads_shutdown_stderr_deadlock (test.test_io.CMiscIOTest)
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in (...)
FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest)
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in ''
Re-running failed tests in verbose mode
Re-running test 'test_venv' in verbose mode
ERROR: test_multiprocessing (test.test_venv.BasicTest)
Re-running test 'test_asyncgen' in verbose mode
Re-running test 'test_multiprocessing_spawn' in verbose mode
FAIL: test_mymanager (test.test_multiprocessing_spawn.WithManagerTestMyManager)
FAIL: test_mymanager_context 
(test.test_multiprocessing_spawn.WithManagerTestMyManager)
Re-running test 'test_io' in verbose mode
FAIL: test_daemon_threads_shutdown_stderr_deadlock (test.test_io.CMiscIOTest)
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in (...)
FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest)
self.assertIn("Fatal Python error: could not acquire lock "
AssertionError: "Fatal Python error: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads" not found in ''

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

I can reproduce the crash on my FreeBSD 12 VM:

vstinner@freebsd$ ./python -m test --fail-env-changed 
test_multiprocessing_spawn -v

FAIL: test_mymanager_context_prestarted 
(test.test_multiprocessing_spawn.WithManagerTestMyManager)
--
Traceback (most recent call last):
  File 
"/usr/home/vstinner/prog/python/master/Lib/test/_test_multiprocessing.py", line 
2754, in test_mymanager_context_prestarted
self.assertEqual(manager._process.exitcode, 0)
AssertionError: -10 != 0

Warning -- files was modified by test_multiprocessing_spawn
  Before: []
  After:  ['python.8184.core']

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Hameer Abbasi


New submission from Hameer Abbasi :

I may be completely misunderstanding here, but: here's a reproducible example:

class MyMeta(type):
def __new__(cls, *args, **kwargs):
print('__new__', *args, **kwargs)
super().__new__(cls, *args, **kwargs)

def __init__(self, a):
print('__init__', *args, **kwargs)
super().__init__(*args, **kwargs)

class A(metaclass=MyMeta):
pass

MyMeta('A', (), {'__module__': '__main__', '__qualname__': 'A'})


Output:

__new__ A () {'__module__': '__main__', '__qualname__': 'A'}
__new__ A () {'__module__': '__main__', '__qualname__': 'A'}

Is this by design?

--
components: Interpreter Core
messages: 337079
nosy: Hameer Abbasi
priority: normal
severity: normal
status: open
title: type.__init__ called instead of cls.__init__ when inheriting from type.
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31904] Python should support VxWorks RTOS

2019-03-04 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +12155

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Interesting, I tried several hours to reproduce the crash on the buildbot 
itself manually and I could not do it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

I recently (Feb 25) fixed the config of this slow buildbot to change the 
timeout from 15 min to 20 min:

https://github.com/python/buildmaster-config/commit/37cf09ca9a5b6ce14b4e9b481101d559c4e55485
https://github.com/python/buildmaster-config/commit/e4155a744819acdbe7ada03b12116f7c147a9166

It seems like there is a correlation between this buildbot config change and 
the buildbot starting to create a coredump file. The test started to create a 
core dump around build 624, Feb 25.

--

With coredump.

Warning -- files was modified by test_multiprocessing_spawn:

https://buildbot.python.org/all/#/builders/168/builds/624
# 625 was fine
https://buildbot.python.org/all/#/builders/168/builds/626
https://buildbot.python.org/all/#/builders/168/builds/628
https://buildbot.python.org/all/#/builders/168/builds/629
https://buildbot.python.org/all/#/builders/168/builds/630
https://buildbot.python.org/all/#/builders/168/builds/631

--

Without coredump: fail but no coredump.

ERROR: test_shared_memory_SharedMemoryManager_basics 
(test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_across_processes 
(test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_basics 
(test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_ShareableList_basics 
(test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_ShareableList_pickling 
(test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_SharedMemoryManager_basics 
(test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_across_processes 
(test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_basics 
(test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_ShareableList_basics 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_ShareableList_pickling 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_SharedMemoryManager_basics 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_across_processes 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
ERROR: test_shared_memory_basics 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
Re-running failed tests in verbose mode

https://buildbot.python.org/all/#/builders/168/builds/617
https://buildbot.python.org/all/#/builders/168/builds/618
https://buildbot.python.org/all/#/builders/168/builds/620
https://buildbot.python.org/all/#/builders/168/builds/622
https://buildbot.python.org/all/#/builders/168/builds/623

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

I set the priority to release blocker to remind to fix this regression. I guess 
that it's the same bug than bpo-36116, but since it's a different OS (FreeBSD / 
Windows), I prefer to continue to use separated issues.

--
nosy: +lukasz.langa
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31904] Python should support VxWorks RTOS

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f4b0a1c0da80318e0a4f4c70d2722f01ce3512dd by Victor Stinner 
(pxinwr) in branch 'master':
bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)
https://github.com/python/cpython/commit/f4b0a1c0da80318e0a4f4c70d2722f01ce3512dd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Can you paste traceback of the dump that you were able to generate in your 
FreeBSD? I wonder if you can get the symbols that the one I pasted were missing 
(likely in libthr.so).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Your metaclass.__new__ method returns None instead of the new class. The rule 
for calling __init__ is:

- if the constructor __new__ returns an instance of the type, then call the 
initializer __init__

- otherwise, don't call __init__ at all.

https://docs.python.org/3/reference/datamodel.html#object.__new__

Since your __new__ accidentally returns None, the __init__ is not called. If 
you change the line to say 

return super().__new__(cls, *args, **kwargs)

you will see that __init__ is called. (And discover the bugs in your init 
method :-)

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Hameer Abbasi


Hameer Abbasi  added the comment:

Ah, I wasn't aware I had to return...

The bug was deliberate to show that not even a different signature makes a 
difference. ;)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn: WithProcessesTestSharedMemory dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 
3.x -> test_multiprocessing_spawn: WithProcessesTestSharedMemory dumps core in 
AMD64 FreeBSD CURRENT Shared 3.x

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread Christian Heimes


New submission from Christian Heimes :

Charalampos Stratakis from Red Hat's Python Maintenance Team found two minor 
reference leaks in _hashopenssl.c. Ref counts of newly allocated are not 
decreased when allocation of another object fails.

--
assignee: christian.heimes
components: Extension Modules
messages: 337087
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: patch review
status: open
title: _hashopenssl has reference leaks in OOM case
type: resource usage
versions: Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +12156

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35859] Capture behavior depends on the order of an alternation

2019-03-04 Thread Ma Lin


Ma Lin  added the comment:

Found another bug in re:

>>> re.match(r'(?:.*?\b(?=(\t)|(x))x)*', 'a\txa\tx').groups()
('\t', 'x')

Expected result: (None, 'x')

PHP 7.3.2   NULL, "x"
Java 11.0.2 "\t", "x"
Perl 5.28.1 "\t", "x"
Ruby 2.6.1  nil, "x"
Go 1.12 doesn't support lookaround
Rust 1.32.0 doesn't support lookaround
Node.js 10.15.1 undefined, "x"
regex 2019.2.21 None, "x"
re  "\t", "x"

This is a very rare bug, can be fixed by adding MARH_PUSH() before 
JUMP_MIN_REPEAT_ONE. And maybe other JUMPs should MARK_PUSH() as well.

I'm impressed with regex module, it never went wrong.
IMHO, I would like to see a pruned version be adopted into stdlib.

~~
> Interesting sidelights 1
> Found a Perl bug

I reported to Perl, it's a bug in perl-5.26, and already fixed in perl-5.28.0.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36124] Provide convenient C API for storing per-interpreter state

2019-03-04 Thread Petr Viktorin


Petr Viktorin  added the comment:

PyModule_GetState() gives you *per-module* state, not per-interpreter state.

Module objects are shared across subinterpreters, unless you use multi-phase 
initialization.

> PyModule_GetState() requires having the module object that corresponds
> to the given interpreter state.  I'm not sure how a C extension module
> is supposed to get its own module object corresponding to the current
> interpreter state, without getting it from the caller in some way.

This is the problem described in PEP 573: you don't always have access to your 
own module object. That keeps some more complex modules from switching to 
multi-phase init.

Unless this issue can wait for when PEP 580, PEP 573, and possibly some fallout 
of unknown unknowns are solved, let's add PyInterpreterState_GetDict for now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36124] Provide convenient C API for storing per-interpreter state

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn: WithProcessesTestSharedMemory dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Example of crash:

* Thread 2 exit Python: 
PyRun_SimpleStringFlags->PyErr_PrintEx->handle_system_exit->Py_Exit->OPENSSL_cleanup...
* Thread 1 tries to acquire the GIL to close a file
* Thread 3 is waiting in socket.socket.accept()

Problem: PyThreadState of Thread 1 is corrupted: its memory has been freed.



Thread 1 got the crash

(gdb) p tstate
$2 = (PyThreadState *) 0x8027e2050
(gdb) p *tstate
$3 = {
  prev = 0xdbdbdbdbdbdbdbdb,
  next = 0xdbdbdbdbdbdbdbdb,
  interp = 0xdbdbdbdbdbdbdbdb,
  ...
}

(gdb) p _PyRuntime.gilstate.tstate_current
$4 = {
  _value = 0
}



(gdb) thread apply all where

Thread 3 (LWP 100714):
#0  _accept4 () at _accept4.S:3
#1  0x000800679eaa in __thr_accept4 (s=5, addr=0x7fffdfff45f8, 
addrlen=0x7fffdfff45f0, flags=268435456) at 
/usr/src/lib/libthr/thread/thr_syscalls.c:126
#2  0x0008016f9b55 in sock_accept_impl (s=0x801bda050, data=0x7fffdfff45c0) 
at /usr/home/vstinner/prog/python/master/Modules/socketmodule.c:2592
#3  0x0008016fa1ec in sock_call_ex (s=0x801bda050, writing=0, 
sock_func=0x8016f9b00 , data=0x7fffdfff45c0, connect=0, 
err=0x0, timeout=-10) at 
/usr/home/vstinner/prog/python/master/Modules/socketmodule.c:886
#4  0x0008016f9aef in sock_call (s=0x801bda050, writing=0, func=0x8016f9b00 
, data=0x7fffdfff45c0) at 
/usr/home/vstinner/prog/python/master/Modules/socketmodule.c:938
#5  0x0008016f70e3 in sock_accept (s=0x801bda050, _unused_ignored=0x0) at 
/usr/home/vstinner/prog/python/master/Modules/socketmodule.c:2634
#6  0x0035415c in _PyMethodDef_RawFastCallKeywords (method=0x801701b70 
, self=, args=0x8027a01f8, nargs=0, 
kwnames=0x0) at Objects/call.c:631
#7  0x004d3841 in _PyMethodDescr_FastCallKeywords 
(descrobj=, args=0x8027a01f0, nargs=1, 
kwnames=0x0) at Objects/descrobject.c:290
#8  0x0037e20e in call_function (pp_stack=0x7fffdfff4cb8, oparg=1, 
kwnames=0x0) at Python/ceval.c:4698
#9  0x00378dec in _PyEval_EvalFrameDefault (f=Frame 0x8027a0050, for 
file /usr/home/vstinner/prog/python/master/Lib/socket.py, line 212, in accept 
(), throwflag=0) at Python/ceval.c:3280
#10 0x00369595 in PyEval_EvalFrameEx (f=Frame 0x8027a0050, for file 
/usr/home/vstinner/prog/python/master/Lib/socket.py, line 212, in accept (), 
throwflag=0) at Python/ceval.c:624
...
#53 0x00080066 in thread_start (curthread=0x80265a300) at 
/usr/src/lib/libthr/thread/thr_create.c:292

Thread 2 (LWP 100120):
#0  0x00080076e981 in __je_tcache_event_hard (tsd=0x8005ec090, 
tcache=0x8005ec250) at jemalloc_tcache.c:54
#1  0x0008007b05e3 in tcache_event (tsd=, tcache=) at /usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h:37
#2  tcache_dalloc_small (tsd=, tcache=, 
ptr=, binind=, slow_path=false) at 
/usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h:185
#3  arena_dalloc (tcache=, slow_path=false, tsdn=, ptr=, alloc_ctx=) at 
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:224
#4  idalloctm (slow_path=false, tsdn=, ptr=, 
tcache=, alloc_ctx=, is_internal=) 
at 
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h:118
#5  ifree (tsd=, ptr=, tcache=, 
slow_path=false) at jemalloc_jemalloc.c:2226
#6  __free (ptr=) at jemalloc_jemalloc.c:2397
#7  0x000801fabbd4 in OPENSSL_LH_free (lh=0x801b6c0c0) at 
/usr/src/crypto/openssl/crypto/lhash/lhash.c:88
#8  0x000801f2d6ac in lh_ERR_STRING_DATA_free (lh=) at 
/usr/src/crypto/openssl/include/openssl/err.h:217
#9  err_cleanup () at /usr/src/crypto/openssl/crypto/err/err.c:289
#10 0x000801fde3a7 in OPENSSL_cleanup () at 
/usr/src/crypto/openssl/crypto/init.c:569
#11 0x00080082a0c5 in __cxa_finalize (dso=0x0) at 
/usr/src/lib/libc/stdlib/atexit.c:239
#12 0x0008007b9cc1 in exit (status=0) at /usr/src/lib/libc/stdlib/exit.c:74
#13 0x0045c6e8 in Py_Exit (sts=0) at Python/pylifecycle.c:2166
#14 0x0041c403 in handle_system_exit () at Python/pythonrun.c:641
#15 0x0041bf86 in PyErr_PrintEx (set_sys_last_vars=1) at 
Python/pythonrun.c:651
#16 0x0041b20e in PyErr_Print () at Python/pythonrun.c:547
#17 0x0041be48 in PyRun_SimpleStringFlags (command=0x80134b460 "from 
multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=6, 
pipe_handle=9)\n", flags=0x7fffe7f0) at Python/pythonrun.c:462
#18 0x002cb691 in pymain_run_command (command=0x800acd910 L"from 
multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=6, 
pipe_handle=9)\n", cf=0x7fffe7f0) at Modules/main.c:527
#19 0x002cadb5 in pymain_run_python (interp=0x800b08010, 
exitcode=0x7fffe8cc) at Modules/main.c:804
#20 0x002ca6ba in pymain_main (args=0x7fffe928) at 
Modules/main.c:896
#21 0x002ca788 in _Py_UnixMain (argc=4, argv=0x7fffe9e8) at 
Modules/main.c:937
#22 0x002c9372 in main (argc=4, argv=0x7fffe9e8) at 
./Programs/python.c:16

Thread 1 (LWP 100696):
#0  0x00368

[issue36180] mboxMessage.get_payload throws TypeError on malformed content type

2019-03-04 Thread Enrico Zini


New submission from Enrico Zini :

This simple code:

```
import mailbox

mbox = mailbox.mbox("broken.mbox")
for msg in mbox:
msg.get_payload()
```

Fails rather unexpectedly:

```
$ python3 broken.py 
Traceback (most recent call last):
  File "broken.py", line 5, in 
msg.get_payload()
  File "/usr/lib/python3.7/email/message.py", line 267, in get_payload
payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace')
TypeError: decode() argument 1 must be str, not tuple
```

(I'm attaching a zip with code and mailbox)

I would have expected either that the part past text/plain is ignored if it 
doesn't make sense, or that content-type is completely ignored.

I have to process a large mailbox archive, and this is currently how I had to 
work around this issue, and it's causing me to have to skip email content which 
would otherwise be reasonably accessible:

https://salsa.debian.org/nm-team/echelon/commit/617ce935a31f6256257ffb24e11a5666306406c3

--
files: broken.zip
messages: 337091
nosy: enrico
priority: normal
severity: normal
status: open
title: mboxMessage.get_payload throws TypeError on malformed content type
Added file: https://bugs.python.org/file48184/broken.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36180] mboxMessage.get_payload throws TypeError on malformed content type

2019-03-04 Thread Mattia Rizzolo


Change by Mattia Rizzolo :


--
nosy: +mapreri

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn: WithProcessesTestSharedMemory dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Sometimes, I can reproduce the crash using:
./python -m test --matchfile=bisect5 test_multiprocessing_spawn 
--fail-env-changed -F

Using this file:

test.test_multiprocessing_spawn.WithThreadsTestQueue.test_timeout
test.test_multiprocessing_spawn.WithProcessesTestBarrier.test_default_timeout
test.test_multiprocessing_spawn.WithThreadsTestManagerRestart.test_rapid_restart
test.test_multiprocessing_spawn.WithProcessesTestPool.test_release_task_refs
test.test_multiprocessing_spawn.WithManagerTestLock.test_rlock

It seems like the following test is enough to creates a coredump:

test.test_multiprocessing_spawn.WithThreadsTestManagerRestart.test_rapid_restart

Problem: it's really hard to write a *reliable* script/method to trigger the 
crash. This race condition is very well hidden!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_spawn: WithProcessesTestSharedMemory dumps core in 
AMD64 FreeBSD CURRENT Shared 3.x -> test_multiprocessing_spawn dumps core in 
AMD64 FreeBSD CURRENT Shared 3.x

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36180] mboxMessage.get_payload throws TypeError on malformed content type

2019-03-04 Thread SilentGhost


Change by SilentGhost :


--
components: +email
nosy: +barry, r.david.murray
stage:  -> test needed
type:  -> behavior
versions: +Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Currently guilty:

commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465
Author: Eric Snow 
Date:   Sun Feb 24 15:40:47 2019 -0800

bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). 
(GH-11617)

This involves moving the global "pending calls" state to PyInterpreterState.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36144] Dictionary addition.

2019-03-04 Thread Viktor Kharkovets


Viktor Kharkovets  added the comment:

If we're going to forget about commutativity of +, should we also implement 
+/+= for sets?

--
nosy: +slam

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36114] test_multiprocessing_spawn dumps core in AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, I confirm that the commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 
introduced a regression in 
test.test_multiprocessing_spawn.WithThreadsTestManagerRestart.test_rapid_restart.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

The commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 introduced a regression in 
test.test_multiprocessing_spawn.WithThreadsTestManagerRestart.test_rapid_restart:
 bpo-36114.

Would it be possible to revert it until the bug is properly understood and 
fixed?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +cstratak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Vinay Rao


New submission from Vinay Rao :

- Default should be 'w' for compatibility.

- There should be a check that makes sure mode is either 'w' or 'a', or else 
raise ValueError.

--
components: Library (Lib)
messages: 337097
nosy: vinayluzrao
priority: normal
severity: normal
status: open
title: Add mode parameter to PurePath.write_text to allow for 'a' mode
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

append_text helper was proposed as part of issue35095 and adding a parameter 
append was also discussed as part of the original API issue20218 . Adding 
@pitrou to decide upon the API.

--
nosy: +pitrou, xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12157

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Not that it makes a big difference, but write_text is a method of the Path 
class, not PurePath.

--
nosy: +lys.nikolaou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

Hi,

in the pathlib.Path.write_bytes() documentation it is clearly stated that "An 
existing file of the same name is overwritten." Wouldn't it make sense to 
include something similar to the pathlib.Path.write_text() docs. I had to 
quickly test it manually to find out what's happening as it wasn't clear to me 
if the statement applies to write_text() as well.

--
assignee: docs@python
components: Documentation
messages: 337100
nosy: docs@python, lys.nikolaou
priority: normal
severity: normal
status: open
title: Path.write_text() docs do not include the case that a file exists
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

For reference, 
https://docs.python.org/3/library/pathlib.html#pathlib.Path.write_bytes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Vinay Rao


Vinay Rao  added the comment:

Upon reading the issue threads linked by @xtreak, I have changed my mind and 
think this is a bad idea.
1) It adds more to maintain without offering much benefit (the use case of the 
shortcut is probably quite rare)
2) The argument 'mode' only accepting two options is probably a bit 
unintuitive, considering it typically accepts many others in other ocurrences 
of this type of functionality.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Vinay Rao


Vinay Rao  added the comment:

Oh, and write_bytes would have to go thorough the same modification to make 
them consistent.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20906] Issues in Unicode HOWTO

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 84fa6b9e5932af981cb299c0c5ac80b9cc37c3fa by Miss Islington (bot) 
in branch '3.7':
bpo-20906: Various revisions to the Unicode howto  (GH-8394)
https://github.com/python/cpython/commit/84fa6b9e5932af981cb299c0c5ac80b9cc37c3fa


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34484] Unicode HOWTO incorrectly refers to Private Use Area for surrogateescape

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 84fa6b9e5932af981cb299c0c5ac80b9cc37c3fa by Miss Islington (bot) 
in branch '3.7':
bpo-20906: Various revisions to the Unicode howto  (GH-8394)
https://github.com/python/cpython/commit/84fa6b9e5932af981cb299c0c5ac80b9cc37c3fa


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Inada Naoki


Inada Naoki  added the comment:

It may be removed accidentally by this commit.

https://github.com/python/cpython/commit/8477ed60486a22f79f257ee49f0bc18d0e73f216#diff-56cd2f82cd518e7baf1edab64771f619

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36144] Dictionary addition.

2019-03-04 Thread Stefan Behnel


Stefan Behnel  added the comment:

> should we also implement +/+= for sets?

The question is: what would that do? The same as '|=' ? That would be rather 
confusing, I think. "|" (meaning: "or") seems a very natural operation for 
sets, in the same way that "|" operates on bits in integers. That suggests that 
"|" is the right operator for sets.

In any case, this is an unrelated proposal that is better not discussed in this 
ticket. The only link is whether "|" is the more appropriate operator also for 
dicts, which is to be discussed in the PEP and thus also not in this ticket.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I was searching along similar lines since this was present as part of the 
original commit : https://hg.python.org/cpython/rev/a4da150fbfd4 . I guess it 
makes sense to restore the text.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36177] test_io: test_daemon_threads_shutdown_stdout_deadlock() fails on x86 Windows7 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like the test started to fail in this build (at Feb 25):
https://buildbot.python.org/all/#/builders/58/builds/1977

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

> The commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 introduced a regression 
> in 
> test.test_multiprocessing_spawn.WithThreadsTestManagerRestart.test_rapid_restart:
>  bpo-36114.

There is a very similar bug on Windows: bpo-36116.

I'm now also quite confident that bpo-36177 is also a regression caused by this 
issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36177] test_io: test_daemon_threads_shutdown_stdout_deadlock() fails on x86 Windows7 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like this issue is a regression caused by bpo-33608.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I'll submit a PR shortly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23689] Memory leak in Modules/sre_lib.h

2019-03-04 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +12158

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23689] Memory leak in Modules/sre_lib.h

2019-03-04 Thread Ma Lin

Ma Lin  added the comment:

PR11926 (closed) tried to allocate SRE_REPEAT on state's stack.
It's feasible, but messes up the code in sre_lib.h, and reduces performance a 
little (roughly 6% slower), so I gave up this solution.

PR12160 uses a memory pool, this solution doesn't mess up the code.

🔸For infrequent alloc/free scenes, it adds a small overhead:

s = 'a'
p = re.compile(r'(a)?')
p.match(s)  # <- measure this statement

before patch: 316 ns  +- 19 ns
after patch:  324 ns  +- 11 ns, 2.5% slower.
(by perf module)

🔸For very frequent alloc/free scenes, it brings a speedup:

s = 200_000_000 * 'a'
p = re.compile(r'.*?(?:bb)+')
p.match(s)  # <- measure this statement

before patch: 7.16 sec
after patch:  5.82 sec, 18.7% faster.
(best of 10 tests)

🔸I tested in a real case that use 17 patterns to process 100MB data:

before patch: 27.09 sec
after patch:  26.78 sec, 1.1% faster.
(best of 4 tests)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36097] Use only public C-API in _xxsubinterpreters module.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4d61e6e3b802399be62a521d6fa785698cb670b5 by Victor Stinner in 
branch 'master':
Revert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). 
(GH-11617) (GH-12159)
https://github.com/python/cpython/commit/4d61e6e3b802399be62a521d6fa785698cb670b5


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Hi Eric, I'm sorry but I had to revert your recent work. It introduced 
regressions in at least in test_io and test_multiprocessing_spawn on Windows 
and FreeBSD. I simply don't have the bandwidth to investigate this regression 
yet, whereas we really need the CI to remain stable to catch other regressions 
(the master branch received multiple new features recently, and there are some 
other regressions by that way ;-)).

test_multiprocessing_spawn is *very* hard to reproduce on FreeBSD, but I can 
reliably reproduce it. It just takes time. The issue is a crash producing a 
coredump. I consider that the bug is important enough to justify a revert.

The revert is an opportunity to seat down and track the root cause rather than 
urging to push a "temporary" quickfix. This bug seems to be very deep in the 
Python internals: thread state during Python shutdown. So it will take time to 
fully understand it and fix it (or redesign your recent changes, I don't know).

Tell me if you need my help to reproduce the bug. The bug has been seen on 
FreeBSD but also Windows:

* test_multiprocessing_spawn started to produce coredumps on FreeBSD: 
https://bugs.python.org/issue36114
* test_multiprocessing_spawn started to fail randomly on Windows: 
https://bugs.python.org/issue36116
* test_io started to fail randomly on Windows: 
https://bugs.python.org/issue36177

-- The Night's Watch

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4d61e6e3b802399be62a521d6fa785698cb670b5 by Victor Stinner in 
branch 'master':
Revert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). 
(GH-11617) (GH-12159)
https://github.com/python/cpython/commit/4d61e6e3b802399be62a521d6fa785698cb670b5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-03-04 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
keywords: +patch
pull_requests: +12159
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

For curious people, Pablo Galindo spent a few hours to investigate 
https://bugs.python.org/issue36114 and I spent a few more hours to finish the 
analysis. The bug indirectly crashed my laptop :-)
https://twitter.com/VictorStinner/status/1102528982036201478

That's what I mean by "I don't have the bandwidth": we already spent hours to 
identify the regression ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35859] Capture behavior depends on the order of an alternation

2019-03-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your great work Ma Lin! But it will take a time to make a review 
of it.

Could you please create and run some microbenchmarks to measure possible 
performance penalty of additional MARH_PUSHes? I am especially interesting in 
worst cases. If the penalty is significant, it will be a goal of future 
optimizations. If it is unsignificant, we will not be bothered about this.

I am not sure about backporting these changes. This behavior is such old, that 
there is a chance to break someone's code that depend on it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36181] Add mode parameter to PurePath.write_text to allow for 'a' mode

2019-03-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36158] Regex search behaves differently in list comprehension

2019-03-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed

2019-03-04 Thread STINNER Victor


New submission from STINNER Victor :

test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed.

Can it be related to my revert, commit 4d61e6e3b802399be62a521d6fa785698cb670b5?

https://buildbot.python.org/all/#/builders/168/builds/676

FAIL: test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
FAIL: test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
FAIL: test_dicts (test.test_gdb.PrettyPrintTests)
FAIL: test_exceptions (test.test_gdb.PrettyPrintTests)
FAIL: test_frames (test.test_gdb.PrettyPrintTests)
FAIL: test_frozensets (test.test_gdb.PrettyPrintTests)
FAIL: test_getting_backtrace (test.test_gdb.PrettyPrintTests)
FAIL: test_int (test.test_gdb.PrettyPrintTests)
FAIL: test_lists (test.test_gdb.PrettyPrintTests)
FAIL: test_modern_class (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_list (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests)
FAIL: test_sets (test.test_gdb.PrettyPrintTests)
FAIL: test_singletons (test.test_gdb.PrettyPrintTests)
FAIL: test_strings (test.test_gdb.PrettyPrintTests)
FAIL: test_subclassing_list (test.test_gdb.PrettyPrintTests)
FAIL: test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
FAIL: test_truncation (test.test_gdb.PrettyPrintTests)
FAIL: test_tuples (test.test_gdb.PrettyPrintTests)
FAIL: test_basic_command (test.test_gdb.PyListTests)
FAIL: test_one_abs_arg (test.test_gdb.PyListTests)
FAIL: test_two_abs_args (test.test_gdb.PyListTests)
FAIL: test_down_at_bottom (test.test_gdb.StackNavigationTests)
FAIL: test_pyup_command (test.test_gdb.StackNavigationTests)
FAIL: test_up_at_top (test.test_gdb.StackNavigationTests)
FAIL: test_up_then_down (test.test_gdb.StackNavigationTests)
FAIL: test_bt (test.test_gdb.PyBtTests)
FAIL: test_bt_full (test.test_gdb.PyBtTests)
FAIL: test_gc (test.test_gdb.PyBtTests)
FAIL: test_pycfunction (test.test_gdb.PyBtTests)
FAIL: test_threads (test.test_gdb.PyBtTests)
FAIL: test_wrapper_call (test.test_gdb.PyBtTests)
FAIL: test_basic_command (test.test_gdb.PyPrintTests)
FAIL: test_print_after_up (test.test_gdb.PyPrintTests)
FAIL: test_printing_builtin (test.test_gdb.PyPrintTests)
FAIL: test_printing_global (test.test_gdb.PyPrintTests)
FAIL: test_basic_command (test.test_gdb.PyLocalsTests)
FAIL: test_locals_after_up (test.test_gdb.PyLocalsTests)

Example:

==
FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py",
 line 533, in test_NULL_ob_type
self.assertSane('id(42)',
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py",
 line 504, in assertSane
self.get_gdb_repr(source,
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py",
 line 269, in get_gdb_repr
gdb_output = self.get_stack_trace(source, breakpoint=BREAKPOINT_FN,
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py",
 line 249, in get_stack_trace
self.assertEqual(unexpected_errlines, [])
AssertionError: Lists differ: ['Error: ', 'During startup program exited[62 
chars]ck.'] != []

First list contains 4 additional elements.
First extra element 0:
'Error: '

+ []
- ['Error: ',
-  'During startup program exited with code 127.',
-  'No symbol "v" in current context.',
-  'No stack.']

--
components: Tests
messages: 337119
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2019-03-04 Thread STINNER Victor


New submission from STINNER Victor :

On my FreeBSD VM, _POSIX_THREADS is not defined:

sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', version=None)

test_gdb fails with:

Verify that "py-bt" indicates threads that are waiting for the GIL ... FAIL

==
FAIL: test_threads (test.test_gdb.PyBtTests)
Verify that "py-bt" indicates threads that are waiting for the GIL
--
Traceback (most recent call last):
  File "/usr/home/vstinner/prog/python/master/Lib/test/test_gdb.py", line 826, 
in test_threads
self.assertIn('Waiting for the GIL', gdb_output)
AssertionError: 'Waiting for the GIL' not found in 'Breakpoint 1 at 0x49e5d0: 
file Python/bltinmodule.c, line 1203.\n[New LWP 100742 of process 68315]\n[New 
LWP 100749 of process 68315]\n[New LWP 100751 of process 68315]\n[New LWP 
100766 of process 68315]\n\nThread 1 hit Breakpoint 1, builtin_id (self=, v=42) 
at Python/bltinmodule.c:1203\n1203\treturn PyLong_FromVoidPtr(v);\n\nThread 
5 (LWP 100766 of process 68315):\nTraceback (most recent call first):\n  File 
"", line 10, in run\n  File 
"/usr/home/vstinner/prog/python/master/Lib/threading.py", line 917, in 
_bootstrap_inner\nself.run()\n  File 
"/usr/home/vstinner/prog/python/master/Lib/threading.py", line 885, in 
_bootstrap\nself._bootstrap_inner()\n\nThread 4 (LWP 100751 of process 
68315):\nTraceback (most recent call first):\n  File "", line 10, in 
run\n  File "/usr/home/vstinner/prog/python/master/Lib/threading.py", line 917, 
in _bootstrap_inner\nself.run()\n  File "/usr/home/vstinner/prog/python/ma
 ster/Lib/threading.py", line 885, in _bootstrap\n
self._bootstrap_inner()\n\nThread 3 (LWP 100749 of process 68315):\nTraceback 
(most recent call first):\n  File "", line 10, in run\n  File 
"/usr/home/vstinner/prog/python/master/Lib/threading.py", line 917, in 
_bootstrap_inner\nself.run()\n  File 
"/usr/home/vstinner/prog/python/master/Lib/threading.py", line 885, in 
_bootstrap\nself._bootstrap_inner()\n\nThread 2 (LWP 100742 of process 
68315):\nTraceback (most recent call first):\n  File "", line 10, in 
run\n  File "/usr/home/vstinner/prog/python/master/Lib/threading.py", line 917, 
in _bootstrap_inner\nself.run()\n  File 
"/usr/home/vstinner/prog/python/master/Lib/threading.py", line 885, in 
_bootstrap\nself._bootstrap_inner()\n\nThread 1 (LWP 100559 of process 
68315):\nTraceback (most recent call first):\n  \n  File "", line 18, in \n'


=> 'Waiting for the GIL' cannot be found in the output, because python-gdb.py 
failed to detect that a threading is waiting for the GIL.


The problem can be found in Tools/gdb/libpython.py:

def is_waiting_for_gil(self):
'''Is this frame waiting on the GIL?'''
# This assumes the _POSIX_THREADS version of Python/ceval_gil.h:
name = self._gdbframe.name()
if name:
return 'pthread_cond_timedwait' in name

pthread_cond_timedwait() is too close to POSIX threads. We can make this 
function more portable by checking for 'take_gil' function instead.

--
components: Library (Lib)
messages: 337120
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +easy
title: test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD 
-> [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

> https://buildbot.python.org/all/#/builders/168/builds/676

Extract of pythoninfo:

gdb_version: GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', version=None)

I'm unable to reproduce the issue on my FreeBSD 12 VM. But on my VM... I get a 
different issue: bpo-36184 "test_gdb.test_threads() is specific to 
_POSIX_THREADS, fail on FreeBSD".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36185] [EASY DOC] typo: Doc/c-api/objbuffer.rst: There is a typo in "corresponding"

2019-03-04 Thread STINNER Victor


New submission from STINNER Victor :

Issue reported at:
https://github.com/python/cpython/pull/9/files/650ed79e9dcd6f12b2cd0adcc9d6e3fd1ea929d0#diff-dec96ce8ae89cc364fa198f94357a1ab

> There is a typo in "corresponding"

Does someone want to write a PR?

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 337122
nosy: docs@python, vstinner
priority: normal
severity: normal
status: open
title: [EASY DOC] typo: Doc/c-api/objbuffer.rst:  There is a typo in 
"corresponding"
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35198] Build issue while compiling cpp files in AIX

2019-03-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12160

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35198] Build issue while compiling cpp files in AIX

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 800d5cd75025876d79ab05980925a05d8e36b63d by Victor Stinner (Kevin 
Adler) in branch 'master':
bpo-35198 Fix C++ extension compilation on AIX (GH-10437)
https://github.com/python/cpython/commit/800d5cd75025876d79ab05980925a05d8e36b63d


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20906] Issues in Unicode HOWTO

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

I see a change, so I guess that this old issue can now be fixed. Anything, the 
issue didn't get much activity last years.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Interesting code in test_ssl.py:

except (ConnectionResetError, BrokenPipeError) as e:
# We treat ConnectionResetError as though it were an
# SSLError - OpenSSL on Ubuntu abruptly closes the
# connection when asked to use an unsupported protocol.
#
# BrokenPipeError is raised in TLS 1.3 mode, when OpenSSL
# tries to send session tickets after handshake.
# https://github.com/openssl/openssl/issues/6342
self.server.conn_errors.append(str(e))
if self.server.chatty:
handle_error("\n server:  bad connection attempt from " + 
repr(self.addr) + ":\n")
self.running = False
self.close()
return False

and

except ConnectionResetError:
# XXX: OpenSSL 1.1.1 sometimes raises ConnectionResetError
# when connection is not shut down gracefully.
if self.server.chatty and support.verbose:
sys.stdout.write(
" Connection reset by peer: {}\n".format(
self.addr)
)
self.close()
self.running = False


Interesting commit:

commit 529525fb5a8fd9b96ab4021311a598c77588b918
Author: Christian Heimes 
Date:   Wed May 23 22:24:45 2018 +0200

bpo-33618: Enable TLS 1.3 in tests (GH-7079)

TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS
client cert auth are now handled after the initialy handshake. Tests now
either send/recv data to trigger session and client certs. Or tests
ignore ConnectionResetError / BrokenPipeError on the server side to
handle clients that force-close the socket fd.

To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR
https://github.com/openssl/openssl/pull/6340) is required.

Signed-off-by: Christian Heimes 

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

I tested gdb on the buildbot and I got permission errors, at least under my 
user "haypo":

warning: Could not trace the inferior process.
Error: 
warning: ptrace: Operation not permitted


Logs:

CURRENT-amd64% gdb -args ./python Lib/test/gdb_sample.py
GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
(...)
warning: File "/usr/home/haypo/cpython/python-gdb.py" auto-loading has been 
declined by your `auto-load safe-path' set to 
"$debugdir:$datadir/auto-load:~/prog/".
To enable execution of this file add
add-auto-load-safe-path /usr/home/haypo/cpython/python-gdb.py
line to your configuration file "/home/haypo/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/haypo/.gdbinit".

(...)

(gdb) b builtin_id
Breakpoint 1 at 0x451264: file Python/bltinmodule.c, line 1203.

(gdb) run
Starting program: /usr/home/haypo/cpython/python Lib/test/gdb_sample.py
warning: Could not trace the inferior process.
Error: 
warning: ptrace: Operation not permitted

--
nosy: +koobs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

On my FreeBSD 12.0 VM, "py-bt" works as expected. It might be a recent change 
in FreeBSD CURRENT kernel?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35198] Build issue while compiling cpp files in AIX

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 06e9953d5e3f0144ec8247b61541e7be85d55b50 by Miss Islington (bot) 
in branch '3.7':
bpo-35198 Fix C++ extension compilation on AIX (GH-10437)
https://github.com/python/cpython/commit/06e9953d5e3f0144ec8247b61541e7be85d55b50


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36185] [EASY DOC] typo: Doc/c-api/objbuffer.rst: There is a typo in "corresponding"

2019-03-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Shouldn't this be kept for the documentation sprint?

--
nosy: +cheryl.sabella, remi.lapeyre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35198] Build issue while compiling cpp files in AIX

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Kevin Adler.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x

2019-03-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed -> test_gdb 
failed on AMD64 FreeBSD CURRENT Shared 3.x

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36186] [2.7] Coverity scan: Modules/linuxaudiodev.c , fd handle is not closed.

2019-03-04 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

There are two places [0][1] in the code where NULL is returned but the fd 
handle is not closed.

[0] https://github.com/python/cpython/blob/2.7/Modules/linuxaudiodev.c#L129
[1] https://github.com/python/cpython/blob/2.7/Modules/linuxaudiodev.c#L133

--
components: Extension Modules
messages: 337131
nosy: cstratak
priority: normal
severity: normal
status: open
title: [2.7] Coverity scan: Modules/linuxaudiodev.c , fd handle is not closed.
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13096] ctypes: segfault with large POINTER type names

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 710dcfd2f4bee034894a39026388f9c21ea976f1 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-13096: Fix memory leak in ctypes POINTER handling of large values 
(GH-12100)
https://github.com/python/cpython/commit/710dcfd2f4bee034894a39026388f9c21ea976f1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36186] [2.7] Coverity scan: Modules/linuxaudiodev.c , fd handle is not closed.

2019-03-04 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12161
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset b7bc283ab6a23ee98784400ebffe7fe410232a2e by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-36179: Fix ref leaks in _hashopenssl (GH-12158)
https://github.com/python/cpython/commit/b7bc283ab6a23ee98784400ebffe7fe410232a2e


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12162

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36183] test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.7 and 3.x

2019-03-04 Thread STINNER Victor


STINNER Victor  added the comment:

Same errors on AMD64 FreeBSD CURRENT Shared 3.7:
https://buildbot.python.org/all/#/builders/173/builds/333

--
title: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x -> test_gdb failed 
on AMD64 FreeBSD CURRENT Shared 3.7 and 3.x

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31861] add aiter() and anext() functions to operator module

2019-03-04 Thread Joshua Bronson


Joshua Bronson  added the comment:

If the deciders prefer to have these in the operator module for 3.8 (as Yury 
and Jelle requested above), my PR from a few months ago which implements this 
(https://github.com/python/cpython/pull/8895) can still be merged with no 
conflicts. I don't think any other changes to that patch are requested before 
it can be merged (i.e. it's only stalled on the decision whether to add these 
to builtins or operator), but I can still make time to address any new 
requested code changes if these are to go in operator.

If these are to go in builtins instead, @nanjekyejoannah has volunteered to 
pick that up. So it seems like this can move forward one way or the other once 
we have a decision on operator vs. builtins.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31861] add aiter() and anext() functions to operator module

2019-03-04 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +12163

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +12164

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36187] Get rid of NamedStore

2019-03-04 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR refactors the code for assignment expression and removes the 
NamedStore value of the expr_context_ty enum added in issue35224. This value is 
undistinguished from Store except two places in Python/ast.c and 
Python/symtable.c, but in that cases the difference can be handled at one level 
upper (when process the NamedExpr expression).

As a side effect this PR fixes the following minor bug:

>>> (True := 1)
  File "", line 1
SyntaxError: cannot delete True

--
components: Interpreter Core
messages: 337136
nosy: emilyemorehouse, gvanrossum, serhiy.storchaka, tim.peters
priority: normal
severity: normal
status: open
title: Get rid of NamedStore
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36187] Get rid of NamedStore

2019-03-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +12165
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset a59d33a1b08bd3dc9dc2584d4360ca81b0f1ad49 by Miss Islington (bot) 
in branch '3.7':
bpo-36179: Fix ref leaks in _hashopenssl (GH-12158)
https://github.com/python/cpython/commit/a59d33a1b08bd3dc9dc2584d4360ca81b0f1ad49


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29167] Race condition in enum.py:_decompose()

2019-03-04 Thread Martin


Martin  added the comment:

Our production system hit this issue using Python 3.6.7 once a few days ago, so 
presumably the race is still possible with the applied patch, just less likely?

```
RuntimeError: dictionary changed size during iteration
at _decompose (/usr/lib/python3.6/enum.py:858)
at _create_pseudo_member_ (/usr/lib/python3.6/enum.py:773)
at _missing_ (/usr/lib/python3.6/enum.py:764)
at __new__ (/usr/lib/python3.6/enum.py:535)
at __call__ (/usr/lib/python3.6/enum.py:293)
at __or__ (/usr/lib/python3.6/enum.py:800)
at create_urllib3_context 
(/usr/local/lib/python3.6/dist-packages/urllib3/util/ssl_.py:279)
at connect (/usr/local/lib/python3.6/dist-packages/urllib3/connection.py:332)
at _validate_conn 
(/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:839)
at _make_request 
(/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:343)
at urlopen 
(/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:600)
at send (/usr/local/lib/python3.6/dist-packages/requests/adapters.py:449)
at send (/usr/local/lib/python3.6/dist-packages/requests/sessions.py:646)
at request (/usr/local/lib/python3.6/dist-packages/requests/sessions.py:533)
at __call__ 
(/usr/local/lib/python3.6/dist-packages/google/auth/transport/requests.py:120)
at _token_endpoint_request 
(/usr/local/lib/python3.6/dist-packages/google/oauth2/_client.py:106)
at jwt_grant 
(/usr/local/lib/python3.6/dist-packages/google/oauth2/_client.py:145)
at refresh 
(/usr/local/lib/python3.6/dist-packages/google/oauth2/service_account.py:322)
at before_request 
(/usr/local/lib/python3.6/dist-packages/google/auth/credentials.py:122)
at request 
(/usr/local/lib/python3.6/dist-packages/google/auth/transport/requests.py:198)
at wait_and_retry 
(/usr/local/lib/python3.6/dist-packages/google/resumable_media/_helpers.py:146)
at http_request 
(/usr/local/lib/python3.6/dist-packages/google/resumable_media/requests/_helpers.py:101)
at consume 
(/usr/local/lib/python3.6/dist-packages/google/resumable_media/requests/download.py:169)
at _do_download 
(/usr/local/lib/python3.6/dist-packages/google/cloud/storage/blob.py:498)
at download_to_file 
(/usr/local/lib/python3.6/dist-packages/google/cloud/storage/blob.py:560)
```

--
nosy: +gz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36085] Enable better DLL resolution

2019-03-04 Thread Steve Dower

Steve Dower  added the comment:

Adding Łukasz for his RM opinion on Win7 support for 3.8.

According to PEP 11, we've already dropped support for Win7 without Service 
Pack 1. Win7 SP1 would be dropped ~2-3 months after 3.8 releases, which means 
we still have to support it for all of 3.8.

My concern is the KB2533623 I mentioned in the original post, which adds the 
ability to control the search path properly. I *think* it might be already 
included in Win7 SP1, in which case we're fine (I'm confirming this with some 
colleagues), but if it's optional on top of SP1 then I want to make it required 
for Python.

Alternatively, I'm totally happy to make a three month exception to PEP 11 and 
just drop Win7 completely for 3.8. But I think that needs to be made official 
as early as possible, and should get python-dev exposure.

Łukasz - thoughts?

(Yes, I incorrectly typed the KB number at the top. Apparently I regularly fail 
to type numbers into bpo for some reason... doesn't happen elsewhere?)

--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36179] _hashopenssl has reference leaks in OOM case

2019-03-04 Thread miss-islington


miss-islington  added the comment:


New changeset 84b5ac9ba6fd71ba9d0ef98e2a166a35189b263f by Miss Islington (bot) 
(Christian Heimes) in branch '2.7':
[2.7] bpo-36179: Fix ref leaks in _hashopenssl (GH-12158) (GH-12166)
https://github.com/python/cpython/commit/84b5ac9ba6fd71ba9d0ef98e2a166a35189b263f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2019-03-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36158] Regex search behaves differently in list comprehension

2019-03-04 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Sounds like at least one such entity's trigger attribute doesn't match the 
regex. In the spelled out loop, you'd still get the exception on a failed 
match, but you'd store the results for however many entities matched before 
then (so catching the exception and continuing on would work). List 
comprehensions are all or nothing; if an exception is raised before it 
finishes, the list in progress is thrown away.

While wasteful, this should work just fine:

named_entities = [name_regex.match(entity.trigger).group(1) for entity in 
entities[0] if name_regex.match(entity.trigger)]

or in 3.8 with assignment expression to avoid repetitive work:

named_entities = [match.group(1) for entity in entities[0] if match := 
name_regex.match(entity.trigger)]

The former is wasteful, but works in any Python version; the latter is directly 
equivalent to:

named_entities = []
for entity in entities[0]:
match = name_regex.match(entity.trigger)
if match:
named_entities.append(match.group(1))

The ultimate problem is your regex isn't always matching; list comprehensions 
just change whether or no you store the partial results.

--
nosy: +josh.r
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36187] Get rid of NamedStore

2019-03-04 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2019-03-04 Thread Martijn Pieters


Change by Martijn Pieters :


--
pull_requests: +12166

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36188] Remove vestiges of Python 2 unbound methods from Python 3

2019-03-04 Thread Martijn Pieters


New submission from Martijn Pieters :

The implementation of method_hash, method_call and method_descr_get all still 
contain assumptions that __self__ can be set to None, a holdover from Python 2 
where methods could be *unbound*.

These vestiges can safely be removed, because method_new() and PyMethod_New() 
both ensure that self is always non-null.

In addition, the datamodel description of methods includes this section:

  When a user-defined method object is created by retrieving another method
  object from a class or instance, the behaviour is the same as for a
  function object, except that the :attr:`__func__` attribute of the new
  instance is not the original method object but its :attr:`__func__`
  attribute.

which also only applies to Python 2 unbound methods. Python 3 bound methods 
never change what they are bound to, let alone produce a new method object from 
__get__ that has to be careful about what __func__ is set to.

I'm submitting a PR that removes these vestiges, no need to maintain code that 
never runs.

--
components: Interpreter Core
messages: 337142
nosy: mjpieters
priority: normal
severity: normal
status: open
title: Remove vestiges of Python 2 unbound methods from Python 3
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36188] Remove vestiges of Python 2 unbound methods from Python 3

2019-03-04 Thread Martijn Pieters


Change by Martijn Pieters :


--
keywords: +patch
pull_requests: +12167
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36172] csv module internal consistency

2019-03-04 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Unless someone disagrees soon, I'm going to close this as documented 
behavior/not a bug. AFAICT, the only "fixes" available for this are:

1. Changing the default dialect from 'excel' to something else. Problem: Breaks 
correct code dependent on the excel dialect, but code could explicitly opt back 
in.

2. Change the 'excel' dialect. Problem: Breaks correct code dependent on the 
excel dialect, with no obvious way to opt back in.

3. Per #10954, check the file object to ensure it's not translating newlines 
and raise an exception otherwise. Problem: AFAICT, there is no documented API 
to check this (the result of calling open, with or without passing newline='', 
looks identical initially, never changes in write mode, and even in read mode, 
only exposes the newlines observed through the .newlines attribute, not whether 
or not they were translated), adding one wouldn't change all other file-like 
objects, so the change would need to propagate to all other built-in and 
third-party file APIs, and for some file-like objects, it wouldn't make sense 
to have this API at all (io.StringIO, being purely in memory, doesn't need to 
do translation of any kind)

4. (Extreme solution) Add io APIs (or add arguments to APIs) for 
reading/writing without newline translation (that is, whether or not newline is 
passed to open, you can read/write without translation), e.g. read(size) 
becomes read(size, translate_newlines=None) where None indicates default 
behavior, or we add read_untranslated(size) as an independent API. Problem: 
Like #3, this requires us to create new, mandatory APIs in the io module that 
would then need to propagate to all other built-in and third-party file APIs.

Point is, the simple solutions (1/2) break correct code, and the complex 
solutions (3/4) involve major changes to the io module (and all other file-like 
object producers) and/or the csv module.

Even then, nothing shy of #4 would make broken code just work, they just fail 
loudly. Both #3 and #4 would require cascading changes to every file-like 
object (both built-in and third-party) to make them work; for the file-like 
objects that aren't updated, we're stuck choosing between issuing a warning 
that most folks won't see, then ignoring the problem, or making those file-like 
objects without the necessary API cause true exceptions (making them unusable 
until the third party package is updated).

If a fix is needed, I think my suggestion would be to do one or both of:

1. Emphasize the newline='' warning in the 
csv.reader/writer/DictReader/DictWriter docs (right now it's just one more 
unemphasized line in a fairly long wall of text for each)

2. Put a large, top-of-module warning about this at the top of the csv module 
docs, so people reading the basic module description are exposed to the warning 
before they even reach the API.

Might help a few folks who are skimming without reading for detail.

--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36149] use of uninitialised memory in cPickle.

2019-03-04 Thread Thomas Wouters


Thomas Wouters  added the comment:


New changeset d9bf7f4198871132714cfe7d702baaa02206e9f1 by T. Wouters in branch 
'2.7':
[2.7] bpo-36149 Fix potential use of uninitialized memory in cPickle (#12105)
https://github.com/python/cpython/commit/d9bf7f4198871132714cfe7d702baaa02206e9f1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >