[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Ned Deily


Ned Deily  added the comment:

Issue40370 documents test_peg_generator breakage on an AIX buildbot.

--

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-22 Thread Ned Deily


Ned Deily  added the comment:

It looks like the newly added test_peg_gemerator tries to build C code at run 
time as part of executing the test.  So most likely the test is not invoking 
distutils with the same set of options and/or environment variable values that 
the main Python setup.py does when building standard library C extension 
modules at Python build time.  Pablo?

--
nosy: +ned.deily
priority: normal -> high

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-22 Thread Ned Deily


Change by Ned Deily :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37626] Documentation:conflict between docs

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

I don't think they are conflict.

"now required to have a valid name."
"were allowed to have name set to None [snip]  This is no longer permitted."

"None" is not "valid name".

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-22 Thread Michael Felt


New submission from Michael Felt :

As part, I assume, of PR19503, that includes 91 changed files with 27,058 
additions and 147 deletions the AIX buildbot is broken.

Rather than looking/finding Modules/ld_so_aix (where I expect it to be) tests 
are failing, ulitmately because they look/expect it to be in a new location, 
and with a name dependent on being debug (or not) as the bots are configured 
using --pydebug.

Examples:
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/target/lib/python3.9/config-3.9d/ld_so_aix'

or

FileNotFoundError: [Errno 2] No such file or directory: 
'/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/target/lib/python3.9/config-3.9d/ld_so_aix'

This is (only?) in test_peg_generator.

One traceback example:
Captured traceback
==

Traceback (most recent call last):
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_peg_generator/test_c_parser.py",
 line 174, in test_nasty_mutually_left_recursive
self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, 
invalid_cases)
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_peg_generator/test_c_parser.py",
 line 40, in check_input_strings_for_grammar
extension = generate_parser_c_extension(grammar, Path(tmp_path))
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Tools/peg_generator/pegen/testutil.py",
 line 95, in generate_parser_c_extension
extension_path = compile_c_extension(str(source), build_dir=str(path / 
"build"))
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Tools/peg_generator/pegen/build.py",
 line 73, in compile_c_extension
cmd.run()
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/command/build_ext.py",
 line 340, in run
self.build_extensions()
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/command/build_ext.py",
 line 449, in build_extensions
self._build_extensions_serial()
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/command/build_ext.py",
 line 474, in _build_extensions_serial
self.build_extension(ext)
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/command/build_ext.py",
 line 551, in build_extension
