[issue40265] argparse.Namespace __repr__ does not handle reserved keywords

2020-04-12 Thread Saiyang Gou


Saiyang Gou  added the comment:

> The primary function of the Namespace class is to hold valid attributes and 
> to allow the dot operator to access those attributes.

I acknowledge this. Invalid attribute names are not useful in production. 
However, some crazy people like me would define arguments like these, producing 
an repr string that does not round-trip:

>>> from argparse import ArgumentParser
>>> parser = ArgumentParser()
>>> parser.add_argument('-8')
>>> parser.add_argument('-@')
>>> parser.add_argument('--return')
>>> parser.parse_args(['-8', 'y', '-@', 'a.com', '--return', 'foo'])
Namespace(return='foo', **{'8': 'y', '@': 'a.com'})

(I know I can use the `dest` argument to define an alternative name to store in 
the namespace.)

The reason why I open this issue is that I see issue 24360 already tried to 
improve the repr string for invalid names by using the `isidentifier` check. 
(Which is almost "as unuseful as this issue" for production use, since repr is 
almost only used for development instead of production.) The original author 
thought the improvement was enough to be round-trippable but missed the special 
case of keywords, and my patch will fix this.

--

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Would we be willing to consider an enhancement to have complex numbers always 
display using float format rather than ints?

1+1j --> 1.0+1.0j

We could still suppress an unsigned real zero:

1j --> 1.0j

but negative zero would show:

-(1j) --> -0.0-1.0j

I daresay this would break some doctests (CC'ing Tim, as he is a heavy user of 
doctests) but perhaps it would be worthwhile.

Aside from the backwards-compatibility issue, going against this suggestion we 
have the popular Texas Instruments Nspire calculator, which shows complex 
numbers as ints when possible.

On the other hand, the imaginary unit is shown as the symbolic constant i with 
no coefficient, and it also shows complex numbers with an explicit 
multiplication sign: 2⋅i rather than 2i.

Similarly, Julia shows complex numbers with integer coefficients when possible:

https://docs.julialang.org/en/v1/manual/complex-and-rational-numbers/

--
nosy: +steven.daprano, tim.peters

___
Python tracker 

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



[issue40265] argparse.Namespace __repr__ does not handle reserved keywords

2020-04-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

ISTM this a purely theoretical problem since "ns.return" is already a syntax 
error.

The primary function of the Namespace class is to hold valid attributes and to 
allow the dot operator to access those attributes.  Handling invalid attribute 
names is beyond its scope.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Ruben  added the comment:

I just tested on a fresh macOS 10.15.3 Virtual Machine (on the same host 
machine as the one of previous messages) and I can reproduce the problem: 

1. Install Command Line Tools (xcode-build --install)
2. Download Python 3.8.1
3. Extract tarball
4. Create a file make.py with the following python code
```
import subprocess

subprocess.run(["./configure"])
subprocess.run(["make", "-j4"])
```
and save it in the Python-3.8.1 source tree
6. Create a venv doing `python -m venv venv` in the source tree
7. Activate the virtual env `source venv/bin/activate`
5. Run it doing `python3 make.py`

The build fails with the error described before. 

If you now, instead, run the make directly `make -j8` the buids proceeds as 
expected.

--

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The docs for complex literals¹ could be improved to show that:

-1j is interpreted as -complex(0.0, 1.0)
giving a real component of -0.0
and an imaginary component of -1.0

and that:

   0-1j  is interpreted as 0.0-complex(0.0, 1.0)
giving a real component of 0.0
and an imaginary component of -1.0

It is unfortunate the repr for complex numbers uses integers at all.  That 
hides what is going on.

¹ https://docs.python.org/3/reference/lexical_analysis.html#imaginary-literals

--
nosy: +rhettinger

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40268] Reorganize pycore_pystate.h header

2020-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset da7933ecc30e37b119756cb02b89a6ad99db22e0 by Victor Stinner in 
branch 'master':
bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)
https://github.com/python/cpython/commit/da7933ecc30e37b119756cb02b89a6ad99db22e0


--

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18847
pull_request: https://github.com/python/cpython/pull/19494

___
Python tracker 

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



[issue40268] Reorganize pycore_pystate.h header

2020-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18846
pull_request: https://github.com/python/cpython/pull/19493

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

The final entry is identical to the second to last, because ints have no 
concept of -0. If you used a float literal, it would match the first two:

>>> -0.-1j
(-0-1j)

I suspect the behavior here is due to -1j not actually being a literal on its 
own; it's interpreted as the negation of 1j, where 1j is actually 0.0+1.0j, and 
negating it flips the sign on both the real and imaginary component.

>From what I can read of the grammar rules, this is expected; the negation 
>isn't ever part of the literal (minus signs aren't part of the grammar aside 
>from exponents in scientific notation). 
>https://docs.python.org/3/reference/lexical_analysis.html#floating-point-literals

If this is a bug, it's a bug in the grammar. I suspect the correct solution 
here is to include the real part explicitly, as 0.0-1j works just fine.

--
nosy: +josh.r

___
Python tracker 

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



[issue40268] Reorganize pycore_pystate.h header

2020-04-12 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Victor (me!):
> Well, this large problem sounds very complex and is made of multiple small 
> issues.

Kyle:
> (...) Should we consider making `threading._register_atexit()` public?

It seems like there is an use case for calling callbacks before Python calls 
threading._shutdown() in Py_Finalize(). We should either change when atexit 
callbacks are called, or add something new.

I suggest to open a separated issue for that.

--

___
Python tracker 

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



