[issue39816] More descriptive error message than "too many values to unpack"

2020-03-16 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +18387
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19036

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-03-16 Thread Ned Deily

Ned Deily  added the comment:

There is nothing more for you to do for this on the Mac side right now, thanks. 
 I’m not sure what the Status of changes for Windows build are.  Perhaps that 
should be a separate issue as the two aren’t really related.

--

___
Python tracker 

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



[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-16 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-16 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
nosy: +phsilva

___
Python tracker 

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



[issue5944] test_os failure on OS X, probably related to PEP 383

2020-03-16 Thread Matthias Braun


Matthias Braun  added the comment:

I believe my suggested pull request in https://bugs.python.org/issue39986 may 
solve this issue as a side effect because we no longer list the root directory 
but a temporary directory with controlled filenames.

--
nosy: +Matthias Braun

___
Python tracker 

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



[issue38454] test_listdir is failing on ubuntu with WSL

2020-03-16 Thread Matthias Braun


Matthias Braun  added the comment:

I believe my suggested pull request in https://bugs.python.org/issue39986 may 
solve this issue as a side effect because we no longer list the root directory 
but a temporary directory with controlled filenames.

--
nosy: +Matthias Braun

___
Python tracker 

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



[issue39986] test_os / test_listdir failed as root-directory changed during test

2020-03-16 Thread Matthias Braun


Change by Matthias Braun :


--
keywords: +patch
pull_requests: +18386
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19035

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-03-16 Thread Larry Hastings


Larry Hastings  added the comment:

> We should do that for each singletons:
> 
> * None (Py_None)
> * True (Py_True)
> * False (Py_False)
> * Ellipsis (Py_Ellipsis)

Aren't there a couple more lurking in the interpreter?  E.g. empty tuple, empty 
frozenset.


> That is exactly why I didn't propose a change to them.
> The singletons still are refcounted as usual,
> just that their ob_refcnt is ignored.
> If they somehow reach 0, they just "resurrect" themselves
> and ignore the regular collection behavior.

That seems like a very good idea!  They don't even need to "resurrect" 
themselves--we just ensure tp_dealloc is a no-op for those special values.  If 
we do that, different threads and different interpreters can change ob_refcnt 
willy-nilly, there can be unsafe races between threads, the value could no 
longer make any sense--but as long as we never free the object, it's all 
totally fine.

(Actually: tp_dealloc shouldn't be a no-op--it should add a million to the 
reference count for these special objects, to forestall future irrelevant calls 
to tp_dealloc.)

This might have minor deleterious effects, e.g. sys.getrefcount() would return 
misleading results for such objects.  I think that's acceptable.

--
nosy: +larry

___
Python tracker 

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



[issue39986] test_os / test_listdir failed as root-directory changed during test

2020-03-16 Thread Matthias Braun


New submission from Matthias Braun :

The test_listdir test from Lib/test/test_os.py is using os.listdir() twice in 
the root directory with and without parameters and compares the results. I just 
had the test fail for me, because an unrelated process happened to create a 
file in the root directory between the two invocations of os.listdir. In my 
case it was rsyslog creating '/imjournal.state.tmp', but the problem is a 
general one.

The test failed with:
```
   ..test test_os failed -- Traceback (most recent call last):
  File "/home/matthiasb/dev/fbcpython/Lib/test/test_os.py", line 1914, in 
test_listdir
self.assertEqual(set(os.listdir()), set(os.listdir(os.sep)))
AssertionError: Items in the first set but not the second:
'imjournal.state.tmp'
```

--
components: Tests
messages: 364383
nosy: Matthias Braun
priority: normal
severity: normal
status: open
title: test_os / test_listdir failed as root-directory changed during test
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



[issue39974] A race condition with GIL releasing exists in stringlib_bytes_join

2020-03-16 Thread Inada Naoki


Change by Inada Naoki :


--
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



[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-16 Thread Maxwell Bernstein


New submission from Maxwell Bernstein :

As I understand it, str.format and string.Formatter are supposed to behave the
same, with string.Formatter being a pluggable variant. While poking at
string.Formatter, I noticed that they do not behave the same when formatting a
nameless subscript:

```
import string
str.format("{[0]}", "hello")  # => "h"
string.Formatter().format("{[0]}", "hello")  # => KeyError("")
```

They seem to work the same in the case where the arg is either indexed by
number or by name:

```
import string
str.format("{0[0]}", "hello")  # => "h"
string.Formatter().format("{0[0]}", "hello")  # => "h"
str.format("{a[0]}", a="hello")  # => "h"
string.Formatter().format("{a[0]}", a="hello")  # => "h"
```

After some digging, I have come up with a couple ideas:

* Change _string.formatter_field_name_split to treat an empty string field name
  as 0, so that string.Formatter.get_value looks up the arg in args, instead of
  kwargs
* Change string.Formatter.get_value to treat empty string key as 0, and look up
  the arg in args, instead of kwargs

I'm happy to submit a PR if people find one of these two solutions palatable or
have some solutions of their own.

(Note: this may appear in other versions, but I don't have them on my machine
to test.)

--
components: Library (Lib)
messages: 364382
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: str.format and string.Formatter subscript behaviors diverge
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Saw the following commit which *may* be related:

"Log:
  sendfile() does currently not support SCTP sockets.
  Therefore, fail the call.
"

https://svnweb.freebsd.org/changeset/base/358965

I'm updating FreeBSD base on the BB worker to include that commit and will 
re-run the failing build

--

___
Python tracker 

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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

The current test runs a try/finally without any exception handling, so even 
minimal exception handling will cover a large swatch of potential issues.

CalledProcessError [1] returned by check_call() or check_output() appears to be 
handy

[1] 
https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2037502613471a0a0a0262085cc50adb378ebbad by Hai Shi in branch 
'master':
bpo-1635741: Port  _ctypes_test extension to multiphase initialization (PEP 
489) (GH-19012)
https://github.com/python/cpython/commit/2037502613471a0a0a0262085cc50adb378ebbad


--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2020-03-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18385
pull_request: https://github.com/python/cpython/pull/19034

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2020-03-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18384
pull_request: https://github.com/python/cpython/pull/19034

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-16 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +18383
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19034

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-16 Thread STINNER Victor


New submission from STINNER Victor :

The _PyRuntime.ceval structure should be made "per-interpreter". I don't want 
to make the GIL per-interpreter: that's out of the scope of this issue. So I 
propose to only move a few fields to make more ceval fields "per interpreter".

--
components: Interpreter Core
messages: 364378
nosy: vstinner
priority: normal
severity: normal
status: open
title: Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval
versions: Python 3.9

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Change by Stefan Krah :


--
assignee:  -> skrah
keywords:  -3.7regression, patch

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I mean, it's not okay to complain about a regression and then
mention xlc about 10 mails later.

How is this related? Or is not ok to report a behaviour change in a stable 
release even if the platform is "best-effort"?

A regression by definition is a behaviour change between two versions. AIX is a 
"best-effort" platform, not a fully-supported one and I am well aware. I have 
not asked for a revert in anycase, precisely because of that (that decision 
should be up the release manager anyway), I am just communicating the 
regression. And doing so is perfectly "ok", even If I am using xlc (which is 
the native compiler on AIX).

--
assignee: skrah -> 

___
Python tracker 

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



[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2020-03-16 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Closing the issue as python2 is not receiving any more fixes and our downstream 
workaround is enough for it. Python3 is fine as well.

--
status: open -> closed

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Change by Stefan Krah :


--
assignee:  -> skrah

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

BTW, if you are compiling with xlc and there"s no xlc buildbot,
perhaps a company-that-shall-not-be-named should provide one.

I mean, it's not okay to complain about a regression and then
mention xlc about 10 mails later.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Btw, this is AIX 7.1.0.0 with xlc in case that is relevant.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

These flags worked for xlc when snakebite was still up:

./configure CC=xlc_r AR="ar -X64" CFLAGS="-q64 -qmaxmem=7" LDFLAGS="-q64"

-qmaxmem was always finicky, I remember segfaults too (AIX problem,
not libmpdec problem).

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> If you are fortunate enough to have access to an AIX system, I guess
you have to find out why POWER6 AIX 3.8 and PPC64 AIX 3.8 apparently
work on https://buildbot.python.org/ but your 3.7 does not.

I am working on trying to debug where the problem comes from, but meanwhile, I 
wanted to report here that this introduced a difference between Python 3.7.6 
and Python 3.7.7

I still did not test Python 3.8 but I suppose that it has the same problem.

> Are you compiling --with-system-libmpdec?

No, I am compiling with:

CFLAGS+= -qmaxmem=-1
OBJECT_MODE=64
CONFIGURE_ARGS=--enable-shared --with-system-ffi --without-computed-gotos 
ac_cv_rshift_extends_sign=no

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

Hi Michael, in case you have built 3.7.7 on AIX, have you observed
any problems with test_decimal?

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

> Well, I just did and I can confirm that reverting the 3.7 backport fixes the 
> problem.

If you are fortunate enough to have access to an AIX system, I guess
you have to find out why POWER6 AIX 3.8 and PPC64 AIX 3.8 apparently
work on https://buildbot.python.org/ but your 3.7 does not.

It seems rather strange to me. Are you compiling --with-system-libmpdec?

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Thanks for the lecture. This is an esoteric case between bugfix and
feature that only occurs with very large context precisions.

Nobody is lecturing anyone. I am just asking why this was backported.

> If Bloomberg isn't happy with _decimal, they can stop using it.
I'm not paid by them.

Stefan, nobody has mentioned Bloomberg in this issue so please, stop.


> Also this is a rather bold statement since probably no one has ever
run _decimal on AIX with MAX_PREC.

Well, I just did and I can confirm that reverting the 3.7 backport fixes the 
problem.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

> This code has introduced a regression in AIX in Python 3.7.7

Also this is a rather bold statement since probably no one has ever
run _decimal on AIX with MAX_PREC.

--

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Same issue on AMD64 FreeBSD Shared 3.8:
https://buildbot.python.org/all/#builders/18/builds/162

It looks more like a recent FreeBSD upgrade than a Python regression.

3.8 fail, build 162:

os.uname: posix.uname_result(sysname='FreeBSD', nodename='130-CURRENT-amd64', 
release='13.0-CURRENT', version='FreeBSD 13.0-CURRENT #1 r358865: Wed Mar 11 
21:35:42 UTC 2020 
root@130-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC', 
machine='amd64')

3.8 ok, build 153 (12 days ago):

os.uname: posix.uname_result(sysname='FreeBSD', nodename='130-CURRENT-amd64', 
release='13.0-CURRENT', version='FreeBSD 13.0-CURRENT #7 r356645: Sun Jan 12 
14:57:12 AEDT 2020 
root@130-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', 
machine='amd64')

The kernel changed.

--

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Bug seen on Pytho 3.7 branch, on Fedora Stable, RHEL7 and RHEL8, on different 
architectures.

aarch64 RHEL7 Refleaks 3.7:
https://buildbot.python.org/all/#builders/598/builds/22

PPC64LE RHEL7 Refleaks 3.7:
https://buildbot.python.org/all/#builders/414/builds/32

PPC64LE Fedora Stable Refleaks 3.7:
https://buildbot.python.org/all/#/builders/388/builds/31

--

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-03-16 Thread STINNER Victor


New submission from STINNER Victor :

Tests run with --fail-env-changed. test_multiprocessing_forkserver failed with 
"env changed", but no warning was logged to explain why :-(

PPC64LE RHEL7 3.8:
https://buildbot.python.org/all/#/builders/401/builds/69

./python  ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest 
--fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml -j10

--
components: Tests
messages: 364365
nosy: vstinner
priority: normal
severity: normal
status: open
title: test.regrtest: test marked as failed (env changed), but no warning: 
test_multiprocessing_forkserver
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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah


Stefan Krah  added the comment:

> This looks like a "new feature/improvement". Why was this code backported to 
> a stable version?

Thanks for the lecture. This is an esoteric case between bugfix and
feature that only occurs with very large context precisions.

If Bloomberg isn't happy with _decimal, they can stop using it.
I'm not paid by them.

Which AIX buildbot fails? There are many green ones.

--

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

It worked 10 days ago:
https://buildbot.python.org/all/#/builders/152/builds/382

--

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 FreeBSD Shared 3.x:
https://buildbot.python.org/all/#/builders/152/builds/409

==
ERROR: testSendmsg (test.test_socket.SendmsgSCTPStreamTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 342, in _setUp
self.__setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 2716, in setUp
super().setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 2533, in setUp
super().setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 646, in setUp
conn, addr = self.serv.accept()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", 
line 293, in accept
fd, addr = self._accept()
ConnectionAbortedError: [Errno 53] Software caused connection abort

(...)

==
ERROR: testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 342, in _setUp
self.__setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 2533, in setUp
super().setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 646, in setUp
conn, addr = self.serv.accept()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", 
line 293, in accept
fd, addr = self._accept()
ConnectionAbortedError: [Errno 53] Software caused connection abort

(...)

==
ERROR: testRecvmsgIntoGenerator (test.test_socket.RecvmsgIntoSCTPStreamTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 342, in _setUp
self.__setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 2533, in setUp
super().setUp()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py",
 line 646, in setUp
conn, addr = self.serv.accept()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", 
line 293, in accept
fd, addr = self._accept()
ConnectionAbortedError: [Errno 53] Software caused connection abort

(...)

--
components: Tests
messages: 364362
nosy: koobs, vstinner
priority: normal
severity: normal
status: open
title: FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x
versions: Python 3.9

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +ned.deily

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This looks like a "new feature/improvement". Why was this code backported to a 
stable version?

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This code has introduced a regression in AIX in Python 3.7.7 as the new 
"test_maxcontext_exact_arith" test hangs indefinitely or just segfaults.

--
keywords: +3.7regression
nosy: +pablogsal
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue36017] test_grp

2020-03-16 Thread Matthias Braun


Change by Matthias Braun :


--
keywords: +patch
nosy: +Matthias Braun
nosy_count: 1.0 -> 2.0
pull_requests: +18382
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19033

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-03-16 Thread Ned Deily


Ned Deily  added the comment:

> some vendors like to leave out the tests and not having them all under 'test' 
> prevents that from working cleanly

Yeah, but presumably all the major distributors have long ago figured out how 
to do this (it's not *that* hard) and, by moving the tests now, would actually 
make work for them :) (Granted, that's also not that hard)

Losing the history of a bunch of files would be a much more serious concern, 
IMHO.  If the files can't be moved without losing history, I'de be a definite 
-1 on this change; otherwise, a meh -0.

--

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-03-16 Thread Zachary Ware


Zachary Ware  added the comment:

I'm personally still in favor of the change.  This wouldn't be the first big 
movement of files in our repo and likely not the last, and I don't think 
git/GitHub's support (or lack thereof) for file moves is a good enough reason 
to not organize things better.

--

___
Python tracker 

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



[issue26067] test_shutil fails when gid name is missing

2020-03-16 Thread Matthias Braun


Matthias Braun  added the comment:

I have the same issue on my work macbook which has some form of network login 
configured. The primary group id of my user account there cannot be found in 
the group database and cannot be resolved to a name.

I'm not sure why that is but I am pretty sure there is no obligation that a gid 
must be resolvable to a name. I submitted a PR to just skip the last part of 
the test_shutil/chown if the uid/gid cannot be resolved to a name.

--
nosy: +Matthias Braun

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Yes, I recommend against this change.  Sorry for the time already spent :(

(I only named Mercurial because python-dev used it before, so I was comparing 
the behaviour of the two tools)

--

___
Python tracker 

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



[issue26067] test_shutil fails when gid name is missing

2020-03-16 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +18381
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19032

___
Python tracker 

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



[issue39981] Default values for AST Nodes

2020-03-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
keywords: +patch
pull_requests: +18380
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19031

___
Python tracker 

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



[issue39981] Default values for AST Nodes

2020-03-16 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

For omitting some defaults, @serhiy.storchaka already added support to 
initialize some ast nodes with some default values (optional fields). An 
example;
>>> ast.Constant().kind is None
True

This isn't exactly a default value, but some kind of class attribute. I think 
we can push this one step further and initialize all kinds of default values 
(both optionals and sequences). An example;
>>> func = ast.FunctionDef("easy_func", ast.arguments(), body=[ast.Pass()])
>>> func = ast.fix_missing_locations(func)
>>> exec(compile(ast.Module(body=[func]), "", "exec"))
>>> easy_func()

compared to this (other way around, compiler gives errors so does most of the 
ast based tool, including ast.unparser)
>>> func = ast.FunctionDef("easy_func", ast.arguments(posonlyargs=[], args=[], 
>>> kwonlyargs=[], kw_defaults=[], defaults=[]), decorator_list=[], 
>>> body=[ast.Pass()])
>>> func = ast.fix_missing_locations(func)
>>> exec(compile(ast.Module(body=[func], type_ignores=[]), "", "exec"))
>>> easy_func()

--
components: Library (Lib)
messages: 364355
nosy: BTaskaya, benjamin.peterson, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Default values for AST Nodes
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue39980] importlib.resources.path() may return incorrect path when using custom loader

2020-03-16 Thread Krzysztof Rusek


Krzysztof Rusek  added the comment:

Maybe importlib.resources.path() should skip checking file existence when 
ResourceReader.resource_path() raises FileNotFoundError? Current logic:

@contextmanager
def path(package: Package, resource: Resource) -> Iterator[Path]:
resource = _normalize_path(resource)
package = _get_package(package)
reader = _get_resource_reader(package)
if reader is not None:
try:
yield Path(reader.resource_path(resource))
return
except FileNotFoundError:
pass
else:
_check_location(package)
# Fall-through for both the lack of resource_path() *and* if
# resource_path() raises FileNotFoundError.
package_directory = Path(package.__spec__.origin).parent
file_path = package_directory / resource
if file_path.exists():
yield file_path
else:


--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

>> I.e.: something as adding a thread_id to sys.settrace -- 
>> sys.settrace(trace_func, thread_id=None).

> What is the use case for this feature?

The use case is having the user attach the debugger (either programmatically or 
by doing an attach to process) and be able to debug all threads, not just the 
current thread.

> It seems quite complicated to implement the thread_id for 
> sys.settrace(trace_func, thread_id=None).

Humm, isn't it just a matter of passing the proper tstate to _PyEval_SetTrace? 
It seems reasonably simple to do at C (i.e.: iterate the existing thread states 
to get the thread id and then pass the proper tsate to _PyEval_SetTrace -- 
which is roughly what is done in the debugger, although it's a bit more 
complicated because it supports Python 2.7 up to Python 3.8...).

> At the C level, Python doesn't maintain a list of thread. There is only 
> threading.enumerate() which is implemented in Python.

The tstate does contain the thread id, so, iterating the available tstates 
should be enough for that.

> PyDev.Debugger seems to use the C API. Can it continue to use the C API?

It can for CPython, but it can't for other Python implementations (and ideally 
I'd like to rely less on the CPython C-API -- because there's too much 
implementation details on it, things seem to break at each new version).

> Note: There is threading.setprofile() and threading.settrace() which set a 
> profile/trace function when *new* threads are spawned

Yes, I know about those, but it's not enough if the user attaches the debugger 
after the process is already running.

--

___
Python tracker 

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



[issue39980] importlib.resources.path() may return incorrect path when using custom loader

2020-03-16 Thread Krzysztof Rusek


New submission from Krzysztof Rusek :

importlib.resources.path() function may return a path to a file with different 
contents than expected. This may happen when using a custom loader 
implementation that uses fake filenames (like '').

I'm attaching a reproduction test (resources.py).

--
components: Library (Lib)
files: resources.py
messages: 364352
nosy: Krzysztof Rusek
priority: normal
severity: normal
status: open
title: importlib.resources.path() may return incorrect path when using custom 
loader
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48978/resources.py

___
Python tracker 

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



[issue39959] (Possible) bug on multiprocessing.shared_memory

2020-03-16 Thread Jeff Fischer


Jeff Fischer  added the comment:

I've run into the same problem. It appears that the SharedMemory class is 
assuming that all clients of a segment are child processes from a single 
parent, and that they inherit the same resource_tracker. If you run separate, 
unrelated processes, you get a separate resource_tracker for each process. 
Then, when a process does a close() followed by a sys.exit(), the resource 
tracker detects a leak and unlinks the segment.

In my application, segment names are stored on the local filesystem and a 
specific process is responsible for unlinking the segment when it is shut down. 
I was able to get this model to work with the current SharedMemory 
implementation by having processes which are just doing a close() also call 
resource_tracker.unregister() directly to prevent their local resource trackers 
from destroying the segment.

I imagine the documentation needs some discussion of the assumed process model 
and either: 1) a statement that you need to inherit the resource tracker from a 
parent process, 2) a blessed way to call the resource tracker to manually 
unregister, or 3) a way to disable the resource tracker when creating the 
SharedMemory object.

--
nosy: +jfischer

___
Python tracker 

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



[issue39656] shebanged scripts can escape from `venv` depending on how it was created

2020-03-16 Thread Anthony Sottile


Change by Anthony Sottile :


--
keywords: +patch
pull_requests: +18379
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19030

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> I.e.: something as adding a thread_id to sys.settrace -- 
> sys.settrace(trace_func, thread_id=None).

What is the use case for this feature?

It seems quite complicated to implement the thread_id for 
sys.settrace(trace_func, thread_id=None).

Currently, there is no way for a thread to execute code directly in another 
thread. In asyncio, it has to through call_soon_threadsafe() which queues the 
function calls and the function is called "later" and the caller doesn't get 
the result.

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.loop.call_soon_threadsafe

sys.setprofile() and sys.settrace() use the current Python thread state 
(tstate). The threading.enumerate() function returns threading.Thread 
instances, but it's not currently possible to get the Python thread state (C 
structure PyThreadState) from a Python threading.Thread object.

At the C level, Python doesn't maintain a list of thread. There is only 
threading.enumerate() which is implemented in Python.

PyDev.Debugger seems to use the C API. Can it continue to use the C API?

Note: There is threading.setprofile() and threading.settrace() which set a 
profile/trace function when *new* threads are spawned.

--

___
Python tracker 

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



[issue37860] Add deploy preview for docs

2020-03-16 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> This macOS job should be enhanced?

setup.py skips optional dependencies like readline on purpose.

readline is built again onx86-64 macOS 3.x buildbot worker and test_readline 
passed. I close the issue.

Thanks for the quick fix.

--
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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think Cython makes use of PEP-489 so unless I am missing something all 
generated extensions use PEP-489 structures.

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi


hai shi  added the comment:

> Oh, macOS job was marked as success on PR 19017 :-(

yeah, it's weird. This macOS job should be enhanced?

--

___
Python tracker 

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



[issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable

2020-03-16 Thread Anthony Sottile


Change by Anthony Sottile :


--
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



[issue39971] Error on documentation - Quick fix.

2020-03-16 Thread Diogo Flores


Diogo Flores  added the comment:

Agreed, Eric. Nevertheless, I think that this example might raise unnecessary 
confusion to someone new to Python, and hence the reason why I decided to open 
the issue. Anyhow, I trust your judgement and please feel free to leave things 
as is and close this issue.

PS: I really the work you did with dataclasses, and I actually explored the 
idea further with a small (300 LoC) library that adds runtime type checking for 
instances of dataclasses - if you are ever curious you can find the code on my 
GitHub at /dxflores/invis.

Thank you,
Diogo

--

___
Python tracker 

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



[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2020-03-16 Thread Anthony Sottile


Change by Anthony Sottile :


--
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



[issue37695] Incorrect error message for `unget_wch(bytes_object)`

2020-03-16 Thread Anthony Sottile


Change by Anthony Sottile :


--
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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-16 Thread Anthony Sottile


Anthony Sottile  added the comment:

I would certainly like to see this, it would eliminate my last few hand rolled 
temporary directory contexts

Mauro would you be interested in re-posting this patch as a PR to github? (or 
allowing someone else to carry your patch forward?)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

>> As a note, the original request was for a Python-level tracing function (so 
>> that in the future other Python implementations also provide that function) 
>> -- does this need a PEP?

> What do you mean by a Python-level tracing function?

I mean that it's a function to be called from Python (not only from C) -- which 
hopefully could be adopted by other Python implementations in the long run. 

I.e.: something as adding a thread_id to sys.settrace -- 
sys.settrace(trace_func, thread_id=None).

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> Compile is failure after PR 19017 is merged on macOS.

Oh, macOS job was marked as success on PR 19017 :-(
https://github.com/python/cpython/runs/509226542

But I confirm that I can read there:

"""
Failed to build these modules:
_tkinter  readline 
"""

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 046255c40fc0d9c5a4c528eb5955792fa08df66f by Victor Stinner in 
branch '3.8':
bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) (GH-19029)
https://github.com/python/cpython/commit/046255c40fc0d9c5a4c528eb5955792fa08df66f


--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> As a note, the original request was for a Python-level tracing function (so 
> that in the future other Python implementations also provide that function) 
> -- does this need a PEP?

What do you mean by a Python-level tracing function?

--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6ff79f65820031b219622faea8425edaec9a43f3 by Dong-hee Na in branch 
'master':
bpo-37207: Use PEP 590 vectorcall to speed up set() constructor (GH-19019)
https://github.com/python/cpython/commit/6ff79f65820031b219622faea8425edaec9a43f3


--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5f104d56fa10f88098338b3f1ea74bcbe6924ca9 by Hai Shi in branch 
'master':
bpo-39968: Fix a typo error in get_readline_state() (GH-19028)
https://github.com/python/cpython/commit/5f104d56fa10f88098338b3f1ea74bcbe6924ca9


--

___
Python tracker 

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



[issue39974] A race condition with GIL releasing exists in stringlib_bytes_join

2020-03-16 Thread tzickel


tzickel  added the comment:

My mistake...

--
resolution:  -> not a bug

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18378
pull_request: https://github.com/python/cpython/pull/19029

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f6a58507820c67e8d0fb07875cd1b1d9f5e510a8 by Victor Stinner in 
branch 'master':
bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977)
https://github.com/python/cpython/commit/f6a58507820c67e8d0fb07875cd1b1d9f5e510a8


--

___
Python tracker 

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



[issue39977] Python aborts trying to load libcrypto.dylib

2020-03-16 Thread Ned Deily


Ned Deily  added the comment:

The crash report gives the reason for the crash:

Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as 
it does not have a stable ABI.

This means something you are importing is trying to access the deprecated macOS 
system version of OpenSSL's libcrypto and not a newer, third-party version 
supplied in this case by Homebrew.

Try importing _hashlib directly in the interpreter:

>>> import _hashlib

If you see the error then, you know that your Python installation has been 
built and linked incorrectly with the system OpenSSL libraries.  If not, then 
almost certainly a third-party package installed with this Pyrhon instance was 
built incorrectly and is trying to link to the system libcryto.  In either 
case, you should try re-installing those items using their latest versions.  
Good luck!

--
resolution:  -> third party
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



[issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError

2020-03-16 Thread paul j3


paul j3  added the comment:

You are right, this part of the same issue.

_get_value() tests '==SUPPRESS==' both for type and choices.

--

___
Python tracker 

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



[issue39979] Cannot tune scrypt with large enough parameters

2020-03-16 Thread Gle


New submission from Gle :

I can use scrypt KDF with the cryptography module
https://cryptography.io/en/latest/hazmat/primitives/key-derivation-functions/#cryptography.hazmat.primitives.kdf.scrypt.Scrypt
with large parameters (n=2**20, r=16, p=1)

On the other hand, using scrypt KDF from hashlib with the same parameters 
yields "Invalid combination of n, r, p, maxmem" (I use maxmem=0).

Shouldn't they behave the same ? As they both seem to be wrappers around 
OpenSSL ?

I've also included a set of functioning parameters as hashlib's scrypt works 
fine on small parameter values.

Notice that the output from hashlib's scrypt is different than the output from 
the cryptography module. Shouldn't they be the same ? (I'm no cryptography 
expert)

I would really like to be able to use scrypt for hardened password hashing 
using only python standard library's hashlib. Maybe I'm missing something ?

Python is great ! Thanks for all the good work !

--
components: Library (Lib)
files: compare.py
messages: 364334
nosy: Gle, christian.heimes, gregory.p.smith
priority: normal
severity: normal
status: open
title: Cannot tune scrypt with large enough parameters
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file48977/compare.py

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi


hai shi  added the comment:

> See also: https://github.com/python/cpython/runs/509226542#step:4:305
Oh, thanks, Dong-hee Na. I create a PR for this typo error.

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi


Change by hai shi :


--
pull_requests: +18377
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/19028

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

I reopen this issue for the above problem

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue39978] Vectorcall implementation should conform to PEP 590.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> The change has a negative impact on performance

How did you notice the slowdown? I ran benchmarks in 
https://github.com/python/cpython/pull/17052 and I didn't notice any 
performance overhead.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 356c878fbf2a97aa3ab7951fd7456d219ff0b466 by Dong-hee Na in branch 
'master':
bpo-1635741: Port _statistics module to multiphase initialization (GH-19015)
https://github.com/python/cpython/commit/356c878fbf2a97aa3ab7951fd7456d219ff0b466


--

___
Python tracker 

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



[issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError

2020-03-16 Thread Tomáš Jeziorský

Tomáš Jeziorský  added the comment:

I found what appears to be a very similar issue so instead of creating a new 
issue I will place it here as a comment.

The following code:

==
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('letter', choices=['a', 'b', 'c'], 
default=argparse.SUPPRESS, nargs='?')
args = parser.parse_args([])
==

results in this error:

==
usage: pok.py [-h] [{a,b,c}]
pok.py: error: argument letter: invalid choice: '==SUPPRESS==' (choose from 
'a', 'b', 'c')
==

--
nosy: +jeyekomon

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

See also: https://github.com/python/cpython/runs/509226542#step:4:305

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

> cpython/Modules/readline.c:90:20: error: unknown type name
  'PyModule'
get_readline_state(PyModule *module)

Compile is failure after PR 19017 is merged on macOS.

--
nosy: +corona10

___
Python tracker 

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



[issue39978] Vectorcall implementation should conform to PEP 590.

2020-03-16 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2020-03-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Actually I have a better solution for this (which I hope to share really soon 
if it works.) I think we can do default value initialization for both Nones 
(with your patch) and lists, it requires a bit of extra work but  I think I can 
do it.

--

___
Python tracker 

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



[issue39978] Vectorcall implementation should conform to PEP 590.

2020-03-16 Thread Mark Shannon


New submission from Mark Shannon :

The implementation of `PyObject_Vectorcall` adds unnecessary overhead to PEP 
590, which undermines its purpose.
The implementation was changed in https://github.com/python/cpython/pull/17052, 
which I objected to at the time.

The change has a negative impact on performance as it add calls to both 
`PyThreadState_GET()` and `_Py_CheckFunctionResult()`.

This is practically an invitation for callers to skip `PyObject_Vectorcall` and 
access the underlying function pointer directly, making `PyObject_Vectorcall` 
pointless.

https://github.com/python/cpython/pull/17052 should be reverted.

--
keywords: 3.9regression
messages: 364325
nosy: Mark.Shannon, petr.viktorin, vstinner
priority: normal
severity: normal
status: open
title: Vectorcall implementation should conform to PEP 590.
versions: Python 3.9

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 87ec86c425a5cd3ad41b831b54c0ce1a0c363f4b by Dong-hee Na in branch 
'master':
bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)
https://github.com/python/cpython/commit/87ec86c425a5cd3ad41b831b54c0ce1a0c363f4b


--

___
Python tracker 

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



[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-16 Thread Paul Ganssle


Paul Ganssle  added the comment:

@Yi Luan

I think you may misunderstand what the `.timestamp()` function does - it 
returns an epoch time, which is the amount of time (in seconds) elapsed since 
the Unix epoch: https://en.wikipedia.org/wiki/Unix_time

The number is not different depending on your time zone:

>>> from datetime import *
>>> from dateutil import tz

>>> dt = datetime(2019, 1, 1, tzinfo=timezone.utc)
>>> print(f"{dt}: {dt.timestamp()}")
2019-01-01 00:00:00+00:00: 1546300800.0

>>> dt = dt.astimezone(tz.gettz("America/New_York"))
>>> print(f"{dt}: {dt.timestamp()}")
2018-12-31 19:00:00-05:00: 1546300800.0

>>> dt = dt.astimezone(tz.gettz("Asia/Tokyo"))
>>> print(f"{dt}: {dt.timestamp()}")
2019-01-01 09:00:00+09:00: 1546300800.0

Note how the timestamp number is always the same.

Alexander's suggestion of using `datetime.now(tz=timezone.utc).timestamp()` is 
slightly misleading because `datetime.now().timestamp()` and 
`datetime.now(tz=timezone.utc).timestamp()` will always return the same value. 
I think he was just using that as shorthand for "replace datetime.utcnow() with 
datetime.now(tz=timezone.utc) in all cases".

When you have a naive datetime (with no tzinfo), the only options are to pick 
the time zone it represents and convert to UTC or to throw an error and say, 
"We don't know what time zone this represents, so we cannot do this operation." 
Python 2 used to throw an exception, but in Python 3 naive datetimes represent 
local times.

If you want "nominal number of seconds since 1970-01-01T00:00:00 *in this time 
zone*", you want something more like this:

  def seconds_since(dt, epoch=datetime(1970, 1, 1)):
return (dt.replace(tzinfo=None) - epoch).total_seconds()

That does not take into account total elapsed time from DST transitions and the 
like - to do that, you'll want something more like this:

  def seconds_elapsed_since(dt, epoch=datetime(1970, 1, 1)):
if epoch.tzinfo is None and dt.tzinfo is not None:
epoch = epoch.replace(tzinfo=dt.tzinfo)
return (dt - epoch).total_seconds()

I urge you not to do this in any sort of interop protocol, though, because 
integer timestamps are traditionally interpreted as Unix times, and if you 
start passing around an integer timestamp that represents "unix time plus or 
minus a few hours", you are likely to create bugs when someone mistakes it for 
a unix time.

--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c98f87fc330eb40fbcff627dfc50958785a44f35 by Dong-hee Na in branch 
'master':
bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986)
https://github.com/python/cpython/commit/c98f87fc330eb40fbcff627dfc50958785a44f35


--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi


hai shi  added the comment:

Wow, thanks, victor. those msgs is very helpful to me.

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I forgot a cool advantage that I discovered late: debuggers and profilers 
understand inlined code and are able to get the name of the static inline 
function, whereas it's not possible to do that with macros. If I recall 
correctly, it works even if the function is inlined.

--

___
Python tracker 

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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Do you suggest to skip the test if returncode has a specific value?

--

___
Python tracker 

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



[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2020-03-16 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



[issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main()

2020-03-16 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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

I updated PR 18738 to document the incompatible change in What's New In Python 
3.9. Sadly, I expect that almost no third-party extension module implement the 
PEP 489 yet. So I expect that little or no third-party code is impacted in 
pratice.


> the module slots are then only needed if the module state actually gets 
> populated, so we can safely skip them if it never even gets allocated

That's also my understanding.

> custom module subclasses should clean up like any other class instance

That sounds like a reasonable compromise to me.

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Note: Hai Shi is working hard on converting modules to multiphase module 
initialization (PEP 489) which helps to cleanup the Python state at exit, and 
subinterpreters will likely benefit of that. This issue is related to this work.

--

___
Python tracker 

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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

There are multiple good reasons to replace macros with static inline functions:

* Parameter types and return value are well defined
* Less error-prone: avoid completely 
https://gcc.gnu.org/onlinedocs/gcc-9.3.0/cpp/Macro-Pitfalls.html#Macro-Pitfalls
* Variables have a well defined scope, reduce the risk of unexpected side 
effects

I merged the PR 19017: it uses better names for the function and it adds 
assert(state != NULL).

Be careful of bpo-39824: in some cases, the module state *can* be NULL: but I 
checked, and it's not the case here. Moreover, bpo-39824 may prevent NULL 
module state (let's see ;-)).

Thanks Hai Shi!


> minor disadvantage in code generation

Micro-benchmarks and machine code analysis was done in previous issues 
replacing macros with static inline functions, and the outcome is that there is 
no effect on performance. See for example bpo-35059: performance critical 
Py_INCREF() and Py_DECREF() functions are now static inline functions.

If someone is curious about the the machine code, you should use -O3 with 
PGO+LTO, which is what should be used on Linux distributions. If static inline 
functions are not inlined for whatever reason, I suggest to tune the compiler 
rather than moving back to ugly macros.

If you use configure --enable-shared, I now also strongly suggest to use 
-fno-semantic-interposition: it's now used on Fedora and RHEL to build Python 
libpython.

Note: Support for "static inline" is now explicitly required by the PEP 7 to 
build Python, since Python 3.6. And it's more and more used in Python header 
files.

--
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



[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f707d94af68a15afc27c1a9da5835f9456259fea by Hai Shi in branch 
'master':
bpo-39968: Convert extension modules' macros of get_module_state() to inline 
functions (GH-19017)
https://github.com/python/cpython/commit/f707d94af68a15afc27c1a9da5835f9456259fea


--

___
Python tracker 

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



[issue39974] A race condition with GIL releasing exists in stringlib_bytes_join

2020-03-16 Thread Ma Lin


Ma Lin  added the comment:

I also planned to review this commit at some moment, I feel a bit unsteady 
about it.

If an optimization needs to be fine-tuned, and may introduces some pitfalls for 
future code maintenance, IMHO it is best to avoid doing this kind of 
optimization.

--
nosy: +Ma Lin

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

The proposed change will affect many builtin types: bytes, bytearray, str, but 
also other types like collections.UserString. Would it make sense to summarize 
what has been said in the python-ideas thread into a PEP? It may good to 
specify things like:

>>> x = "A"*10**6
>>> x.cutprefix("B") is x
True

The specification can be just "that's an implementation detail" or "CPython 
implementation specific" :-)

I don't expect such PEP to be long nor controversial, but it may help to write 
it down.

--

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-03-16 Thread Ido Michael


Ido Michael  added the comment:

Hey Eric,

I'm not sure what you mean, you don't recommend the change in general?
Or you just don't recommend Git for this and saying I should use Mercurial 
instead?

--

___
Python tracker 

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



  1   2   >