self.compiler.link_shared_object(
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/ccompiler.py",
 line 713, in link_shared_object
self.link(CCompiler.SHARED_OBJECT, objects,
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/unixccompiler.py",
 line 204, in link
self.spawn(linker + ld_args)
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/ccompiler.py",
 line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/distutils/spawn.py",
 line 74, in spawn
proc = subprocess.Popen(cmd, env=env)
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/subprocess.py", 
line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File 
"/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/Lib/subprocess.py", 
line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/target/lib/python3.9/config-3.9d/ld_so_aix'

See https://buildbot.python.org/all/#builders/119/builds/720 and 
https://buildbot.python.org/all/#builders/227/builds/723

--
components: Build, Tests
messages: 367081
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: AIX: ld_so_aix not found during test of test_peg_generator
type: behavior
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



[issue38784] ip_network does not clear/update the broadcast_address cache when network_address is changed.

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

I close this issue as rejected.
If you have opinion about this issue, please post to python-dev mailing list
or discuss.python.org.

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

___
Python tracker 

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



[issue37846] declare that Text I/O use buffer inside

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

I still think it's too detailed.
Reading C and Python code is much better way to understand such implementation 
detail.

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

___
Python tracker 

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



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

Fixed via GH-18663.

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



[issue40346] Add random.BaseRandom to ease implementation of subclasses

2020-04-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This is a breaking change.  The published API says that random() is the base 
method and that getrandbits() is optional.

It is not okay to flat out ignore the opposing comments from the module 
maintainers.  Being on the steering committee isn't a license to do whatever 
you want, ignoring published APIs, breaking user code, and ignoring other 
contributors.  If you want to go forward with this, there should be a PEP (and 
you should be recused from adjudicating it).

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Those warnings are legitimate: we cannot cast function pointers that have 
different return types from one to the other. This only happens in the test, 
but could happen in the grammar if we use lookahead with NAME (&NAME).

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-22 Thread Dong-hee Na


Change by Dong-hee Na :


--
assignee:  -> corona10
type:  -> performance

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> test_peg_generator emits compiler warnings:

This is fixed by https://github.com/python/cpython/pull/19672

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-22 Thread Dong-hee Na


New submission from Dong-hee Na :

Since PEP 560 was approved,
The following syntax has become available. 

from queue import Queue
v = Queue[int]

It's a very shiny feature.
Given the direction of programming language, it's probably a very useful 
feature that users will use very often in the near future.

When I looked at Object/geneticiasobject.c, the current implementation is a 
very good condition for using the vectorcall proposed by PEP590 .

The benchmarks are as follows.
So I suggest using vectorcall in GenericAlias.

if the suggestion is accepted, I 'd like to summit the patch :)


++--+-+
| Benchmark  | master-generic-alias | proposed-generic-alias  |
++==+=+
| bench GenericAlias | 143 ns   | 111 ns: 1.29x faster (-22%) |
++--+-+

--
components: Interpreter Core
files: bench_generic_alias.py
messages: 367074
nosy: corona10, gvanrossum, vstinner
priority: normal
severity: normal
status: open
title: Use PEP 590 vectorcall to speed up GenericAlias.
versions: Python 3.9
Added file: https://bugs.python.org/file49087/bench_generic_alias.py

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ee40e4b8563e6e1bc2bfb267da5ffc9a2293318d by Pablo Galindo in 
branch 'master':
bpo-40334: Don't downcast from Py_ssize_t to int (GH-19671)
https://github.com/python/cpython/commit/ee40e4b8563e6e1bc2bfb267da5ffc9a2293318d


--

___
Python tracker 

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



[issue40361] Darwin systems using win settings for webbrowser.py

2020-04-22 Thread Éric Araujo

Éric Araujo  added the comment:

xdg-settings is a program used on linux systems, not windows.  Also it is an 
executable file, not a directory, so something weird is going on.

Could you diagnose more?  The proposed PR does not seem to make sense: platform 
can’t be both darwin and win32/nt.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18996
pull_request: https://github.com/python/cpython/pull/19672

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Ned Deily


Ned Deily  added the comment:

> These are expected. Is this a problem?

People and bots running tests normally expect to not see any output from each 
test in the default case unless there are errors.  If these are supposed to be 
emitted, we should find a way to hide them (and check the results, if 
necessary) unless a verbose option is selected.  Personally, I wouldn't 
consider that a showstopper for a6 but as something to be fixed by b1.

--

___
Python tracker 

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



[issue40361] Darwin systems using win settings for webbrowser.py

2020-04-22 Thread Viraat Das


Viraat Das  added the comment:

When loading Jupyter Notebook, a NotADirectoryError: [Errno 20] Not a 
directory: 'xdg-settings' error was showing. This seems to be because Darwin 
systems were using Win settings. 

The pull request has addressed this by modifying the webbrowser.py code.

--
keywords: +patch
message_count: 1.0 -> 2.0
pull_requests: +18995
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19649

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18994
pull_request: https://github.com/python/cpython/pull/19671

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Wade Sanchez


Change by Wade Sanchez :


--
type:  -> resource usage

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> test_peg_generator emits compiler warnings

These are expected. Is this a problem?

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread STINNER Victor

STINNER Victor  added the comment:

test_peg_generator emits compiler warnings:

https://buildbot.python.org/all/#/builders/612/builds/283

0:08:01 load avg: 1.40 [423/423/1] test_peg_generator passed (7 min 4 sec)
/tmp/tmp0vbqe8gp/parse.c: In function ‘start_rule’:
/tmp/tmp0vbqe8gp/parse.c:32:35: warning: passing argument 2 of 
‘_PyPegen_lookahead’ from incompatible pointer type 
[-Wincompatible-pointer-types]
   32 | _PyPegen_lookahead(1, _PyPegen_name_token, p)
  |   ^~~
  |   |
  |   struct _expr * (*)(Parser *)
In file included from /tmp/tmp0vbqe8gp/parse.c:2:
/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-aarch64.lto-pgo/build/Parser/pegen/pegen.h:90:36:
 note: expected ‘void * (*)(Parser *)’ but argument is of type ‘struct _expr * 
(*)(Parser *)’
   90 | int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *);
  | ~~~^~~
/tmp/tmp54o68k3n/parse.c: In function ‘start_rule’:
/tmp/tmp54o68k3n/parse.c:32:35: warning: passing argument 2 of 
‘_PyPegen_lookahead’ from incompatible pointer type 
[-Wincompatible-pointer-types]
   32 | _PyPegen_lookahead(0, _PyPegen_name_token, p)
  |   ^~~
  |   |
  |   struct _expr * (*)(Parser *)
In file included from /tmp/tmp54o68k3n/parse.c:2:
/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-aarch64.lto-pgo/build/Parser/pegen/pegen.h:90:36:
 note: expected ‘void * (*)(Parser *)’ but argument is of type ‘struct _expr * 
(*)(Parser *)’
   90 | int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *);
  | ~~~^~~

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)