[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Rushil Udani


New submission from Rushil Udani :

In a Python REPL:

>>> -1j
(-0-1j)
>>> (-1j)
(-0-1j)
>>> 0-1j
-1j
>>> -0-1j
-1j

This is clearly inconsistent behavior! -1j and (-1j) should report as -1j, as 
the other two do.

--
components: Interpreter Core
messages: 366276
nosy: rushilu
priority: normal
severity: normal
status: open
title: Inconsistent complex behavior with (-1j)
type: behavior
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



[issue39865] getattr silences an unrelated AttributeError

2020-04-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

My instincts are to leave this alone and not gum up heavily trafficked core 
business logic.  I don't like the external calls, the extra increfs and decrefs 
(and possible rentrancy issues), performance impact, or the pattern of holding 
the exception across a call that can invoke arbitrary code.   The code for 
slot_tp_getattr_hook() is currently very clean and it would be nice to keep it 
that way.

ISTM that the problem is better addressed by unittesting, linting, and static 
type checking rather than by gumming-up runtime.

--
nosy: +tim.peters
versions:  -Python 2.7, Python 3.5, 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



[issue40268] Reorganize pycore_pystate.h header

2020-04-12 Thread STINNER Victor


New submission from STINNER Victor :

Over the time, pycore_pystate.h header file becomes more and more complex. It 
exposes too many internals whereas most consumers only need basic functions 
like _PyThreadState_GET().

I plan to use this issue as a placeholder for changes to reorganize 
pycore_pystate.h. I'm working on multiple pull requests.

--
components: Interpreter Core
messages: 366274
nosy: vstinner
priority: normal
severity: normal
status: open
title: Reorganize pycore_pystate.h header
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



[issue40267] Error message differs when an expression is in an fstring

2020-04-12 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

It seems that this is actually a bit bigger than this and it is not specific to 
f-strings. 

The error message *always* changes to `unexpected EOF while parsing` if there 
is an error with the last character of the input and no newline follows. For 
example, as made clear to me by Guido, there are even differences in error 
messages between exec'ing and eval'ing something:

>>> exec('x+')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
x+
 ^
SyntaxError: invalid syntax
>>> eval('x+')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
x+
 ^
SyntaxError: unexpected EOF while parsing

That's because the tokenizer adds an implicit newline to the input string, 
before tokenizing it, when the input comes from an exec call. (see 
https://github.com/python/cpython/blob/14d5331eb5e6c38be12bad421bd59ad0fac9e448/Parser/tokenizer.c#L648)

And that's not limited to a character missing, as suggested by the error 
message. Even when the last character itself generates a SyntaxError, the error 
message remains "unexpcted EOF while parsing":

>>> x+@
  File "", line 1
x+@
  ^
SyntaxError: invalid syntax
>>> eval('x+@')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
x+@
  ^
SyntaxError: unexpected EOF while parsing

Thus, a very simple fix to the specific fstring problem of this issue would be 
to add a newline to the string that gets parsed to the parser in 
fstring_compile_expr in ast.c, but I guess it'd be better to fix the tokenizer 
itself, if this is considered a bug.

--

___
Python tracker 

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



[issue40267] Error message differs when an expression is in an fstring

2020-04-12 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

There are cases, where the error message differs, when an expression is being 
parsed inside an fstring. For example:

>>> f'{x+}'
  File "", line 1
(x+)
   ^
SyntaxError: unexpected EOF while parsing
>>> (x+)
  File "", line 1
(x+)
   ^
SyntaxError: invalid syntax

Or with lambda definitions:

>>> f'{lambda x:x}'
  File "", line 1
(lambda x)
 ^
SyntaxError: unexpected EOF while parsing
>>> (lambda x)
  File "", line 1
(lambda x)
 ^
SyntaxError: invalid syntax

--
components: Interpreter Core
messages: 366272
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Error message differs when an expression is in an fstring
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



[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-12 Thread Kyle Stanley


Kyle Stanley  added the comment:

> So if you are going to eliminate daemon threads (even if only in sub 
> interpreters at this point), you are going to have to introduce a way to 
> register something similar to an atexit callback which would be invoked 
> before waiting on non daemon threads, so an attempt can be made to notify 
> them that they need to shutdown.

I'm not 100% certain if it fully covers the above use cases, but I recently 
added a fairly minimal internal `threading._register_atexit()` function that 
works similar to atexit: it schedules the callbacks to be invoked just before 
all non-daemon threads are joined, rather than upon interpreter finalization. 
The primary use case was to remove the reliance of daemon threads in 
concurrent.futures, for ThreadPoolExecutor and ProcessPoolExecutor. Their 
management threads relied fully upon daemon threads and `atexit.register()`, 
but the above provided an alternative means to accomplish the same goal; and 
also has the benefit of a more predictable shutdown process. See 
https://github.com/python/cpython/pull/19149 for details.

Should we consider making `threading._register_atexit()` public, and if we did, 
would it provide a reasonable transition for users that were previously relying 
upon daemon threads if they were to be deprecated in subinterpreters? If it 
were to be made public, there may also be a need to be able to unregister the 
threading atexit callbacks, similar to `atexit.unregister()` (that should be 
rather straightforward though).

(I added Antoine Pitrou to the nosy list, to see if he has an opinion on any of 
this as the maintainer of the threading module.)

--
nosy: +aeros, pitrou

___
Python tracker 

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



[issue37266] Daemon threads must be forbidden in subinterpreters

2020-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 14d5331eb5e6c38be12bad421bd59ad0fac9e448 by Victor Stinner in 
branch 'master':
bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters 
(GH-14049)" (GH-19456)
https://github.com/python/cpython/commit/14d5331eb5e6c38be12bad421bd59ad0fac9e448


--

___
Python tracker 

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



[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 14d5331eb5e6c38be12bad421bd59ad0fac9e448 by Victor Stinner in 
branch 'master':
bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters 
(GH-14049)" (GH-19456)
https://github.com/python/cpython/commit/14d5331eb5e6c38be12bad421bd59ad0fac9e448


--

___
Python tracker 

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



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Change by Ray Donnelly :


--
keywords: +patch
Added file: 
https://bugs.python.org/file49057/-Fix-off-by-one-error-in-_winapi_WaitForMultipleObjec.patch

___
Python tracker 

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



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Change by Ray Donnelly :


Removed file: 
https://bugs.python.org/file49056/-bpo-26903-Limit-ProcessPoolExecutor-to-61-workers-on-Windows.patch.ref

___
Python tracker 

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



[issue40218] sys.executable is a false path if python is executed from gdb

2020-04-12 Thread Volker Weißmann

Volker Weißmann  added the comment:

Ok, thank you. I hope that the gdb guys will respon

--

___
Python tracker 

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



[issue40264] List item inside tuple seemingly allows for item assignment even after throwing error

2020-04-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

This isn't a bug. See the FAQ:
https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works

--
nosy: +eric.smith
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



[issue40266] Failure to build _ssl module on ubuntu xenial

2020-04-12 Thread Anthony Sottile

New submission from Anthony Sottile :

Haven't yet bisected, but noticed this in the nightly builds I provide for 
ubuntu deadsnakes https://github.com/deadsnakes/nightly -- I believe it to be 
this patch so I've added to nosy: https://github.com/python/cpython/pull/19082

Both python3.8 and python3.9 are currently failing with a similar error:

2020-04-12T15:08:17.0217595Z x86_64-linux-gnu-gcc -pthread -fPIC -Wdate-time 
-D_FORTIFY_SOURCE=2 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -g -fstack-protector -Wformat -Werror=format-security -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -I../Include/internal -I../Include 
-IObjects -IPython -I. -I/usr/include/x86_64-linux-gnu -I/tmp/code/Include 
-I/tmp/code/build-shared -c /tmp/code/Modules/_ssl.c -o 
build/temp.linux-x86_64-3.8/tmp/code/Modules/_ssl.o
2020-04-12T15:08:17.1350180Z In file included from 
/tmp/code/Modules/_ssl.c:136:0:
2020-04-12T15:08:17.1351441Z /tmp/code/Modules/_ssl_data.h:6:15: error: 
‘ERR_LIB_ASYNC’ undeclared here (not in a function)
2020-04-12T15:08:17.1352097Z  {"ASYNC", ERR_LIB_ASYNC},
2020-04-12T15:08:17.1352338Z^
2020-04-12T15:08:17.1355975Z /tmp/code/Modules/_ssl_data.h:13:12: error: 
‘ERR_LIB_CT’ undeclared here (not in a function)
2020-04-12T15:08:17.1356503Z  {"CT", ERR_LIB_CT},
2020-04-12T15:08:17.1356692Z ^
2020-04-12T15:08:17.1357242Z /tmp/code/Modules/_ssl_data.h:19:13: error: 
‘ERR_LIB_KDF’ undeclared here (not in a function)
2020-04-12T15:08:17.1357579Z  {"KDF", ERR_LIB_KDF},
2020-04-12T15:08:17.1357784Z  ^
2020-04-12T15:08:17.1366068Z In file included from 
/tmp/code/Modules/_ssl.c:136:0:
2020-04-12T15:08:17.1366527Z /tmp/code/Modules/_ssl_data.h:598:28: error: 
initializer element is not constant
2020-04-12T15:08:17.1366913Z  {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101},
2020-04-12T15:08:17.1367202Z ^
2020-04-12T15:08:17.1368223Z /tmp/code/Modules/_ssl_data.h:598:28: note: (near 
initialization for ‘error_codes[112].library’)
2020-04-12T15:08:17.1370670Z /tmp/code/Modules/_ssl_data.h:603:32: error: 
initializer element is not constant
2020-04-12T15:08:17.1371883Z  {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 
102},
2020-04-12T15:08:17.1372824Z ^
2020-04-12T15:08:17.1374744Z /tmp/code/Modules/_ssl_data.h:603:32: note: (near 
initialization for ‘error_codes[113].library’)
2020-04-12T15:08:17.1376008Z /tmp/code/Modules/_ssl_data.h:608:21: error: 
initializer element is not constant
2020-04-12T15:08:17.1377003Z  {"INIT_FAILED", ERR_LIB_ASYNC, 105},
2020-04-12T15:08:17.1377757Z  ^
2020-04-12T15:08:17.1378839Z /tmp/code/Modules/_ssl_data.h:608:21: note: (near 
initialization for ‘error_codes[114].library’)
2020-04-12T15:08:17.1379355Z /tmp/code/Modules/_ssl_data.h:613:27: error: 
initializer element is not constant
2020-04-12T15:08:17.1379774Z  {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, 103},
2020-04-12T15:08:17.1380044Z^
2020-04-12T15:08:17.1380663Z /tmp/code/Modules/_ssl_data.h:613:27: note: (near 
initialization for ‘error_codes[115].library’)
2020-04-12T15:08:17.1391167Z /tmp/code/Modules/_ssl_data.h:1458:29: error: 
initializer element is not constant
2020-04-12T15:08:17.1392255Z  {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108},
2020-04-12T15:08:17.1392949Z  ^
2020-04-12T15:08:17.1394611Z /tmp/code/Modules/_ssl_data.h:1458:29: note: (near 
initialization for ‘error_codes[284].library’)
2020-04-12T15:08:17.1395718Z /tmp/code/Modules/_ssl_data.h:1463:31: error: 
initializer element is not constant
2020-04-12T15:08:17.1396628Z  {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, 100},
2020-04-12T15:08:17.1407884Z^
2020-04-12T15:08:17.1408725Z /tmp/code/Modules/_ssl_data.h:1463:31: note: (near 
initialization for ‘error_codes[285].library’)
2020-04-12T15:08:17.1409300Z /tmp/code/Modules/_ssl_data.h:1468:26: error: 
initializer element is not constant
2020-04-12T15:08:17.1409726Z  {"LOG_CONF_INVALID", ERR_LIB_CT, 109},
2020-04-12T15:08:17.1410042Z   ^
2020-04-12T15:08:17.1410675Z /tmp/code/Modules/_ssl_data.h:1468:26: note: (near 
initialization for ‘error_codes[286].library’)
2020-04-12T15:08:17.1411199Z /tmp/code/Modules/_ssl_data.h:1473:30: error: 
initializer element is not constant
2020-04-12T15:08:17.1411612Z  {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, 110},
2020-04-12T15:08:17.1411921Z   ^
2020-04-12T15:08:17.1412514Z /tmp/code/Modules/_ssl_data.h:1473:30: note: (near 
initialization for ‘error_codes[287].library’)
2020-04-12T15:08:17.1413202Z /tmp/code/Modules/_ssl_data.h:1478:38: error: 
initializer element is not constant
2020-04-12T15:08:17.1413930Z  {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, 
111},

[issue40264] List item inside tuple seemingly allows for item assignment even after throwing error

2020-04-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue40265] argparse.Namespace __repr__ does not handle reserved keywords

2020-04-12 Thread Saiyang Gou


New submission from Saiyang Gou :

It is generally a convention to design the repr string such that 
`eval(repr(obj))` can reproduce the object. Issue 24360 handles the special 
situation when arg name passed to `argparse.Namespace` is not a valid 
identifier:

>>> from argparse import Namespace
>>> Namespace(**{')': 3})
Namespace(**{')': 3})

However there is one more corner case to handle: the arg name could be a 
reserved keyword.

>>> Namespace(**{'return': 3})
Namespace(return=3)
>>> Namespace(return=3)
  File "", line 1
Namespace(return=3)
  ^
SyntaxError: invalid syntax

I noticed that the documentation of `str.isidentifier` tells me to also check 
for keywords with `keyword.iskeyword`. However `__debug__` is not considered a 
keyword by `keyword.iskeyword`, but cannot be assigned to:

>>> keyword.iskeyword('__debug__')
False
>>> Namespace(**{'__debug__':3})
Namespace(__debug__=3)
>>> Namespace(__debug__=3)
  File "", line 1
SyntaxError: cannot assign to __debug__

I propose to enhance the arg name check in `argparse._AttributeHolder` from `if 
name.isidentifier():` to `if name.isidentifier() and not 
keyword.iskeyword(name) and name != '__debug__:'` to fix this. However this may 
slow down the argparse library since it will need to `import keyword` at the 
beginning, and `__repr__` will also be slower due to the added arg name checks.

By the way, when I came across issue 39076, I noticed that 
`types.SimpleNamespace` is not considering this problem at all:

>>> types.SimpleNamespace(**{')': 1, 'return': 2})
namespace()=1, return=2)

--
components: Library (Lib)
messages: 366265
nosy: gousaiyang
priority: normal
severity: normal
status: open
title: argparse.Namespace __repr__ does not handle reserved keywords
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



[issue40264] List item inside tuple seemingly allows for item assignment even after throwing error

2020-04-12 Thread Rahul B


New submission from Rahul B :

Even though item assignment throws error, the list inside tuple 'a' gets 
modified in place. Refer below, where the list value [8] gets added to the list 
value [5,6,7,7] at a[3]

>>> a
(2, 3, 4, [5, 6, 7, 7], 1)
>>> id(a[3])
140531212178376
>>> a[3]+=[8]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(2, 3, 4, [5, 6, 7, 7, 8], 1)
>>> id(a[3])
140531212178376

--
messages: 366264
nosy: Rahul B
priority: normal
severity: normal
status: open
title: List item inside tuple seemingly allows for item assignment even after 
throwing error
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



[issue39953] Let's update ssl error codes

2020-04-12 Thread miss-islington


miss-islington  added the comment:


New changeset f35e7d3bb0488a15cbb45ff10f02be558a3777cd by Miss Islington (bot) 
in branch '3.8':
closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)
https://github.com/python/cpython/commit/f35e7d3bb0488a15cbb45ff10f02be558a3777cd


--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-12 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 909b87d2bb3d6330d39c48e43f7f50f4d086cc41 by Benjamin Peterson in 
branch 'master':
closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)
https://github.com/python/cpython/commit/909b87d2bb3d6330d39c48e43f7f50f4d086cc41


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



