[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc by Miss Islington (bot) 
in branch '3.8':
bpo-27115: Move IDLE Query error blanking (GH-18868)
https://github.com/python/cpython/commit/f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc


--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset 9d5ed8355d4cb73ab13fa6094c9ab57798dff3be by Miss Islington (bot) 
in branch '3.7':
bpo-27115: Move IDLE Query error blanking (GH-18868)
https://github.com/python/cpython/commit/9d5ed8355d4cb73ab13fa6094c9ab57798dff3be


--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +18227
pull_request: https://github.com/python/cpython/pull/18869

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e53a3932cb01683b0fa8a7448ca25a2e658c39e6 by Terry Jan Reedy in 
branch 'master':
bpo-27115: Move IDLE Query error blanking (GH-18868)
https://github.com/python/cpython/commit/e53a3932cb01683b0fa8a7448ca25a2e658c39e6


--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18228
pull_request: https://github.com/python/cpython/pull/18870

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +18226
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/18868

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

I have a nit on the commit message used here (and also in issue 39885). 
*Please* don't use this style of commit message "IDLE context menu clears 
selection". That phrasing sounds like it is the description of a bug. Please 
always use a phrasing that makes it clear what the commit/PR changes. In this 
case, for example, it could be "IDLE: make context menu clear selection".

I know there are projects that prefer this style. Python is not one of them. 
Please comply.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c

2020-03-08 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c

2020-03-08 Thread Andy Lester


New submission from Andy Lester :

init_set_builtins_open(PyThreadState *tstate) -> unused arg

_Py_FatalError_PrintExc(int fd) -> unused arg

--
components: Interpreter Core
messages: 363690
nosy: petdance
priority: normal
severity: normal
status: open
title: Remove unused args from init_set_builtins_open and 
_Py_FatalError_PrintExc in Python/pylifecycle.c

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
nosy: +pablogsal
nosy_count: 2.0 -> 3.0
pull_requests: +18224
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18866

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-08 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-08 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.iterdir()` uses `os.listdir()` rather than `os.scandir()`. I 
think this has a small performance cost, per PEP 471:

> It returns a generator instead of a list, so that scandir acts as a true 
> iterator instead of returning the full list immediately.

As `scandir()` is already available from `_NormalAccessor` it's a simple patch 
to use `scandir()` instead.

--
components: Library (Lib)
messages: 363689
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather 
than `os.scandir()`
type: resource usage
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



[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2020-03-08 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue7479] os.lchmod is not present

2020-03-08 Thread Barney Gale


Change by Barney Gale :


--
nosy: +barneygale
nosy_count: 5.0 -> 6.0
pull_requests: +18222
pull_request: https://github.com/python/cpython/pull/18864

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

Great, thank you!

--

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The related issue is #39852.  Since its PR-18801 fixed the status issue, I am 
returning this to the box replacement issue.

--

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +C API -Interpreter Core

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry Zackery, I did not know about this issue so I wrote different PR to fix 
this problem. And only after writing it I have found this issue.

There are several differences between your PR and PR 18863.

* SystemError is raised instead of ValueError because this is incorrect use of 
the C API.
* The error message mentions also base 10.
* The test is written mostly in Python.

For these reasons I prefer my PR.

Please let me know if you need a review for other PRs.

--

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 1.0 -> 2.0
pull_requests: +18220
pull_request: https://github.com/python/cpython/pull/18863

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset 0687bdf5def13ddca09e854113c0eac0772afea0 by Miss Islington (bot) 
in branch '3.8':
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
https://github.com/python/cpython/commit/0687bdf5def13ddca09e854113c0eac0772afea0


--
nosy: +miss-islington

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread Steve Dower


Change by Steve Dower :


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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread Steve Dower


Steve Dower  added the comment:

Nope, just that I apparently forgot to merge (or forgot to come back after CI 
had finished).

Thanks for the reminder!

--
nosy:  -miss-islington

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0911ea5c172264eaefa3efe4a1788159c160920d by Maor Kleinberger in 
branch 'master':
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
https://github.com/python/cpython/commit/0911ea5c172264eaefa3efe4a1788159c160920d


--

___
Python tracker 

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



[issue39905] Cannot load sub package having a 3-dot relative import

2020-03-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

In this line:

> spec = spec_from_file_location("subsubpkg_rel", 
> "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py")

try providing the fully-qualified name, instead of just "subsubpkg_rel". That 
is:

> spec = spec_from_file_location("mypkg.subpkg.subsubpkg_rel", 
> "/Users/mdickinson/Desktop/test/mypkg/subpkg/subsubpkg_rel/__init__.py")

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2020-03-08 Thread Barney Gale


New submission from Barney Gale :

As of Python 3.3, `os.lstat()` and `os.lchmod()` are available as 
`os.stat(follow_symlinks=False)` and `os.chmod(follow_symlinks=False)`, but an 
equivalent change didn't make it into pathlib. I propose we add the  
`follow_symlinks` argument to `Path.stat()` and `Path.chmod()` for consistency 
with `os` and because the new notation is arguable clearer for people who don't 
know many system calls off by heart :)

--
components: Library (Lib)
messages: 363681
nosy: barneygale
priority: normal
severity: normal
status: open
title: pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`
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



[issue39517] runpy calls open_code with Path object

2020-03-08 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

Hey there, the PR was approved a week ago, is there a reason it is not merged 
yet?

--

___
Python tracker 

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



[issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

2020-03-08 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

Hey there, it's been more than a week since I pushed the last changes, can 
anyone review them?

--

___
Python tracker 

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



[issue39905] Cannot load sub package having a 3-dot relative import

2020-03-08 Thread Yon Ar Chall

New submission from Yon Ar Chall :

Hi there !

I was trying to use importlib.util.spec_from_file_location() to import a nested 
package containing a 3-dot relative import.

$ tree ~/myproj
/home/yon/myproj
└── mypkg
├── __init__.py
└── subpkg
├── __init__.py
├── subsubpkg_abs
│   └── __init__.py
└── subsubpkg_rel
└── __init__.py

Relative import here :

$ cat ~/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py 
from ... import subpkg

Absolute import here (for comparison purpose) :

$ cat ~/myproj/mypkg/subpkg/subsubpkg_abs/__init__.py 
import mypkg.subpkg 

$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib.util import spec_from_file_location
>>> spec = spec_from_file_location("subsubpkg_abs", 
>>> "/home/yon/myproj/mypkg/subpkg/subsubpkg_abs/__init__.py")
>>> spec.loader.load_module()

>>> spec = spec_from_file_location("subsubpkg_rel", 
>>> "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py")
>>> spec.loader.load_module()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 388, in 
_check_name_wrapper
  File "", line 809, in load_module
  File "", line 668, in load_module
  File "", line 268, in _load_module_shim
  File "", line 693, in _load
  File "", line 673, in _load_unlocked
  File "", line 665, in exec_module
  File "", line 222, in _call_with_frames_removed
  File "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py", line 1, in 

from ... import subpkg
ValueError: attempted relative import beyond top-level package
>>>

Raw import just works (as importlib.import_module() does) :

>>> import mypkg.subpkg.subsubpkg_rel
>>>

--
components: Library (Lib)
messages: 363678
nosy: yon
priority: normal
severity: normal
status: open
title: Cannot load sub package having a 3-dot relative import
versions: Python 3.5

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset b2e8240261aa879b8978d7add6dd1efc4318add1 by Miss Islington (bot) 
in branch '3.8':
bpo-39885: IDLE context menu clears selection  (GH-18859)
https://github.com/python/cpython/commit/b2e8240261aa879b8978d7add6dd1efc4318add1


--

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset f9684d222e0950c1ce206873a9c66dfd30ed by Miss Islington (bot) 
in branch '3.7':
bpo-39885: IDLE context menu clears selection  (GH-18859)
https://github.com/python/cpython/commit/f9684d222e0950c1ce206873a9c66dfd30ed


--

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18218
pull_request: https://github.com/python/cpython/pull/18861

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +18217
pull_request: https://github.com/python/cpython/pull/18860

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09 by Terry Jan Reedy in 
branch 'master':
 bpo-39885: IDLE context menu clears selection  (#18859)
https://github.com/python/cpython/commit/4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09


--

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Updated the PR according to review comments.

PyNumber_ToBase() now raises SystemError for unsupported base instead of 
crashing. unicode_eq() asserts that unicode strings are ready (it is only 
called for hashed strings and if we have a hash they should be ready). 
PyCode_Optimize() returns the malformed bytecode unmodified. Other potentially 
non-unreachable code call now Py_FatalError(). Feel free to propose better 
messages. All other cases look truly unreachable to me.

Added support for the Intel and Microsoft compilers.

--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since PR-18801 fixed the status issue, I am returning this to the box 
replacement issue.

--
title: IDLE goto should always update status bar line & column -> IDLE goto 
should use query.Query subclass

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +18216
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/18859

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset ec61f53243a4455f41e37a5c645e668661952c28 by Miss Islington (bot) 
in branch '3.7':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
https://github.com/python/cpython/commit/ec61f53243a4455f41e37a5c645e668661952c28


--

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset a5e821c7269ebed6e8b4b4eee3f2247ec41a9788 by Miss Islington (bot) 
in branch '3.8':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
https://github.com/python/cpython/commit/a5e821c7269ebed6e8b4b4eee3f2247ec41a9788


--

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18215
pull_request: https://github.com/python/cpython/pull/18858

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +18214
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18857

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2522db11df102be3baf25ce9e816ebe8ffdb7fcc by Terry Jan Reedy in 
branch 'master':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
https://github.com/python/cpython/commit/2522db11df102be3baf25ce9e816ebe8ffdb7fcc


--

___
Python tracker 

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



[issue39868] Stale Python Language Reference docs (no walrus).

2020-03-08 Thread SHANKAR JHA


Change by SHANKAR JHA :


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

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18212
pull_request: https://github.com/python/cpython/pull/18854

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-08 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48961/asyncio_gc.py

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-08 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39798] Update and Improve README.AIX

2020-03-08 Thread Michael Felt


Michael Felt  added the comment:

Thanks for asking!

Last December I was thinking about this - and what would be the best way to 
proceed.

The reply I liked best suggested working on this - outside of CPython 
"bugfixes" - perhaps later moving bits into the core.

So, motivated by your question I opened an area in github - 
https://github.com/aixtools/pythonAIXDOC.

a) I have done a quick re-write of the current README.AIX - with stress on 
re-write.

b) I have several years experience with packaging Python for AIX (for which I 
use the IBM compiler) and also manage a Python-buildbot that uses gcc. What I 
don't want to do is just pour forth lots of notes re: things I have discovered 
and learned.