This change removes sys.flags.use_peg which was only used in tests. If someone 
sees a good reason, we may add it back. In the meanwhile, 
test.support.use_old_parser() can be used.

I didn't like the idea of having a new sys.flags.use_peg flag appears in 3.9 
but disappears in 3.10.

FYI sys.flags still supports the tuple API! Example:

>>> sys.flags[9]
0

I have no idea what is this 10th member of sys.flags :-)

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1def7754b7a41fe57efafaf5eff24cfa15353444 by Victor Stinner in 
branch 'master':
bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
https://github.com/python/cpython/commit/1def7754b7a41fe57efafaf5eff24cfa15353444


--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

While array('u') doesn't use deprecated API with GH-19653, I still don't like 
'u' because:

* I don't have any reason to use platform dependant wchar_t. [1]
* It is not consistent with PEP-3118.

[1]: https://mail.python.org/pipermail/python-dev/2019-March/156807.html

How about this plan?

* Add 'w' for Py_UCS4.
* Deprecate 'u', and remove it in the future.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a25f3c4c8f7d4878918ce1d3d67db40ae255ccc6 by Pablo Galindo in 
branch 'master':
bpo-40334: Fix builds outside the source directory and regenerate autoconf 
files (GH-19667)
https://github.com/python/cpython/commit/a25f3c4c8f7d4878918ce1d3d67db40ae255ccc6


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18993
pull_request: https://github.com/python/cpython/pull/19668

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +18991
pull_request: https://github.com/python/cpython/pull/19669

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18992
pull_request: https://github.com/python/cpython/pull/19670

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18990
pull_request: https://github.com/python/cpython/pull/19667

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Looks like the build changes do not work with a build directory outside of 
> the source directory:

Opened https://github.com/python/cpython/pull/19667. Ned, could you review?

--

___
Python tracker 

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



[issue40366] Remove support for obsolete flags in compile function

2020-04-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
title: Start giving deprecation warnings for obsoleted flags in compile -> 
Remove support for obsolete flags in compile function

___
Python tracker 

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



[issue40366] Start giving deprecation warnings for obsoleted flags in compile

2020-04-22 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

As suggestion of @vstinner, instead of deprecation we decided to remove support 
for these flags immediately.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Ned Deily


Ned Deily  added the comment:

Looks like the build changes do not work with a build directory outside of the 
source directory:

mkdir build && cd build && ../configure && make

gcc -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv 
-O3 -Wall-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Wstrict-prototypes 
-Werror=implicit-function-declaration -fvisibility=hidden  
-I../Include/internal -IObjects -IInclude -IPython -I. -I../Include
-DPy_BUILD_CORE -o Parser/pegen/pegen.o ../Parser/pegen/pegen.c
error: unable to open output file 'Parser/pegen/pegen.o': 'No such file or 
directory'
1 error generated.
make: *** [Parser/pegen/pegen.o] Error 1

Lots of build processes depend on this, like for putting out a release.

--
nosy: +ned.deily

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666)

Pablo told me in private that he plans to add a buildbot worker to test the old 
parser. So this change is fine.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 458004bf7914f96b20bb76bc3584718cf83f652e by Pablo Galindo in 
branch 'master':
bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666)
https://github.com/python/cpython/commit/458004bf7914f96b20bb76bc3584718cf83f652e


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18989
pull_request: https://github.com/python/cpython/pull/19666

___
Python tracker 

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



[issue40346] Add random.BaseRandom to ease implementation of subclasses

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, PR 19631 is now ready for a review. I completed the documentation to better 
explain the rationale.

Copy of the What's New in Python 3.9 documentation:

"Add a new random.BaseRandom class: random number generator base class. A 
random.BaseRandom subclass must only implement a single method: getrandbits(), 
whereas a random.Random subclass must override 6 methods (getrandbits(), 
random(), randbytes(), seed(), getstate() and setstate())."

Copy of the commit message:

"BaseRandom implements random() and randbytes() using getrandbits().
It has no state and its gauss() method is thread safe. It has no
VERSION attribute and its seed() method has no version parameter.

The implementation of random.Random, random.SystemRandom and
random.Random subclasses are not affected by this change."

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18988
pull_request: https://github.com/python/cpython/pull/19664

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c5fc15685202cda73f7c3f5c6f299b0945f58508 by Pablo Galindo in 
branch 'master':
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
https://github.com/python/cpython/commit/c5fc15685202cda73f7c3f5c6f299b0945f58508


--

___
Python tracker 

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



[issue39939] PEP 616: Add str.removeprefix and str.removesuffix methods

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> This should be unrelated to the patch, right?

It's unrelated. It smells like bpo-39995.

--

___
Python tracker 

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



[issue39939] PEP 616: Add str.removeprefix and str.removesuffix methods