[issue39953] Let's update ssl error codes

2020-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18843
pull_request: https://github.com/python/cpython/pull/19491

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-12 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-12 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Sorry, I thought I had tested with multissl.

On Sun, Apr 12, 2020, at 06:22, Christian Heimes wrote:
> 
> Christian Heimes  added the comment:
> 
> The PR broke backwards compatibility with OpenSSL 1.0.2 and LibreSSL. 
> OpenSSL 1.1.x introduced new error codes or reused existing numbers for 
> different errors codes.
> 
> Although OpenSSL 1.0.2 has reached EOL we should keep keep Python 3.8 
> and 3.9 compatible with the API.
> 
> --
> nosy: +lukasz.langa
> priority: normal -> release blocker
> resolution: fixed -> 
> status: closed -> open
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 41d5b94af44e34ac05d4cd57460ed104ccf96628 by Lysandros Nikolaou in 
branch 'master':
bpo-40246: Report a better error message for invalid string prefixes (GH-19476)
https://github.com/python/cpython/commit/41d5b94af44e34ac05d4cd57460ed104ccf96628


--

___
Python tracker 

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



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Ray Donnelly  added the comment:

See my proposed patch. I am happy to make a PR on github for this too if people 
agree it's the right fix.

--
Added file: 
https://bugs.python.org/file49056/-bpo-26903-Limit-ProcessPoolExecutor-to-61-workers-on-Windows.patch.ref

