[issue39887] Duplicate C object description of vectorcallfunc

2020-03-07 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

$ make html
...
Warning, treated as error:
/home/serhiy/py/cpython/Doc/c-api/call.rst:71:duplicate C object description of 
vectorcallfunc, other instance in /home/serhiy/py/cpython/Doc/c-api/typeobj.rst

--
assignee: docs@python
components: Documentation
messages: 363584
nosy: docs@python, jdemeyer, petr.viktorin, serhiy.storchaka
priority: high
severity: normal
status: open
title: Duplicate C object description of vectorcallfunc
type: compile error
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



[issue39199] Improve the AST documentation

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would not be better to use mode='eval' for expression nodes?

>>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))
Expression(
body=Constant(value=123, kind=None))

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

> I believe this was implemented in issue33234

I don't think so. The bytecode in Python 3.9 still uses "BUILD_LIST 0":

Python 3.9.0a4+ (heads/daemon_thread_runtime2-dirty:48652767d5, Mar  7 2020, 
00:56:07) 
>>> def f():
... for i in range(1):
... [j for j in range(1)]
... 
>>> import dis; dis.dis(f)
(...)

Disassembly of  at 0x7ffab2c9fd40, file "", line 
3>:
  3   0 BUILD_LIST   0
  2 LOAD_FAST0 (.0)
>>4 FOR_ITER 8 (to 14)
  6 STORE_FAST   1 (j)
  8 LOAD_FAST1 (j)
 10 LIST_APPEND  2
 12 JUMP_ABSOLUTE4
>>   14 RETURN_VALUE

--
resolution: fixed -> 
status: closed -> open
superseder: Improve list() pre-sizing for inputs with known lengths -> 

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2020-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-14126: "Speed up list comprehensions by preallocating the list 
where possible".

--

___
Python tracker 

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



[issue39792] Two Ctrl+C is required to terminate when a pipe is blocking

2020-03-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6

___
Python tracker 

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