2020-04-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

There's a failure here:

https://buildbot.python.org/all/#/builders/64/builds/656

Failed subtests:
test_killed_child - 
test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest

Traceback (most recent call last):
...
OSError: [Errno 9] Bad file descriptor

This should be unrelated to the patch, right?

--

___
Python tracker 

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



[issue40368] os.path.realpath uppercases Windows drive letter on Python 3.8

2020-04-22 Thread Eryk Sun


Eryk Sun  added the comment:

> This behavior is inconsistent with `os.path.abspath` where it always 
> returns lowercased drive letter, 

ntpath.abspath calls GetFullPathNameW, which generally preserves the input case 
of the device/drive component. But it doesn't always preserve drive-letter 
case. In particular, a drive-relative path gets resolved with the upper-case 
drive letter:

>>> os.path.abspath('c:spam')
'C:\\Temp\\spam'

That's a corner case that maybe needs to be addressed for ntpath.abspath. 
However, regarding ntpath.realpath, I see no reason for it to preserve the 
input case. To the contrary, it should always make a best effort to normalize 
the input path to use the real device and component names and replace 8.3 short 
names with long names.

> and also causes a failure in Gecko build script: 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1628726

IMO, the bug there is using a case-insensitive path as a key without first case 
folding the string.

--
nosy: +eryksun

___
Python tracker 

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



[issue40368] os.path.realpath uppercases Windows drive letter on Python 3.8

2020-04-22 Thread Kagami Sascha Rosylight


New submission from Kagami Sascha Rosylight :

```
$ python3.7
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os;os.path.realpath('c:/')
'c:\\'
```

```
$ python3.8
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os;os.path.realpath('c:/')
'C:\\'
```

This behavior is inconsistent with `os.path.abspath` where it always returns 
lowercased drive letter, and also causes a failure in Gecko build script: 
https://bugzilla.mozilla.org/show_bug.cgi?id=1628726

--
messages: 367053
nosy: saschanaz
priority: normal
severity: normal
status: open
title: os.path.realpath uppercases Windows drive letter on Python 3.8
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



[issue39939] PEP 616: Add str.removeprefix and str.removesuffix methods

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

Well done Dennis Sweeney! You got a PEP approved and now the implementation is 
merged!

Maybe the documentation will need more reviews, but that can be done later. 

I prefer to get the implementation merged as soon as possible (it will likely 
be part of the next 3.9.0a6), so more users can play with it before 3.9.0 final 
release.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: PEP 616: Add str methods to remove prefix or suffix -> PEP 616: Add 
str.removeprefix and str.removesuffix methods

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Carl Meyer


Carl Meyer  added the comment:

I opened a PR. It deprecates the lib2to3 library to discourage future use of it 
for Python3, but not the 2to3 tool. This of course means that the lib2to3 
module will in practice stick around in the stdlib as long as 2to3 is still 
bundled with Python.

It seems like the idea in this issue is to deprecate and remove both. I'm not 
sure what we typically do to deprecate a command-line utility bundled with 
Python. Given warnings are silent by default, the deprecation warning for 
lib2to3 won't be visible to users of 2to3. Should I add something to its 
`--help` output? Or something more aggressive; an unconditionally-printed 
warning?

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

VIctor, you were very right about longjmp. See 
https://github.com/we-like-parsers/cpython/pull/119

--

___
Python tracker 

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



[issue39939] PEP 616: Add str methods to remove prefix or suffix

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a81849b0315277bb39372711745059c0b445 by sweeneyde in branch 
'master':
bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)
https://github.com/python/cpython/commit/a81849b0315277bb39372711745059c0b445


--

___
Python tracker 

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



[issue40367] ImportError: libffi.so.6

2020-04-22 Thread YoSTEALTH


New submission from YoSTEALTH :

>>> /opt/python/3.8.1/lib/python3 setup.py build_ext --inplace


Traceback (most recent call last):
  File "./setup.py", line 1, in 
from setuptools import setup, find_packages
  File "/opt/python/3.8.1/lib/python3.8/site-packages/setuptools/__init__.py", 
line 19, in 
from setuptools.dist import Distribution
  File "/opt/python/3.8.1/lib/python3.8/site-packages/setuptools/dist.py", line 
34, in 
from setuptools import windows_support
  File 
"/opt/python/3.8.1/lib/python3.8/site-packages/setuptools/windows_support.py", 
line 2, in 
import ctypes
  File "/opt/python/3.8.1/lib/python3.8/ctypes/__init__.py", line 7, in 
from _ctypes import Union, Structure, Array
ImportError: libffi.so.6: cannot open shared object file: No such file or 
directory



"libffi 3.3-3" on "5.6.5-3-MANJARO" is installed as:

/usr/lib/libffi.so
/usr/lib/libffi.so.7
/usr/lib/libffi.so.7.1.0
...


Maybe `_ctypes` should try to find "libffi.so" vs "libffi.so.6" ?

--
components: ctypes
messages: 367048
nosy: YoSTEALTH
priority: normal
severity: normal
status: open
title: ImportError: libffi.so.6
type: compile error

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Carl Meyer


Change by Carl Meyer :


--
pull_requests: +18987
pull_request: https://github.com/python/cpython/pull/19663

___
Python tracker 

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



[issue37157] shutil: add reflink=False to file copy functions to control clone/CoW copies (use copy_file_range)

2020-04-22 Thread desbma


Change by desbma :


--
nosy: +desbma

___
Python tracker 

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



[issue40366] Start giving deprecation warnings for obsoleted flags in compile

2020-04-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Eryk Sun


Eryk Sun  added the comment:

Note that the implementation of relpath is pure and thus assumes it's working 
with existing, resolved paths (i.e. "the filesystem is not accessed to confirm 
the existence or nature of path or start"). For example:

>>> os.path.relpath('/some/thing', '/symlink')
'../some/thing'

If "symlink" targets "/spam/eggs/foo", then the resolved path would be 
"/spam/eggs/some/thing" instead of "/some/thing". Maybe the relative_to method 
should default to a `strict` mode that raises ValueError on ambiguous cases 
that depend on the "existence or nature" of the paths. I think the current 
implementation is strict.

--
nosy: +eryksun

___
Python tracker 

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



[issue40366] Start giving deprecation warnings for obsoleted flags in compile

2020-04-22 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

We can start deprecating usage of obsoleted flags in compile and slowly remove 
support for them. An example would be CO_NESTED. 

https://github.com/python/cpython/blob/master/Python/bltinmodule.c#L748

--
messages: 367046
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Start giving deprecation warnings for obsoleted flags in compile
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



[issue40365] argparse: action "extend" with 1 parameter splits strings into characters

2020-04-22 Thread paul j3


paul j3  added the comment:

This is a consequence of Python's own definition of append vs extend

In [730]: alist = []
   
In [731]: alist.append('astring')   
   
In [732]: alist 
   
Out[732]: ['astring']
In [733]: alist.extend('astring')   
   
In [734]: alist 
   
Out[734]: ['astring', 'a', 's', 't', 'r', 'i', 'n', 'g']
In [735]: alist.extend(['astring']) 
   
In [736]: alist 
   
Out[736]: ['astring', 'a', 's', 't', 'r', 'i', 'n', 'g', 'astring']

Normally 'add_argument' doesn't check for valid parameters, but some Action 
subclasses do their own checking, 

'extend' inherits the nargs==0 test from 'append'. (extend just modifies the 
__call__, not the __init__ method.

But I wonder, was this situation discussed in the original bug/issue?

--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2020-04-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Should this issue be closed, possibly as superseded by #36346, the issue for 
the new PR-19653?

--

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-04-22 Thread Kyle Stanley


Change by Kyle Stanley :


--
assignee:  -> aeros

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-04-22 Thread Kyle Stanley


Kyle Stanley  added the comment:

Victor Stinner wrote:
> Is there someone interested to propose a PR for that?

I would be interested in looking into this, although I'm not entirely certain 
either as to how it should be tested at the moment. I'll have to look further 
into the existing ones.

--

___
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-22 Thread miss-islington


miss-islington  added the comment:


New changeset fc45cb4400409572f05c8b54f2c6f06cbefb1b4e by Miss Islington (bot) 
in branch '3.8':
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
https://github.com/python/cpython/commit/fc45cb4400409572f05c8b54f2c6f06cbefb1b4e


--

___
Python tracker 

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



[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Domenico Ragusa


Domenico Ragusa  added the comment:

Thanks for your answer. Yeah, I'm new, I'm reading the guide, sorry for any
faux pas :)

Ok, an option would be great as well, a simple True/False switch? Any
suggestion for the name?
I'll get back with a proper patch this time.

On Wed, Apr 22, 2020 at 8:18 PM Antoine Pitrou 
wrote:

>
> Antoine Pitrou  added the comment:
>
> The current behaviour is by design.  I would not mind adding an option to
> control it, though.
>
> If you are new to Python development and want to submit a patch or PR, I
> recommend reading the Developer's Guide:
> https://devguide.python.org/
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40365] argparse: action "extend" with 1 parameter splits strings into characters

2020-04-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger

___
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-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18985
pull_request: https://github.com/python/cpython/pull/19659

___
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-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset 39652cd8bdf7c82b7c6055089a4ed90ee546a448 by Anthony Sottile in 
branch 'master':
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
https://github.com/python/cpython/commit/39652cd8bdf7c82b7c6055089a4ed90ee546a448


--

___
Python tracker 

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



[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

I meant to add: it's possible that this isn't well documented.

--

___
Python tracker 

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



[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed that shlex.quote is working as intended. It's goal is to pass something 
to the shell, preserving it just as you started with it. It exists exactly 
because you want to avoid shell globbing and parsing issues (consider filenames 
that contain spaces and *'s).

--
nosy: +eric.smith

___
Python tracker 

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



[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

The current behaviour is by design.  I would not mind adding an option to 
control it, though.

If you are new to Python development and want to submit a patch or PR, I 
recommend reading the Developer's Guide:
https://devguide.python.org/

--

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue40361] Darwin systems using win settings for webbrowser.py

2020-04-22 Thread Éric Araujo

New submission from Éric Araujo :

Hello!  You didn’t give any information about the problem you found :)

--
components: +Library (Lib) -Distutils
nosy:  -dstufft
type:  -> behavior

___
Python tracker 

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



[issue39471] Meaning and clarification of PyBuffer_Release()

2020-04-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

Okay, no problems then.

We'll have to close that other PR now. Too bad nobody noticed it (or 
knew where to send it - I doubt modulefinder has an obvious owner).

--

___
Python tracker 

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



[issue35886] [C API] Make PyInterpreterState opaque: move it into the internal C API (internal/pycore_pystate.h)

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.8 was released in October 2019 with this change (PyInterpreterState 
structure is now opaque). Fedora 32 is going to be released soon with Python 
3.8 as /usr/bin/python. The change only broke very few projets: cffi (which 
indirectly broke brotlipy and httpbin), Blender, FreeBSD. Fixes are trivial:

* Replace "interp->modules" with PyImport_GetModuleDict()
* Replace "interp->builtins" with PyEval_GetBuiltins()

I close the issue. Well done Eric!

--
components: +C API
resolution:  -> fixed
status: open -> closed
title: Move PyInterpreterState into Include/internal/pycore_pystate.h -> [C 
API] Make PyInterpreterState opaque: move it into the internal C API 
(internal/pycore_pystate.h)

___
Python tracker 

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



[issue40365] argparse: action "extend" with 1 parameter splits strings into characters

2020-04-22 Thread strjan


New submission from strjan :

When positional argument with action='extend' is given to parse only one string 
argument, the string is splitted into individual characters.

The problem occures, when no "nargs" is given; it makes sense that nargs is 
requiered, though at least notion in documentation would be nice, as the issue 
does not occure with action='append'

Minimal example included.

--
files: argparse_bug.py
messages: 367033
nosy: strjan
priority: normal
severity: normal
status: open
title: argparse: action "extend" with 1 parameter splits strings into characters
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49086/argparse_bug.py

___
Python tracker 

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



[issue39471] Meaning and clarification of PyBuffer_Release()

2020-04-22 Thread Sebastian Berg


Sebastian Berg  added the comment:

Ok, I will just close it. It is painfully clear that e.g. `mmap` uses it this 
way to prohibit closing, and also `memoryview` has all the machinery necessary 
to do counting of how many exports, etc. exists.

I admit, this still rubs me the wrong way, and I think it means that we may 
need to check `bf_releasebuffer != NULL` also in NumPy.

We still have the issue of not being able to use `releasebuffer` easily in 
NumPy. But there is nothing to be done, unless we can consider limiting the 
`"#s"`, etc. type argparsing, which is likely not an option.

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Carl Meyer


Carl Meyer  added the comment:

I volunteered in the python-dev thread to write a patch to the docs clarifying 
future status of lib2to3; happy to include the PendingDeprecationWarning as 
well.

Re linking to alternatives, we want to make sure we link to alternatives that 
are committed to updating to support newer Python versions' syntax. This 
definitely includes LibCST; I can inquire with the parso maintainer about 
whether it also includes parso. In future it could also include a 
third-party-maintained copy of lib2to3, if someone picks that up.

--
nosy: +carljm

___
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-22 Thread Anthony Sottile


Anthony Sottile  added the comment:

The trailing newline was added in 1.5.1 
78fc3634cbfd65a6be8abfd1b7fc7cbd0ccbfb39 -- back then `compile(...)` could not 
take strings which did not end in newlines

now it can, so it is safe to remove -- I did the same triage on another PR 
here: https://github.com/python/cpython/pull/17817

--

___
Python tracker 

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



[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> FWIW, I was hoping to the same for PyThreadState but it looks like 6 of its 
> fields are exposed in "stable" header files via the following macros: (...)

I created bpo-39947: "[C API] Make the PyThreadState structure opaque (move it 
to the internal C API)".

--

___
Python tracker 

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



[issue38360] single-argument form of -isysroot should be supported

2020-04-22 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue37339] os.path.ismount returns true on nested btrfs subvolumes

2020-04-22 Thread Eryk Sun


Eryk Sun  added the comment:

> What do you mean by "portable version of mountpoint"?

posixpath.ismount is based on a portable method to detect a mountpoint in Unix 
systems, since POSIX lacks a portable function for this. The implementation is 
simple. A symlink is never a mountpoint. Otherwise compare the lstat of the 
path and its parent directory. It's a mountpoint if the st_dev fields are 
different. If not, it's a mountpoint if the st_ino fields are the same (e.g. 
"/").