___
Python tracker 

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



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


New submission from Ray Donnelly :

See attached reproducer

--
components: Interpreter Core, Windows
files: ppe.py
messages: 366258
nosy: Ray Donnelly, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Follow on bug from https://bugs.python.org/issue26903 (ValueError 
exception on _winapi.WaitForMultipleObjects)
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file49055/ppe.py

___
Python tracker 

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



[issue40260] modulefinder traceback regression starting on Windows

2020-04-12 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +18841
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19488

___
Python tracker 

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



[issue40262] SSL recv_into requires the object to implement __len__ unlike socket one

2020-04-12 Thread tzickel


New submission from tzickel :

I am writing this as a bug, as I have an object which implements the buffer 
protocol but not the __len__.

SSL's recv_into seems to require the buffer object to implement __len__, but 
this is unlike the socket recv_into which uses the buffer protocol length.

Here is the socket.recv_into implementation:
https://github.com/python/cpython/blob/402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527/Modules/socketmodule.c#L3556

as you can see, the length is optional, and it not given, it takes it from the 
buffer protocol length.

But here is SSL recv_into implementation:
https://github.com/python/cpython/blob/master/Lib/ssl.py#L1233

if length is not given, it tries to call the __len__ of the object itself (not 
it's buffer protocol).

--
assignee: christian.heimes
components: SSL
messages: 366257
nosy: christian.heimes, tzickel
priority: normal
severity: normal
status: open
title: SSL recv_into requires the object to implement __len__ unlike socket one
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

Thanks for the fix, Oren!

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 096e41aa4e558b28b7260fe01eb21414b1458b20 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-31758: Prevent crashes when using an uninitialized 
_elementtree.XMLParser object (GH-3997) (GH-19487)
https://github.com/python/cpython/commit/096e41aa4e558b28b7260fe01eb21414b1458b20


--

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2020-04-12 Thread Jeffery To


Change by Jeffery To :


--
nosy: +jefferyto

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18840
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/19487

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-04-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

Let's add it to the last bug fix release of 3.7 as well. It fixes a crash bug, 
after all.

--
stage: patch review -> backport needed
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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18839
pull_request: https://github.com/python/cpython/pull/19486

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 61511488cf4e7a1cb57a38efba7e0a84a387fe58 by Miss Islington (bot) 
in branch '3.8':
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser 
object (GH-3997) (GH-19485)
https://github.com/python/cpython/commit/61511488cf4e7a1cb57a38efba7e0a84a387fe58


--

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +18838
pull_request: https://github.com/python/cpython/pull/19485

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527 by Oren Milman in branch 
'master':
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser 
object (GH-3997)
https://github.com/python/cpython/commit/402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527


--

___
Python tracker 

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



[issue13743] xml.dom.minidom.Document class is not documented

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

A first PR was applied, but I'll leave this ticket open since it changes 
nothing for the "Document" class. :)