c) I would appreciate hearing your experiences re: using Python on AIX. Report 
issues via pythonAIXDOC or my packaging forums 
(http://forums.rootvg.net/aixtools) and I will reply, study, etc.. as much as I 
have time to. The experiences (especially frustrations when it works this way 
(...) on platform Y, but not (the same, or at all) on AIX.

Hope this helps!

--
versions: +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



[issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c

2020-03-08 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 28ca43b7e30e2eaa2997c3becd8b1a837484ae5c by Andy Lester in branch 
'master':
closes bpo-39898: Remove unused arg from append_formattedvalue. (GH-18840)
https://github.com/python/cpython/commit/28ca43b7e30e2eaa2997c3becd8b1a837484ae5c


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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue, my change introduced a *new* issue.

While trying to fix bpo-19466, work on PR 18848, I noticed that my commit 
eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e introduced a race condition :-(

The problem is that while the main thread is executing Py_FinalizeEx(), daemon 
threads can be waiting in take_gil(). Py_FinalizeEx() calls 
_PyRuntimeState_SetFinalizing(runtime, tstate). Later, Py_FinalizeEx() executes 
arbitrary Python code in _PyImport_Cleanup(tstate) which releases the GIL to 
give a chance to other threads to execute:

if (_Py_atomic_load_relaxed(>gil_drop_request)) {
/* Give another thread a chance */
if (_PyThreadState_Swap(>gilstate, NULL) != tstate) {
Py_FatalError("tstate mix-up");
}
drop_gil(ceval, tstate);

/* Other threads may run now */

/* Check if we should make a quick exit. */
exit_thread_if_finalizing(tstate);

take_gil(ceval, tstate);

if (_PyThreadState_Swap(>gilstate, tstate) != NULL) {
Py_FatalError("orphan tstate");
}
}

At this point, one daemon thread manages to get the GIL: take_gil() 
completes... even if runtime->finalizing is not NULL. I expected that 
exit_thread_if_finalizing() would exit the thread, but 
exit_thread_if_finalizing() is now called *after* take_gil().

--

It's unclear to me when the GIL (the lock object) is destroyed and how we are 
supposed to destroy it, if an unknown number of daemon threads are waiting for 
it.

The GIL lock is created by PyEval_InitThreads(): create_gil() with 
MUTEX_INIT(gil->mutex).

The GIL lock is destroyed by _PyEval_FiniThreads(): destroy_gil() with 
MUTEX_FINI(gil->mutex).

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18210
pull_request: https://github.com/python/cpython/pull/18848

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 89fabe51af27a16ae7174ad94921e3980e28 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18765)
https://github.com/python/cpython/commit/89fabe51af27a16ae7174ad94921e3980e28


--

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39862] Why are the union relationships not implemented by default for ≤ and ≥?

2020-03-08 Thread Géry

Géry  added the comment:

Thanks for the reference @Raymond. I could not find any mention of the union 
relationships for ≤ and ≥ though. Since they are always valid for Boolean 
values, in the same way that ≠ is always the complement of = for Boolean values 
and default implemented as such in the interpreter, what do you think of 
default implementing these union relationships in the interpreter?

--

___
Python tracker 

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



[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The builtin type() serves two functions:

1. When called with a single positional argument it returns the type of the 
argument.

>>> type(1)


2. Otherwise it acts as any class when called -- creates an instance of this 
class (a type). It includes calling corresponding __new__ and __init__ methods.

>>> type('A', (str,), {'foo': lambda self: len(self)})


type is a class, and it can be subclassed. Subclasses of type serve only the 
latter function (the former was forbidden in issue27157).

>>> class T(type): pass
... 
>>> T(1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type.__new__() takes exactly 3 arguments (1 given)
>>> T('A', (str,), {'foo': lambda self: len(self)})


But surprisingly you can use the __new__ method for getting the type of the 
object.

>>> type.__new__(type, 1)

>>> T.__new__(T, 1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type.__new__() takes exactly 3 arguments (1 given)

The proposed PR moves handling the special case of one-argument type() from 
type.__new__ to type.__call__.

It does not fix any real bug, it does not add significant performance boost, it 
does not remove a lot of code, it just makes the code slightly more 
straightforward. It changes the behavior of type.__new__(type, obj) which is 
very unlikely called directly in real code.

>>> type(1)

>>> type.__new__(type, 1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type.__new__() takes exactly 3 arguments (1 given)

--
components: Interpreter Core
messages: 363664
nosy: gvanrossum, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Move handling of one-argument call of type() from type.__new__() to 
type.__call__()
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



[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Code objects themselves supports equality comparisons, 

>>> compile("print(1)", "", "eval") == compile("print(1)", "", 
>>> "eval")
True

So this patch basically compares the underlying code objects with 2 Bytecode 
specific attribute, first_line and current_offset. So these objects will be 
equal

>>> import dis
>>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)")
True

but these won't
>>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)", first_line=2)
False
>>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)", current_offset=12)
False

A simple example that would be problamatic in .dis() method is code objects 
that contains other code objects

import dis

source = "def x(a, b): print(1)"
print(dis.Bytecode(source).dis())
print(dis.Bytecode(source).dis())
print(dis.Bytecode(source).dis() == dis.Bytecode(source).dis())

  1   0 LOAD_CONST   0 (", line 1>)
  2 LOAD_CONST   1 ('x')
  4 MAKE_FUNCTION0
  6 STORE_NAME   0 (x)
  8 LOAD_CONST   2 (None)
 10 RETURN_VALUE

  1   0 LOAD_CONST   0 (", line 1>)
  2 LOAD_CONST   1 ('x')
  4 MAKE_FUNCTION0
  6 STORE_NAME   0 (x)
  8 LOAD_CONST   2 (None)
 10 RETURN_VALUE

False

--

___
Python tracker 

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



[issue37948] get_type_hints fails if there are un-annotated fields in a dataclass

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 14166 does not fix this issue.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

What does it mean for two Bytecode objects to be equal?

I know what equality means for ints: they have the same numeric value.

I know what equality means for strings: they have the same sequence of Unicode 
code points.

I have no concept of what it would mean for two Bytecode objects to be equal or 
unequal. Your patch compares the tuple:

(codeobj, first_line, current_offset)

but why do you compare those rather than, say, the source code, or the 
disassembled byte code, or something else?

Before I read your patch, I guested that you would have defined `__eq__` as 
`self.dis() == other.dis()`.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39868] Stale Python Language Reference docs (no walrus).

2020-03-08 Thread SHANKAR JHA


SHANKAR JHA  added the comment:

I have added the pull request: https://github.com/python/cpython/pull/18851. 
Please check it out and let me know if I need to change anything.

Thank you everyone for your guidance.

--

___
Python tracker 

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



[issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators

2020-03-08 Thread SHANKAR JHA


Change by SHANKAR JHA :


--
nosy: +shankarj67
nosy_count: 2.0 -> 3.0
pull_requests: +18208
pull_request: https://github.com/python/cpython/pull/18851

___
Python tracker 

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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-08 Thread brian.gallagher


brian.gallagher  added the comment:

I agree that there is an appeal to leaving any normalization to the application 
and that trying guess what people want is a tough hole -- I hadn't even 
considered what casing would mean in a general sense for Unicode.

I'm not entirely convinced that this should be pursued either, but I'll refine 
my proposal, provide a little context in which I thought it could be a problem 
and see what you guys think.

1. Some code is written that assumes get_close_matches() will match on a 
case-insensitive basis. Only a small bit of testing is done because the 
functionality is provided by the standard library not the application code, so 
we throw a few examples like 'apple' and 'ape' and decide it is okay. We later 
on discover we have a bug because we actually need to match against 'AppLE' too.

2. The extension I had in mind was to match on a case-insensitive basis for 
only the alphabet characters. I don't know much about Unicode, but there's 
definitely gotchas lurking in my previous statement (titlecase vs. uppercase) 
so copying the behaviour of string.upper()/string.lower() would seem reasonable 
to me. The functionality would only be extended to match the same strings it 
would anyways, but now ignore casing. We wouldn't be eliminating any existing 
matches. I guess this still has the potential to be a breaking change, since 
someone might indirectly be depending on this.

For 1., not testing that your code can handle mixed case comparisons in the way 
you're assuming it will is probably your own fault. On the other hand, I think 
it is a reasonable assumption to think that get_close_matches() will match an 
uppercase/lowercase counterpart since the function's intent is to provide 
intuitive matches that "look right" to a human. 

Maybe this is more of a documentation issue than something that needs to be 
addressed in the code. If a caveat about the case sensitivity of the function 
is added to the documentation, then a developer can be aware of the limitation 
in order to provide any normalization they want in the application code.

Let me know what you guys think.

--

___
Python tracker 

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



[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset db283b32e7580741a8b6b7f27f616cc656634750 by Serhiy Storchaka in 
branch 'master':
bpo-39567: Document audit for os.walk, os.fwalk, Path.glob and Path.rglob. 
(GH-18499)
https://github.com/python/cpython/commit/db283b32e7580741a8b6b7f27f616cc656634750


--

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-08 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-08 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
stage:  -> needs patch
type: crash -> behavior
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There is very strange code in _elementtree.Element.__getstate__ which decrement 
references to elements of a list before decrementing a reference to the list 
itself. It happens only if creating a dict fails, so it is almost impossible to 
reproduce, but if it happens it will likely cause a crash.

The proposed PR fixes the bug and also simplifies the code.

--
components: Extension Modules, XML
messages: 363657
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Double decref in _elementtree.Element.__getstate__
type: crash
versions: 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



[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

import dis
>>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)")
False

--
components: Library (Lib)
messages: 363656
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: dis.Bytecode objects should be comparable
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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-08 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

It looks like Brian is expecting some kind of normalization of the strings 
before they enter the function, e.g. convert to lowercase, remove extra 
whitespace, convert diacritics to regular letters, combinations of such 
normalizations, etc.

Since both "word" and "possibilities" would have to be normalized, I think it's 
better to let the application deal with this efficiently than try to come up 
with a new function or add a normalize keyword function parameter.

--
nosy: +lemburg

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

asyncio_gc.py: script to reproduce bpo-20526 (copied from there), but ported to 
Python 3.9 (replace asyncio.async with asyncio.ensure_future).

Sadly, Python with PR 18848 does crash when running asyncio_gc.py if I press 
CTRL+c twice:

* A thread does crash in _PyObject_GC_TRACK_impl() called indirectly by 
select_epoll_poll_impl(), in a Python thread
* while main thread is exiting Python: Py_FinalizeEx() is calling 
_PyImport_Cleanup() which blocks on take_gil()

It seems like the main thread does *not* hold the hold, the thread which 
crashed does.

It should not happen: _PyRuntimeState_SetFinalizing(runtime, tstate) has been 
called and so no other thread should be able to take the GIL anymore, but exit 
immediately.

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-08 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, it should now be fixed.

Let me try to revisit the old bpo-19466 issue.

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



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Barney Gale


Barney Gale  added the comment:

The only design flaw mentioned in that thread is that `os.path.expanduser()` 
returns the input unchanged if expansion fails, which is not very pythonic. 
However, such a problem doesn't necessitate a rewrite of 
`os.path.expanduser()`. Checking `result[:1]` is enough.

I think there's also a difference in the Windows heuristic in that pathlib 
checks whether `basename(%HOMEPATH%) == %USERNAME%` whereas `ntpath.expanduser` 
doesn't. But if that's really an issue it should probably be fixed in `ntpath` 
IMO, rather than having divergent implementations.

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

The change has been reverted in 2014. I reopen the issue since using daemon 
thraeds became safer in Python 3.9. As soon as a daemon thread attempts to take 
the GIL, it does exit immediately.

With the commit eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e (bpo-39877), it should 
be even more reliable.

Let me retry to fix this issue again. I reopen the issue and I wrote a new PR.

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



[issue34822] Simplify AST for slices

2020-03-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Sorry, I did not know about your PR Batuhan and fixed this bug in issue39889.

No problem.

--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e by Victor Stinner in 
branch 'master':
bpo-39877: Fix PyEval_RestoreThread() for daemon threads (GH-18811)
https://github.com/python/cpython/commit/eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e


--

___
Python tracker 

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



[issue34822] Simplify AST for slices

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I did not know about your PR Batuhan and fixed this bug in issue39889.

After fixing the bug in the current code PR 9605 only simplifies the code. So 
in this case the new code is not more complex than correctly written old code.

--

___
Python tracker 

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



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was discussed in issue19776.

Having separate implementation we can avoid design flaws of 
os.path.expanduser().

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-08 Thread Michael Felt


Change by Michael Felt :


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

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-08 Thread Michael Felt


Michael Felt  added the comment:

The PR for 3.9 breaks AIX build (since 
https://buildbot.python.org/all/#/builders/119/builds/384) reporting the 
following:

Traceback (most recent call last):
  File "/data/prj/python/python3-3.9/../git/python3-3.9/setup.py", line 69, in 

from distutils.command.build_ext import build_ext
  File "/data/prj/python/git/python3-3.9/Lib/distutils/command/build_ext.py", 
line 33, in 
class build_ext(Command):
  File "/data/prj/python/git/python3-3.9/Lib/distutils/command/build_ext.py", 
line 63, in build_ext
"(default: %s)" % get_platform()),
  File "/data/prj/python/git/python3-3.9/Lib/distutils/util.py", line 107, in 
get_platform
return get_host_platform()
  File "/data/prj/python/git/python3-3.9/Lib/distutils/util.py", line 83, in 
get_host_platform
return aix_platform()
  File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 83, in 
aix_platform
vrmf, bd = _aix_bosmp64()
  File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 53, in 
_aix_bosmp64
out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.mp64"])
AttributeError: module 'subprocess' has no attribute 'check_output'

Will post a PR for this.

The cause:
Briefly, due to the addition of an importable subprocess must now test 
specifically for check_output during the early build process.

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-03-08 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-08 Thread hai shi


hai shi  added the comment:

> I would prefer that codecs.lookup() and encodings.normalize_encoding() behave 
> the same. Either always ignore or always copy.

How about calling `encodings.normalize_encoding() in codecs.normalizestring()` 
to keep same behavior?(I create PR18845)

> Maybe we should just add a private function for test in _testcapi

I can try to add some test cases in next weekend ;)

--

___
Python tracker 

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-08 Thread hai shi


Change by hai shi :


--
keywords: +patch
nosy: +shihai1991
nosy_count: 3.0 -> 4.0
pull_requests: +18202
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18845

___
Python tracker 

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



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Barney Gale


Barney Gale  added the comment:

I see no reason for the duplication, and I can point to one concrete bug 
affecting your re-implementation of `expanduser` that doesn't affect the 
original, i.e. that a `KeyError` is raised on Windows when `"USERNAME"` is not 
present in `os.environ`, whereas all similar cases raise `RuntimeError`. These 
sorts of issues sneak in when you duplicate code - better to stick with the 
battle-hardened version rather than an inherently risky rewrite.

--

___
Python tracker 

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



[issue39638] Keep ASDL signatures for AST nodes

2020-03-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-03-08 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-03-08 Thread Barney Gale


New submission from Barney Gale :

The implementations of `Path.owner()` and `Path.group()` directly import and 
use the `pwd` and `grp` modules. Given these modules provide information about 
the *local* system, I believe these implementations should instead live in 
`pathlib._NormalAccessor` for consistency with other methods that do "impure" 
things.

--
components: Library (Lib)
messages: 363643
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly
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



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

2020-03-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> It is not so easy for fields like "type_ignores". They are mutable lists, so 
> this approach cannot be applied to them.

What about keeping ASDL signatures in the nodes (). If we know the type of a 
field (can be parsed in runtime) we can infer the default value of a field. For 
type_ignores, it is a sequence so if it is empty we can just crop that part.

--

___
Python tracker 

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



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

2020-03-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Related issue: issue 39638

--

___
Python tracker 

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



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

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 18843 solves this issue by setting None as class attributes for optional  
fields and attributes (like "kind" or "end_col_offset").

It is not so easy for fields like "type_ignores". They are mutable lists, so 
this approach cannot be applied to them.

I want to get rid also from "ctx=Load()", but it is more complex change.

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



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I see no reason to change the current code.

--
resolution:  -> not a bug
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