The portable method may fail in particular cases. For instance, a bind mount in 
the Linux kernel (not bindfs) doesn't create a new device. For example, given 
"/opt" is bound to "opt" in the current directory on the same filesystem, 
ismount returns a false negative:


>>> posixpath.ismount('opt')
False

But it's a mountpoint according to the "/proc/self/mountinfo" table:

>>> os.system('mountpoint opt')
opt is a mountpoint
0

The above false negative is documented, so a precedent exists to simply 
document the false positive with a btrfs subvolume. Developers can make of it 
what they will. If it matters to not count this case as a mountpoint, a script 
will have to implement its own platform-specific solution (e.g. use subprocess 
to call `mountpoint`).

--
nosy: +eryksun
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



[issue38360] single-argument form of -isysroot should be supported

2020-04-22 Thread miss-islington


miss-islington  added the comment:


New changeset 4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d by Miss Islington (bot) 
in branch '3.8':
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
https://github.com/python/cpython/commit/4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d


--

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

If we want to be strictly correct here, the fix should check the "mode" 
variable to determine the type. And given the fragility of the code being used 
here, there's no doubt some reliance on a trailing newline somewhere too.

I haven't bumped the categorisation, but at some level this is a security fix. 
All executable code is expected to be loaded through io.open_code(), and the 
fact that this didn't was a breach of that guarantee. There's a limit to how 
much we will accommodate people using it outside of what's documented.