--
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.5, 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



[issue40255] Fixing Copy on Writes from reference counting

2020-04-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue13743] xml.dom.minidom.Document class is not documented

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 63e5b59c06fc99f95d274e7f181296e094cc3ee7 by Alex Itkes in branch 
'master':
bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355)
https://github.com/python/cpython/commit/63e5b59c06fc99f95d274e7f181296e094cc3ee7


--
nosy: +scoder

___
Python tracker 

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



[issue40259] re.Scanner groups

2020-04-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Copy paste of the contents in the text file

In the re module there is an experimental feature called Scanner.
Some unexpected behavior was found while working with it.
Here is an example:

>>> re.Scanner([('\w+=(\d+);', lambda s,g: s.match.group(1))]).scan('x=5;')
(['5;'], '')

The obvious error is the semicolon returned via capturing group 1.

Adding a dummy rule at the beginning, seems to solve that issue:

>>> re.Scanner([('z', None), ('\w+=(\d+);', lambda s,g: 
>>> s.match.group(1))]).scan('x=5;')
(['5'], '')

Adding a capturing group around \w+ also returns the correct answer:

>>> re.Scanner([('z', None), ('(\w+)=(\d+);', lambda s,g: 
>>> s.match.group(1))]).scan('x=5;')
(['x'], '')

But then, if I ask for the second group, the problem appears again:

>>> re.Scanner([('z', None), ('(\w+)=(\d+);', lambda s,g: 
>>> s.match.group(2))]).scan('x=5;')
(['5;'], '')

--

___
Python tracker 

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



[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

This has been pending for a while too long, but the fixes look good to me. They 
should still go at least into Py3.8 and later.

--
versions: +Python 3.8, Python 3.9 -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



[issue32476] Add concat functionality to ElementTree xpath find

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

I think the use case of quote escaping is too niche for a feature like 
concat(), where I (at least) would expect to be able to dynamically concatenate 
text content, not just constant strings.

There seem to be at least a few alternatives to the usage of concat():

https://stackoverflow.com/questions/12403870/how-to-escape-single-quote-in-xslt-substring-function

https://sqa.stackexchange.com/questions/26341/how-to-write-xpath-if-i-have-apostrophe-in-my-xpath-element

I think we should either implement concat() completely, or provide a different 
way to solve the concrete problem at hand.

--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue24341] Test suite emits many DeprecationWarnings about sys.exc_clear() when -3 is enabled