[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The only specification is that len(ob) calls ob.__len__ and that ob.__len__ 
should return an 'integer >= 0'.  (Adding side effects goes beyond that spec.)  
I agree that a detectable internal in list is not a bug.  Unless there is a 
realistic performance enhancement in caching the result of the first call, this 
issue should be closed.

--
nosy: +terry.reedy
type: behavior -> performance

___
Python tracker 

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



[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
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-07 Thread SHANKAR JHA


SHANKAR JHA  added the comment:

I have created my draft with an example but I am confused about where exactly 
do I have to add the code and push it.

I have cloned these two repositories in my system and setup everything:
https://github.com/python/cpython
https://github.com/python/devguide

1. Please tell me where I should be adding my code. Do I have to add code here 
https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst and 
push it?

2. I am working on the master branch only. Is there any specific branch I have 
to select?

--

___
Python tracker 

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



[issue39861] French doc __futur__: Bad URL

2020-03-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

b.p.o is for the cpython repository, which includes the English docs.  
Translations are in separate repositories (like python-docs-fr) with their own 
trackers, with issues handled by the corresponding translators.

--
nosy: +terry.reedy

___
Python tracker 

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



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

2020-03-07 Thread Nick Coghlan


Nick Coghlan  added the comment:

One of the intended use cases for Py_mod_create is to return instances of 
ModuleType subclasses rather than straight ModuleType instances. And those are 
definitely legal to define:

>>> import __main__
>>> class MyModule(type(__main__)): pass
... 
>>> m = MyModule('example')
>>> m


So it isn't valid to skip calling the cleanup functions just because md_state 
is NULL - we have no idea what Py_mod_create might have done that needs to be 
cleaned up.

It would *probably* be legitimate to skip calling the cleanup functions when 
there's no Py_mod_create slot defined, but then the rules for "Do I need to 
account for md_state potentially being NULL or not?" are getting complicated 
enough that the safest option for a module author is to always assume that 
md_state might be NULL and handle that case appropriately.

--

___
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-07 Thread Nick Coghlan


Nick Coghlan  added the comment:

The one thing in the PR that makes me slightly wary is the point Vedran raised: 
in the old AST _Unparser code, the fact that index tuples containing slices 
should be printed without parentheses was encapsulated in the ExtSlice node 
type, but with Index and ExtSlice removed, that behaviour is now instead 
implemented by duplicating the visit_Tuple logic directly in visit_Subscript, 
purely to omit the surrounding parens.

So I agree that the parse tree simplification is an improvement, but I'm 
wondering if it might make sense to add an "is_subscript" attribute to 
expression nodes.

That way the Tuple vs ExtSlice and Expr vs Index distinctions would be 
preserved, but the representation of those distinctions would change in a way 
that meant that most consuming code didn't need to care that the distinctions 
existed (ExtSlice would become a Tuple with is_subscript set to True, and 
similarly, Index would become Expr instances with is_subscript set to True).

It's been so long since I changed the AST, though, that I'm not sure how 
painful adding that attribute would be.

--

___
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-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was added to produce nicer output.

Currently:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[(i, j)]

With PR 9605:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[i, j]

The current code is not consistent with outputting parenthesis:

>>> print(ast.unparse(ast.parse('a[i:j, k]')))

a[i:j, k]

It also produces the same output for a[i:j] and a[i:j,] which have different 
AST and compiled to different bytecode (this is a bug).

>>> print(ast.unparse(ast.parse('a[i:j,]')))

a[i:j]

--

___
Python tracker 

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



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-07 Thread Ammar Askar


Ammar Askar  added the comment:

Aah, thanks for the catcher Victor. Missed that this was about list 
/comprehensions/, not the list constructor.

--

___
Python tracker 

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



[issue39888] modules not install

2020-03-07 Thread Mageshkumar


New submission from Mageshkumar :

pls kindly rectify it

--
components: Windows
files: modules install issues.txt
messages: 363595
nosy: magesh, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: modules not install
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file48960/modules install issues.txt

___
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-07 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

ast.unparse() produces incorrect output for ExtSlice containing a single 
element:

>>> print(ast.unparse(ast.parse('a[i:j,]')))

a[i:j]

It also produces redundant parenthesis for Index containing Tuple:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[(i, j)]

--
components: Demos and Tools, Library (Lib)
messages: 363596
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix ast.unparse() for subscription by extended slices and tuples
type: behavior
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



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

2020-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
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-07 Thread Vedran Čačić

Vedran Čačić  added the comment:

Agree with the idea, but think the name is too narrow. How about 
`parethesized`? There are many contexts where parentheses look weird and can be 
omitted (e.g. after return statement), although subscripts are currently the 
only place where they are an outright error.

--

___
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-07 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Yes, there is an already PR about that the bug.

Related PR: https://github.com/python/cpython/pull/17892

--

___
Python tracker 

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



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

2020-03-07 Thread hai shi


hai shi  added the comment:

> we have no idea what Py_mod_create might have done that needs to be cleaned 
> up.

Looks like no extension module author use `Py_mod_create` slots now.

--

___
Python tracker 

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



[issue39888] modules not install

2020-03-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

This looks like a network problem on your end, not a python bug. The bug 
tracker is not the place to get help for such an issue. You might try the 
python-list mailing list, although your best bet is to find someone locally who 
can help you debug your network problem.

https://mail.python.org/mailman/listinfo/python-list

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



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

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c4928fc1a853f3f84e2b4ec1253d0349137745e5 by Serhiy Storchaka in 
branch 'master':
bpo-39889: Fix ast.unparse() for subscript. (GH-18824)
https://github.com/python/cpython/commit/c4928fc1a853f3f84e2b4ec1253d0349137745e5


--

___
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-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18184
pull_request: https://github.com/python/cpython/pull/18826

___
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-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 92b72788ecf2ee5dfac780c7dfb5ee5350fc641d by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
https://github.com/python/cpython/commit/92b72788ecf2ee5dfac780c7dfb5ee5350fc641d


--

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


Change by miss-islington :


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

___
Python tracker 

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



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Isn't this the same as https://bugs.python.org/issue36551 ?

--
nosy: +pablogsal

___
Python tracker 

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



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Would not be better to use mode='eval' for expression nodes?

Agreed! I will prepare a PR soon to simplify the expression examples.

--

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


miss-islington  added the comment:


New changeset 65b031090161331470827ec809732008b15030d5 by Miss Islington (bot) 
in branch '3.7':
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
https://github.com/python/cpython/commit/65b031090161331470827ec809732008b15030d5


--

___
Python tracker 

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



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18186
pull_request: https://github.com/python/cpython/pull/18828

___
Python tracker 

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



[issue39878] Remove unused args in Python/formatter_unicode.c

2020-03-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset ad0c775ea24bb827410f01ece9f191309292bb95 by Andy Lester in branch 
'master':
closes bpo-39878: Remove unused arguments from static functions. (GH-18822)
https://github.com/python/cpython/commit/ad0c775ea24bb827410f01ece9f191309292bb95


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



[issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c

2020-03-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset aa450a0364b6160be7dd61ec2d378abb0652f014 by Andy Lester in branch 
'master':
closes bpo-39886: Remove unused arg from config_get_stdio_errors. (GH-18823)
https://github.com/python/cpython/commit/aa450a0364b6160be7dd61ec2d378abb0652f014


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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset eb7560a73d46800e4ade4a8869139b48e6c92811 by Pablo Galindo in 
branch 'master':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/eb7560a73d46800e4ade4a8869139b48e6c92811


--

___
Python tracker 

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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18188
pull_request: https://github.com/python/cpython/pull/18831

___
Python tracker 

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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f by Miss Islington (bot) 
in branch '3.7':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f


--

___
Python tracker 

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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 928b4dd0edf0022190a8a296c8ea65e7ef55c694 by Miss Islington (bot) 
in branch '3.8':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/928b4dd0edf0022190a8a296c8ea65e7ef55c694


--

___
Python tracker 

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



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 02f64cb79175902705b40e3eaa8ea6c7038754ef by Pablo Galindo in 
branch 'master':
bpo-39199: Use 'eval' mode for the examples with expression nodes (GH-18828)
https://github.com/python/cpython/commit/02f64cb79175902705b40e3eaa8ea6c7038754ef


--

___
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-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8f130536926a30237b5297780d61ef4232e88577 by Brandt Bucher in 
branch 'master':
bpo-39702: Update the Language Reference (PEP 614) (GH-18802)
https://github.com/python/cpython/commit/8f130536926a30237b5297780d61ef4232e88577


--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4663f66f3554dd8e2ec130e40f6abb3c6a514775 by Brandt Bucher in 
branch 'master':
bpo-36144: Update MappingProxyType with PEP 584's operators (#18814)
https://github.com/python/cpython/commit/4663f66f3554dd8e2ec130e40f6abb3c6a514775


--

___
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-07 Thread Brandt Bucher


Change by Brandt Bucher :


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



[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Curtis Bucher


Change by Curtis Bucher :


--
nosy: +curtisbucher
nosy_count: 11.0 -> 12.0
pull_requests: +18189
pull_request: https://github.com/python/cpython/pull/18832

___
Python tracker 

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



[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-07 Thread Ned Deily


Ned Deily  added the comment:

This seems like more an import issue than a uniquely macOS issue. Also, a quick 
search found Issue10952 which appears to be similar.

--
nosy: +brett.cannon, vstinner

___
Python tracker 

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



[issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows

2020-03-07 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the pythoninfo output. I didn't see anything unusual there. So I 
remain perplexed. The thing is the macOS Tk 8.6.8 we supply with current 
python.org installers doesn't support Dark Mode at all, AFAIK.  That was added 
in 8.6.9.  I normally have macOS Dark Mode enabled on all of macOS systems, 
both real and virtual and, with the python.org Tk 8.6.8, Tk windows are always 
in Light mode, including on 10.15.3, regardless of the settings in System 
Preferences -> General.  I do have at hand a MacPorts Python 3.8.2 that uses a 
MacPorts-supplied Tk 8.6.10; in that case, the Tk windows do follow the System 
Preferences Dark Mode preference and IDLE's Preference windows looks fine as 
one would expect it to in Dark mode. (Unfortunately, there are other problems 
with IDLE using Tk 8.6.10 that need to be resolved before we can move to it.)

There is this relevant discussion in the Apple Developer documentation:

https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app?language=objc

Since the python.org macOS Pythons are built with a pre-10.14 SDK, they should 
be automatically opted out of Dark mode unless you add the 
NSRequiresAquaSystemAppearance key to the app bundle plist of IDLE.app or 
Python.app. And that is consistent with the behavior I observe. I verified 
that, by modifying the python.org IDLE.app plist to include a key 
NSRequiresAquaSystemAppearance with value NO, IDLE's Tk windows are displayed 
in Dark mode with the text windows completely dark as in your screen shots.  So 
... assuming we aren't missing something somewhere and you are not really 
executing the python.org supplied Python / IDLE when you see this behavior, my 
only guess at this point is that you have some extension or some system 
variable set that overrides this automatic opt-out of dark mode for older apps.

There is also some discussion in various forums of a system-wide preference, 
NSRequiresAquaSystemAppearance, that could be used in macOS Mojave to force 
dark mode.  I tried playing with it on both 10.14 and 10.15 and saw no change 
in (unmodified) IDLE.app Tk behavior but perhaps I'm missing something.

Maybe all this rings a bell or two for you about customizations you might have 
made on your system?  Otherwise, I don't know what else to suggest at this 
point.  I guess you *could* try tweaking the IDLE.app plist to explicitly 
disable the dark mode opt-in and see if that makes a difference but, of course, 
that wouldn't find the root cause.  And the other thing would be to try running 
the python.org in a vanilla 10.15 environment, perhaps in a Fusion VM.

I'm going to close this bug report since it seems unlikely to be a Python or 
even Tk 8.6.8 issue.  But feel free to update or re-open if you find more 
information.  Good luck!

--
resolution:  -> works for me
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



[issue39890] The AST is mangled when compiling starred assignments.

2020-03-07 Thread Brandt Bucher


New submission from Brandt Bucher :

It looks like assignment_helper is the only place where we actually change the 
semantic meaning of the AST during compilation (a starred name is changed to a 
regular name as a shortcut).

This probably isn't a great idea, and it would bite us later if we started 
making multiple passes or reusing the AST or something.

--
assignee: brandtbucher
components: Interpreter Core
messages: 363616
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: The AST is mangled when compiling starred assignments.
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



[issue39890] The AST is mangled when compiling starred assignments.

2020-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


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

___
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-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

> I have created my draft with an example but I am confused about where exactly 
> do I have to add the code and push it.

> I have cloned these two repositories in my system and setup everything:
> https://github.com/python/cpython
> https://github.com/python/devguide

Great! It's not necessary to clone the devguide though; CPython is the only one 
you're going to edit.

Make sure you've "forked" the repo on GitHub, and are working on a local clone 
of your fork. Otherwise things will be trickier.

> 1. Please tell me where I should be adding my code. Do I have to add code 
> here 
> https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst 
> and push it?

Yes, you'll add the new documentation to line 1652, where the "TODO" comment 
is. You should make the changes in your own fork of the repo, and push. Then 
you'll be ready for a PR.

> 2. I am working on the master branch only. Is there any specific branch I 
> have to select?

Working from master in your own fork is fine, but frequent contributors often 
prefer to branch from master and work on those branches instead.

The pages I've linked to in the devguide walk you through every step of making 
a PR (including an intro on how to use Git). If it's easier for you, though, 
you can attach a copy of your edits to this issue and I can make a PR on your 
behalf. I just wouldn't count on repeating that workflow if you plan on 
contributing in the future; regular contributors should feel comfortable 
branching, committing, opening a PR, etc.

--

___
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-07 Thread brian.gallagher


New submission from brian.gallagher :

Currently difflib's get_close_matches() doesn't match similar words that differ 
in their casing very well.

Example:
user@host:~$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import difflib
>>> difflib.get_close_matches("apple", "APPLE")
[]
>>> difflib.get_close_matches("apple", "APpLe")
[]
>>>

These seem like they should be considered close matches for each other, given 
the SequenceMatcher used in difflib.py attempts to produce a "human-friendly 
diff" of two words in order to yield "intuitive difference reports".

One solution would be for the user of the function to perform their own 
transformation of the supplied data, such as converting all strings to 
lower-case for example. However, it seems like this might be a surprise to a 
user of the function if they weren't aware of this limitation. It would be 
preferable to provide this functionality by default in my eyes.

If this is an issue the relevant maintainer(s) consider worth pursuing, I'd 
love to try my hand at preparing a patch for this.

--
messages: 363618
nosy: brian.gallagher
priority: normal
severity: normal
status: open
title: [difflib] Improve get_close_matches() to better match when casing of 
words are different
versions: Python 3.6

___
Python tracker 

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



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
title: The AST is mangled when compiling starred assignments. -> The AST is 
mangled when compiling starred assignments

___
Python tracker 

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



[issue39812] Avoid daemon threads in concurrent.futures

2020-03-07 Thread Kyle Stanley


Kyle Stanley  added the comment:

I spent some further time considering the solution to the problem, and I still 
think something like a `threading.register_atexit()` (see 
https://bugs.python.org/issue37266#msg362960) would be the most suitable.

However, I'm not certain regarding the exact details. The simplest pure Python 
implementation I can think of would be through a global list in 
`Lib/threading.py`, which is only initialized when 
`threading.register_atexit()` is called for the first time (to avoid unneeded 
overhead when threading exit functions aren't needed). In order to preserve 
keyword arguments, each registered function would be appended to the list as a 
partial. Then, in the private `_shutdown()`, each registered atexit function is 
called just after the main thread is finished, but just before the non-daemon 
threads are joined:

```
_threading_atexits = None

def register_atexit(func, *args, **kwargs):
global _threading_atexits
if _threading_atexits is None:
_threading_atexits = []
call = functools.partial(func, *args, **kwargs)
_threading_atexits.append(call)

# [snip]

def _shutdown():
if _main_thread._is_stopped:
# _shutdown() was already called
return

# Main thread
tlock = _main_thread._tstate_lock
# The main thread isn't finished yet, so its thread state lock can't have
# been released.
assert tlock is not None
assert tlock.locked()
tlock.release()
_main_thread._stop()

# Call registered threading atexit functions
for atexit_call in _threading_atexits:
atexit_call()

# Join all non-deamon threads
# [snip]
```

Could something like the above pure Python implementation be adequate for our 
purposes? It seems like it would be to me, but I could very well be missing 
something. I'll of course have to test if it works as intended for replacing 
the daemon threads in concurrent.futures.

Another factor to consider is whether or not something like this would be 
widely useful enough to consider adding `threading.register_atexit()` to the 
public API for the threading module, or if it should just be an internal 
_function with a docstring. I could see it being useful in similar cases where 
daemon threads are no longer a viable option (due to subinterepter 
compatibility or any other reason). But, I suspect the demand for it won't be 
overly high from users until PEP 554 is completed.

Thoughts?

--

___
Python tracker 

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



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

2020-03-07 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Recurring theme: The stdlib has the issue of DeprecationWarning being added to 
APIs we are changing or removing a few versions in the future yet we perceive 
that many people never actually bother to try checking their code for 
deprecation warnings.  Only raising issues with a documented, warned, planned 
in advance API change when it actually happens.

Could we reduce the chances of this by enabling DeprecationWarnings by default 
for processes started via unittest.main() and other common unittest 
entrypoints?  (other test frameworks like pytest should also consider this if 
they don't already; do we have any existing external implementations of this 
for inspiration?)

One issue with this is that some important warnings are at _parse_ time or 
_import_ time.  But we can deal with import time ones if we are able to have 
the unittest entrypoint re-exec the process with the same args but with 
warnings enabled.  (and _could_ surface parse time ones if we're willing to 
accept slower process startup by disabling use of pycs; i wouldn't go that far)

Related work: https://www.python.org/dev/peps/pep-0565/

has this idea already been discussed?  I don't remember and haven't searched 
backwards...

--
components: Library (Lib), Tests
messages: 363620
nosy: gregory.p.smith, ncoghlan, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Enable DeprecationWarnings by default when not explicit in 
unittest.main()
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



[issue39812] Avoid daemon threads in concurrent.futures

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



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Caleb Hattingh


Caleb Hattingh  added the comment:

dict syntax tools make it fairy easy to compose new dicts from old ones with 
overrides:

subprocess.run(..., env={**os.environ, 'FOO': ..., 'BAR', ...}, ...)

Would this be sufficient to avoid the copy/pasting boilerplate?

--
nosy: +cjrh

___
Python tracker 

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



[issue39893] Add set_terminate() to logging

2020-03-07 Thread wyz23x2


New submission from wyz23x2 :

Sometimes, we want to remove the ending \n and sometimes replace it wit 
something else, like print(). But logging doesn't support that.
I'd want a set_terminate() (Or set_end()) function that does that. I think it's 
easy. Just insert this at line 1119 of __init__ of 3.8.2:
def set_terminator(string='\n'):
StreamHandler.terminator = string
Thanks!

--
components: Library (Lib)
messages: 363622
nosy: wyz23x2
priority: normal
severity: normal
status: open
title: Add set_terminate() to logging
type: enhancement
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



[issue39893] Add set_terminate() to logging

2020-03-07 Thread wyz23x2


wyz23x2  added the comment:

typo: "with something else", not "wit something else". Sorry for that.

--

___
Python tracker 

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



[issue39768] remove tempfile.mktemp()

2020-03-07 Thread wyz23x2


Change by wyz23x2 :


--
status: open -> closed

___
Python tracker 

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



[issue39659] pathlib calls `os.getcwd()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Caleb's answer, using PEP 584's merge operator:

newenv = os.environ | {'FOO': ..., 'BAR': ...}
subprocess.run(..., env=new_env, ...)

--
nosy: +brandtbucher

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Issue 39857 just reminded me that we should update os._Environ as well (the 
type of os.environ and os.environb).

I have another first-timer who will probably want to take it.

--

___
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-07 Thread Tim Peters


Tim Peters  added the comment:

If you pursue this, please introduce a new function for it.  You immediately 
have an idea about how to change the current function precisely because it 
_doesn't_ try to guess what you really wanted.  That lack of magic is valuable 
- you're not actually confused by what it does, because it doesn't do anything 
to the strings you give it ;-)  By the same token, if you have a crisp idea of 
how it should treat strings instead, it's straightforward to write a wrapper 
that does so.  The existing function won't fight you by trying to impose its 
own ideas.

Guessing what people really wanted tends to become a bottomless pit.  For 
example, do you know all the rules for what "case" even means in a Unicode 
world?  What about diacritical marks?  And so on.  I don't.

Not saying it shouldn't be pursued.  Am saying it may be hard to reach 
consensus on what's "really" wanted.  By some people, some of the time.  Never 
- alas - by all people all the time.

--
nosy: +tim.peters
stage:  -> needs patch
type:  -> enhancement
versions: +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



[issue39837] Remove Azure Pipelines from GitHub PRs

2020-03-07 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +18192
pull_request: https://github.com/python/cpython/pull/18835

___
Python tracker 

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



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Ah, I didn't realize that os.environ and os.environ b aren't dict subclasses. 
I've added a ticket to update them with the new operators!

--

___
Python tracker 

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



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the great catch, Brandt!

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



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d5aa2e941ccc44412b95d0e3f0a1789fbcccf403 by Brandt Bucher in 
branch 'master':
bpo-39890: Don't mutate the AST when compiling starred assignments (GH-18833)
https://github.com/python/cpython/commit/d5aa2e941ccc44412b95d0e3f0a1789fbcccf403


--
nosy: +pablogsal

___
Python tracker 

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



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`Path.samefile()` calls `os.stat()` directly. It should use the path's accessor 
object, as `Path.stat()` does.

--
components: Library (Lib)
messages: 363629
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.samefile()` calls `os.stat()` without using accessor
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



[issue39791] New `files()` api from importlib_resources.

2020-03-07 Thread Ben Thayer


Change by Ben Thayer :


--
nosy: +benthayer

___
Python tracker 

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



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester


New submission from Andy Lester :

Remove unused args from:
* binop
* compiler_next_instr
* inplace_binop

Const arguments for:
* assemble_jump_offsets
* blocksize
* check_caller
* check_compare
* check_index
* check_is_arg
* check_subscripter
* compiler_error
* compiler_new_block
* compiler_pop_fblock
* compiler_push_fblock
* compiler_warn
* compute_code_flags
* dfs
* find_ann
* get_ref_type
* merge_const_tuple
* stackdepth

--
components: Interpreter Core
messages: 363632
nosy: petdance
priority: normal
severity: normal
status: open
title: Const args and remove unused args in Python/compile.c

___
Python tracker 

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



[issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`Path.touch()` does a lot of os-specific /stuff/ that should probably live in 
the accessor. Perhaps most importantly, is calls `os.close()` on whatever 
`accessor.open()` returns, which is problematic for those wishing to write 
their own accessor that doesn't work on a file descriptor level.

--
components: Library (Lib)
messages: 363631
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.touch()` calls `os.close()` without using accessor
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



[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.is_mount()` calls `Path(self.parent)`, which:

- Is needless, as `self.parent` is already a Path instance!
- Prevents effective subclassing, as `self.parent` may be a `Path` subclass 
with its own `stat()` implementation

--
components: Library (Lib)
messages: 363633
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore 
misbehaves in `Path` subclasses
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



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

2020-03-07 Thread Andy Lester


New submission from Andy Lester :

append_formattedvalue() has an unused bool is_format_spec.

--
components: Interpreter Core
messages: 363634
nosy: petdance
priority: normal
severity: normal
status: open
title: Remove unused arg from append_formattedvalue in Python/ast_unparse.c

___
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-07 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-03-07 Thread Barney Gale


Change by Barney Gale :


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

___
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-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.expanduser()` does not call `os.path.expanduser()`, but instead 
re-implements it. The implementations look pretty similar and I can't see a 
good reason for the duplication. The only difference is that 
`pathlib.Path.expanduser()` raises `RuntimeError` when a home directory cannot 
be resolved, whereas `os.path.expanduser()` returns the path unchanged.

--
components: Library (Lib)
messages: 363635
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.expanduser()` does not call `os.path.expanduser()`
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



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

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are two reasons:

1. os.path.expanduser() returns the path unchanged when a home directory cannot 
be resolved, pathlib.Path.expanduser() raises an error. The latter behavior 
looks more robust, but we can't change os.path.expanduser().

2. os.path.expanduser() needs to split the path on components while 
pathlib.Path.expanduser() already has ready components. In some cases it may be 
more efficient.

--
nosy: +serhiy.storchaka

___
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-07 Thread Barney Gale


Barney Gale  added the comment:

We can check whether `os.path.expanduser()` returned a path beginning with "~" 
and raise a RuntimeError if so, right? On point #2, I'm not sure this 
optimization alone justifies the duplication. PR incoming...

--

___
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-07 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.__bytes__()` calls `os.fsencode()` without using path's accessor. 
To properly isolate Path objects from the underlying local filesystem, this 
should be routed via the accessor object.

--
messages: 363638
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

___
Python tracker 

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



[issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


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

___
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-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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