Anthony, since you can apparently validate this, could you run through all the 
fixes necessary to keep that working? I want to stop this game of chasing, 
either by fixing everything in one go or by apologising for the breakage (the 
io.open_code() fix is staying).

--

___
Python tracker 

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



[issue32966] Python 3.7.2 - 0x80070643 - Fatal Error during installation

2020-04-22 Thread Steve Dower


Steve Dower  added the comment:

Your best bet is to repair the Python 3.7.2 install first (through Programs and 
Features, if possible), and then uninstall it.

Any idea why it's interfering with Python 3.8? That shouldn't be the case 
(unless it's PATH related, in which case yeah, that's more or less expected).

--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

The initial issue has been implemented: I added os.waitstatus_to_exitcode() 
function to Python 3.9. It's now well documented, I close the issue.

See sub-issues like bpo-40364 (asyncio) for further cleanups.

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

"""
TODO:
* Decide if subprocess should reject WIFSTOPPED() or not.
* Check if the pure Python implementation of os._spawnvef() handles 
WIFSTOPPED() properly.
"""

Well, let's keep the status quo: leave os and subprocess modules unchanged. It 
can be revisited later if needed. My intent when I created this issue wasn't to 
change the behavior of other modules, just to add a new function to remove 
duplicated code ;-)

--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> TODO: Modify asyncio.unix_events._compute_returncode() to use 
> waitstatus_to_exitcode(): need to update tests.

I created bpo-40364 for that.

--

___
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-22 Thread Anthony Sottile


Anthony Sottile  added the comment:

debian has its own implementation of find_modules which still returns a text 
file for PY_SOURCE

changing the type of that io object is the "breaking change" and maybe 
shouldn't be backported to python3.8 in a patch release

--

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-04-22 Thread STINNER Victor


New submission from STINNER Victor :

I added os.waitstatus_to_exitcode() in bpo-40094. I propose to replace 
_compute_returncode() with os.waitstatus_to_exitcode() in 
Lib/asyncio/unix_events.py to simplify the code *and* to raise an exception if 
asyncio gets an unexpected wait status from os.waitpid().

There is a comment which suggest to detect when asyncio gets an unexpected 
status, see the last comment of:

def _compute_returncode(status):
if os.WIFSIGNALED(status):
# The child process died because of a signal.
return -os.WTERMSIG(status)
elif os.WIFEXITED(status):
# The child process exited (e.g sys.exit()).
return os.WEXITSTATUS(status)
else:
# The child exited, but we don't understand its status.
# This shouldn't happen, but if it does, let's just
# return that status; perhaps that helps debug it.
return status