2020-04-12 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2 is EOL.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

Also see the later fix in issue 39011, where the EOL normalisation in attribute 
text was removed again. This change was applied in Py3.9.

--

___
Python tracker 

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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-04-12 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac by mefistotelis in 
branch 'master':
bpo-39011: Preserve line endings within ElementTree attributes (GH-18468)
https://github.com/python/cpython/commit/5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac


--

___
Python tracker 

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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-04-12 Thread Stefan Behnel


Change by Stefan Behnel :


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



[issue11395] print(s) fails on Windows with long strings

2020-04-12 Thread Eryk Sun


Eryk Sun  added the comment:

> the problem (or at least with these numbers) occurs only when 
> the code is saved in a script, and this is run by double-
> clicking the file

The .py file association is probably using a different version of Python, or 
it's associated with the py launcher and there's a shebang in the file that 
runs 2.7. Verify the version that's executing the script. If it's running in 
3.7, follow up in a new issue or on python-list. Please do not follow up on 
this resolved issue. Also, please try to reproduce the issue on a supported, 
updated system. Windows Vista is not supported by 3.7, and the latest 3.7 
release is 3.7.7.

--

___
Python tracker 

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



[issue37985] WFERR_UNMARSHALLABLE breaks recursion limit

2020-04-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-04-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8f87eefe7f0576c05c488874eb9601a7a87c7312 by Serhiy Storchaka in 
branch 'master':
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. 
(GH-19472)
https://github.com/python/cpython/commit/8f87eefe7f0576c05c488874eb9601a7a87c7312


--

___
Python tracker 

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



[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

3.5 and 3.6 are in security fixes only mode, and this issue is not a security 
issue. After merging PR 19484 I cannot reproduce the original issue anymore.

I left this issue open for the case if I find a way to write tests for the 
merged changes.

--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue40065] py39: remove deprecation note for xml.etree.cElementTree

2020-04-12 Thread Cajetan Rodrigues


Cajetan Rodrigues  added the comment:

For the record, I submitted a fix to the dependent:

https://github.com/boto/botocore/pull/2015

--
nosy: +Cajetan Rodrigues

___
Python tracker 

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



[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ee249d798ba08f065efbf4f450880a446c6ca49d by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) 
(GH-19483)
https://github.com/python/cpython/commit/ee249d798ba08f065efbf4f450880a446c6ca49d


--

___
Python tracker 

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



[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4057e8f9b56789223a1e691d7601003aceb84ad1 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) 
(GH-19484)
https://github.com/python/cpython/commit/4057e8f9b56789223a1e691d7601003aceb84ad1


--

___
Python tracker 

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



[issue40253] Fix .py(w) file association with Pyhon 3 Windows installer

2020-04-12 Thread Eryk Sun


Eryk Sun  added the comment:

> I understand that py.exe is at least in part used to make handling 
> multiple python versions easier. 

On the command line the launcher supports multiple installed versions via the 
"-X[.Y][-32|-64]" option. In scripts it supports multiple versions via virtual 
shebangs, e.g. "#!python3.8-32". But shebangs can also use fully-qualified 
Windows paths, which allows directly running a script in a particular virtual 
environment, e.g. "#!C:\VEnv\SparkEnv\Scripts\python.exe". Without the 
launcher, the .py file association is locked on a single Python installation.

> I don't find py.exe. Should it be installed besides python.exe? 
> If not, where else? 

If installed for all users, the py launcher is in the Windows directory. 
Otherwise it's in the user's local application data in the directory 
"%LocalAppData%\Programs\Python\Launcher".

Try repairing the installation to ensure the py launcher is installed, 
preferably for all users if you have admin access.

--

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2020-04-12 Thread Adam Bartoš

Adam Bartoš  added the comment:

I've been hit by this issue recently. On my configuration, print("a" * 10215) 
fails with an infinite loop of OSErrors (WinError 8). This even cannot by 
interrupted with Ctrl-C nor the exception can be catched.

- print("a" * 10214) is fine
- print("a" * 10215) is fine when preceeded by print("b" * 2701), but not when 
preceeded by print("b" * 2700)
- the problem (or at least with these numbers) occurs only when the code is 
saved in a script, and this is run by double-clicking the file (i.e. run by 
Windows ShellExecute I guess), not by "py test.py" or interactively.

My configuration is Python 3.7.3 64 bit on Windows Vista 64 bit. I wonder if 
anyone is able to reproduce this on their configuration.

--
nosy: +Drekin

___
Python tracker 

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