Replacing _compute_returncode() with os.waitstatus_to_exitcode() in 
Lib/asyncio/unix_events.py is trivial. The problem is to update 
Lib/test/test_asyncio/test_unix_events.py which uses tons of mocks on os.W*() 
functions (ex: os.WIFEXITED()).

I'm not sure how tests should be updated.

Is there someone interested to propose a PR for that?

--
components: Library (Lib), asyncio
messages: 367021
nosy: aeros, asvetlov, corona10, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()
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



[issue40138] Windows implementation of os.waitpid() truncates the exit status (status << 8)

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, os.waitpid() is now fixed in 3.7, 3.8 and master branches, and 
os.waitstatus_to_exitcode() is fixed in master.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-39562: Prevent collision of future and compiler flags (GH-19230)
> https://github.com/python/cpython/commit/4454057269b995341b04d13f0bf97f96080f27d0

I tested manually: this change fix my msg365311 reproducer. Thanks!

In Python 3.8, PyCF_ALLOW_TOP_LEVEL_AWAIT = CO_FUTURE_DIVISION = 0x2000. The 
commit 9052f7a41b90f2d34011c8da68f9a4facebc8a97 was backported to 3.8:

New changeset ec8a973f7cf080d9c0679f058b2371f0b7c7862c by Miss Islington (bot) 
in branch '3.8':
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL 
(GH-18968)
https://github.com/python/cpython/commit/ec8a973f7cf080d9c0679f058b2371f0b7c7862c

And now 3.8 branch also has the bug: msg365311 reproducer fails as well in 3.8.

What should be done? Revert ec8a973f7cf080d9c0679f058b2371f0b7c7862c? Change 
constants value in Python 3.8.3? (backport 
4454057269b995341b04d13f0bf97f96080f27d0 to 3.8)

IMHO reverting the commit ec8a973f7cf080d9c0679f058b2371f0b7c7862c (fix async 
comprehension in asyncio REPL) is the safest option.

First, I understood that the asyncio REPL was experimental in Python 3.8: 
https://bugs.python.org/issue37028

But it's not documented as provisional or experimental in What's New in Python 
3.8:
https://docs.python.org/dev/whatsnew/3.8.html#asyncio

But I'm also fine with backporting the fix 
4454057269b995341b04d13f0bf97f96080f27d0 (change constants) to 3.8.

--

___
Python tracker 

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



[issue38360] single-argument form of -isysroot should be supported

2020-04-22 Thread miss-islington


miss-islington  added the comment:


New changeset e7f8684ef77d280eb99b8533fd18455caa0fe194 by Miss Islington (bot) 
in branch '3.7':
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
https://github.com/python/cpython/commit/e7f8684ef77d280eb99b8533fd18455caa0fe194


--

___
Python tracker 

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



[issue40138] Windows implementation of os.waitpid() truncates the exit status (status << 8)

2020-04-22 Thread miss-islington


miss-islington  added the comment:


New changeset de5dcfa3bcabf52e43468a2b088ed71b5e5c4503 by Miss Islington (bot) 
in branch '3.7':
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
https://github.com/python/cpython/commit/de5dcfa3bcabf52e43468a2b088ed71b5e5c4503


--

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscall in os module.

2020-04-22 Thread Benjamin Peterson


Change by Benjamin Peterson :


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



[issue38360] single-argument form of -isysroot should be supported

2020-04-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +18983
pull_request: https://github.com/python/cpython/pull/19657

___
Python tracker 

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



[issue38360] single-argument form of -isysroot should be supported

2020-04-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18984
pull_request: https://github.com/python/cpython/pull/19658

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-04-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 4454057269b995341b04d13f0bf97f96080f27d0 by Batuhan Taşkaya in 
branch 'master':
bpo-39562: Prevent collision of future and compiler flags (GH-19230)
https://github.com/python/cpython/commit/4454057269b995341b04d13f0bf97f96080f27d0


--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2020-04-22 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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18982
pull_request: https://github.com/python/cpython/pull/19656

___
Python tracker 

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-22 Thread Steve Dower


Steve Dower  added the comment:

Looks like that fix has done it. Thanks, Eryk!

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



[issue40214] test_ctypes.test_load_dll_with_flags Windows failure

2020-04-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9b498939009f49b8c772c89e8fc80efbfd8afcb5 by Steve Dower in branch 
'master':
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
https://github.com/python/cpython/commit/9b498939009f49b8c772c89e8fc80efbfd8afcb5


--

___
Python tracker 

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



[issue40138] Windows implementation of os.waitpid() truncates the exit status (status << 8)

2020-04-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b07350901cac9197aef41855d8a4d56533636b91 by Victor Stinner in 
branch '3.8':
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
https://github.com/python/cpython/commit/b07350901cac9197aef41855d8a4d56533636b91


--

___
Python tracker 

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



  1   2   >