[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18837
pull_request: https://github.com/python/cpython/pull/19484

___
Python tracker 

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



[issue37985] WFERR_UNMARSHALLABLE breaks recursion limit

2020-04-12 Thread hai shi


hai shi  added the comment:

If I understand correctly, `p->depth--` associated with `p->error` could be 
removed?

--

___
Python tracker 

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



[issue37985] WFERR_UNMARSHALLABLE breaks recursion limit

2020-04-12 Thread hai shi


Change by hai shi :


--
keywords: +patch
nosy: +shihai1991
nosy_count: 2.0 -> 3.0
pull_requests: +18836
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19482

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-12 Thread Christian Heimes


Christian Heimes  added the comment:

The PR broke backwards compatibility with OpenSSL 1.0.2 and LibreSSL. OpenSSL 
1.1.x introduced new error codes or reused existing numbers for different 
errors codes.

Although OpenSSL 1.0.2 has reached EOL we should keep keep Python 3.8 and 3.9 
compatible with the API.

--
nosy: +lukasz.langa
priority: normal -> release blocker
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



[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18835
pull_request: https://github.com/python/cpython/pull/19483

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Ruben  added the comment:

Sorry, the error was missing, well, the actual error: 

```
/opt/local/bin/ranlib: file: libpython3.8.a(dynamic_annotations.o) has no 
symbols
/opt/local/bin/ranlib: file: libpython3.8.a(pymath.o) has no symbols
gcc -Wl,-stack_size,100  -framework CoreFoundation -o python.exe 
Programs/python.o libpython3.8.a -ldl   -framework CoreFoundation
gcc -Wl,-stack_size,100  -framework CoreFoundation -o 
Programs/_testembed Programs/_testembed.o libpython3.8.a -ldl   -framework 
CoreFoundation
./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
 CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup' OPT='-DNDEBUG -g 
-fwrapv -O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python.exe -E 
./setup.py  build
running build
running build_ext
error: [Errno 2] No such file or directory: 
'/usr/local/include/python3.8/pyconfig.h'
```

--

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Change by Ruben :


Added file: https://bugs.python.org/file49053/make.log.gz

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Change by Ruben :


Added file: https://bugs.python.org/file49054/make.venv.log.gz

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Change by Ruben :


Added file: https://bugs.python.org/file49052/make.venv.log.gz

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


Change by Ruben :


Added file: https://bugs.python.org/file49051/make.py.venv2.log.gz

___
Python tracker 

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



[issue40261] Build of Python where make is called from subprocess, within a virtualenv, breaks on macOS

2020-04-12 Thread Ruben


New submission from Ruben :

This problem is driving me crazy. I'm working with a library 
(python-for-android) that builds python during a build process. 

Now, during this process, the classical workflow with `./configure` and `make` 
is being called from a subprocess. To try to isolate the issue, I call `make` 
to build Python from a file, let's call it `make.py`, in the source tree, where 
I simply do (after running `./configure`, manually or from a subprocess):

```
import subprocess; 
subprocess.run(["make", "-j8"])
```

I get the following error: 

```
/opt/local/bin/ranlib: file: libpython3.8.a(dynamic_annotations.o) has no 
symbols
/opt/local/bin/ranlib: file: libpython3.8.a(pymath.o) has no symbols
gcc -Wl,-stack_size,100  -framework CoreFoundation -o python.exe 
Programs/python.o libpython3.8.a -ldl   -framework CoreFoundation
gcc -Wl,-stack_size,100  -framework CoreFoundation -o 
Programs/_testembed Programs/_testembed.o libpython3.8.a -ldl   -framework 
CoreFoundation
./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
 CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup' OPT='-DNDEBUG -g 
-fwrapv -O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python.exe -E 
./setup.py  build
```

Is this a bug of my OS, my env configuration, venv/virtualenv, Python makefile 
or, most probably, myself? 

I attached the log files from the following runs: 
- make from the shell without virtualenv (`make.log`)
- make from shell within virtualenv (`make.venv.log`)
- make from python subprocess without virtualenv (`make.py.log`)
- make from python subprocess within a virtualenv creted with pew 
(`make.py.venv.log)
- make from python subprocess within a virtualenv created with venv 
(`make.py.venv2.log`)

My system details:

macOS 10.15.4

Steps to reproduce: 

1. Download Python-3.8.2
2. Extract the tgz
3. Run ./configure
4. cat `make.py` in the source tree where `make.py` is:
```
import subprocess

subprocess.run(["env"])
subprocess.run(["make", "-j8"])
```
5. Run python make.py

--
components: Installation, macOS
files: make.py.venv.log.gz
messages: 366232
nosy: ned.deily, rdbisme, ronaldoussoren
priority: normal
severity: normal
status: open
title: Build of Python where make is called from subprocess, within a 
virtualenv, breaks on macOS
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file49050/make.py.venv.log.gz

___
Python tracker 

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



[issue40221] Use new _at_fork_reinit() lock method in multiprocessing

2020-04-12 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40253] Fix .py(w) file association with Pyhon 3 Windows installer

2020-04-12 Thread virtualnobi

virtualnobi  added the comment:

Eryk, I installed from python.org (didn't even know that it would be available 
from Microsoft Store). 

Nevertheless, I don't find py.exe. Should it be installed besides python.exe? 
If not, where else? 

I understand that py.exe is at least in part used to make handling multiple 
python versions easier. As I planned to only have one version (which might have 
been a bad idea in hindsight :-(  I might have unchecked any option that 
sounded like this... 

Danke & Grüße von nobi

--

___
Python tracker 

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



[issue40260] modulefinder traceback regression starting on Windows

2020-04-12 Thread SilentGhost


Change by SilentGhost :


--
nosy: +brandtbucher
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-04-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Inheritance of docstrings was added in issue15582. It works good for class 
members, but I now realized that doing it for class itself was a mistake. For 
example:

>>> import wave
>>> help(wave.Error)
Help on class Error in module wave:

class Error(builtins.Exception)
 |  Common base class for all non-exit exceptions.
 |  
 |  Method resolution order:
 |  Error
 |  builtins.Exception
 |  builtins.BaseException
 |  builtins.object
 |  
...

I fixed many similar issues by adding docstrings to classes, but there are even 
more exception classes and other classes in the stdlib for which help() gives 
incorrect description. I don't remember a single case when inheritance of the 
docstring was helpful.

Note that help() outputs the list of base class right after the docstring, so 
it is not hard to give an additional information, especially in interactive 
browser mode. If you want to inherit a docstring, you can do it explicitly:

__doc__ = BaseClass.__doc__

--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-04-12 Thread hai shi

hai shi  added the comment:

Got some compiling error of _ssl extension module in my vm after PR19082 merged:
building '_ssl' extension
gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -fPIC -I./Include 
-I. -I/usr/local/include -I/temp/shihai/cpython/Include -I/temp/shihai/cpython 
-c /temp/shihai/cpython/Modules/_ssl.c -o 
build/temp.linux-x86_64-3.9-pydebug/temp/shihai/cpython/Modules/_ssl.o
In file included from /temp/shihai/cpython/Modules/_ssl.c:136:
/temp/shihai/cpython/Modules/_ssl_data.h:6:15: error: ‘ERR_LIB_ASYNC’ 
undeclared here (not in a function); did you mean ‘ERR_LIB_ASN1’?
6 | {"ASYNC", ERR_LIB_ASYNC},
  |   ^
  |   ERR_LIB_ASN1
/temp/shihai/cpython/Modules/_ssl_data.h:13:12: error: ‘ERR_LIB_CT’ undeclared 
here (not in a function); did you mean ‘ERR_LIB_CMS’?
   13 | {"CT", ERR_LIB_CT},
  |^~
  |ERR_LIB_CMS
/temp/shihai/cpython/Modules/_ssl_data.h:19:13: error: ‘ERR_LIB_KDF’ undeclared 
here (not in a function); did you mean ‘ERR_LIB_BUF’?
   19 | {"KDF", ERR_LIB_KDF},
  | ^~~
  | ERR_LIB_BUF
In file included from /temp/shihai/cpython/Modules/_ssl.c:136:
/temp/shihai/cpython/Modules/_ssl_data.h:598:28: warning: initialization of 
‘int’ from ‘struct py_ssl_library_code *’ makes integer from pointer without a 
cast [-Wint-conversion]
  598 | {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101},
  |^
/temp/shihai/cpython/Modules/_ssl_data.h:598:28: note: (near initialization for 
‘error_codes[112].library’)
/temp/shihai/cpython/Modules/_ssl_data.h:598:28: error: initializer element is 
not constant
/temp/shihai/cpython/Modules/_ssl_data.h:598:28: note: (near initialization for 
‘error_codes[112].library’)
/temp/shihai/cpython/Modules/_ssl_data.h:603:32: warning: initialization of 
‘int’ from ‘struct py_ssl_library_code *’ makes integer from pointer without a 
cast [-Wint-conversion]
  603 | {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 102},

--
nosy: +shihai1991

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-04-12 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

FWIW I like the idea. There are many objects in typing module that are not 
classes, it would be great to display docs for them.

--

___
Python tracker 

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



[issue40260] modulefinder traceback regression starting on Windows

2020-04-12 Thread Barry Alan Scott


New submission from Barry Alan Scott :

modulefinder.py does not open source files in "rb" which
prevents compile() from applying the encoding rules.

This first showed up for me on Windows with Python 3.8.

Here is my test case and the results on Windows with 3.8.

import modulefinder

with open('import_functools.py', 'w') as f:
   f.write('import functools\n')

mf = modulefinder.ModuleFinder()
mf.run_script('import_functools.py')
print('Test passed')

py -3.8-32 modulefinder_test.py
Traceback (most recent call last):
 File "modulefinder_test.py", line 7, in 
   mf.run_script('import_functools.py')
 File "C:\Python38.win32\lib\modulefinder.py", line 165, in run_script
   self.load_module('__main__', fp, pathname, stuff)
 File "C:\Python38.win32\lib\modulefinder.py", line 360, in load_module
   self.scan_code(co, m)
 File "C:\Python38.win32\lib\modulefinder.py", line 433, in scan_code
   self._safe_import_hook(name, m, fromlist, level=0)
 File "C:\Python38.win32\lib\modulefinder.py", line 378, in _safe_import_hook
   self.import_hook(name, caller, level=level)
 File "C:\Python38.win32\lib\modulefinder.py", line 177, in import_hook
   q, tail = self.find_head_package(parent, name)
 File "C:\Python38.win32\lib\modulefinder.py", line 233, in find_head_package
   q = self.import_module(head, qname, parent)
 File "C:\Python38.win32\lib\modulefinder.py", line 326, in import_module
   m = self.load_module(fqname, fp, pathname, stuff)
 File "C:\Python38.win32\lib\modulefinder.py", line 343, in load_module
   co = compile(fp.read()+'\n', pathname, 'exec')
 File "C:\Python38.win32\lib\encodings\cp1252.py", line 23, in decode
   return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 308: 
character maps to 

Barry

--
components: Library (Lib)
messages: 366227
nosy: barry-scott
priority: normal
severity: normal
status: open
title: modulefinder traceback regression starting on Windows
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue40259] re.Scanner groups

2020-04-12 Thread Dennis Chronopoulos


Change by Dennis Chronopoulos :


Added file: https://bugs.python.org/file49049/re.Scanner.txt

___
Python tracker 

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



[issue40259] re.Scanner groups

2020-04-12 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Please add a description of the issue you are facing with a simple script of 
the behavior.

--
nosy: +xtreak

___
Python tracker 

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



[issue40259] re.Scanner groups

2020-04-12 Thread Dennis Chronopoulos


Change by Dennis Chronopoulos :


--
components: Regular Expressions
nosy: dchron, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.Scanner groups
type: behavior
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