[issue39976] Add "**other_popen_kwargs" to subprocess API signatures in docs

2020-05-16 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +19450
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20145

___
Python tracker 

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2020-05-16 Thread Chris Jerdonek


Chris Jerdonek  added the comment:


New changeset d7184d3dbd249444ec3961641dc08a9ad3c1ac34 by Chris Jerdonek in 
branch 'master':
bpo-29587: Add another test for the gen.throw() fix. (GH-19859)
https://github.com/python/cpython/commit/d7184d3dbd249444ec3961641dc08a9ad3c1ac34


--

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


Removed file: https://bugs.python.org/file49158/new_merge.py

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


Added file: https://bugs.python.org/file49160/new_merge.py

___
Python tracker 

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



[issue40652] Test test_locale failed when running cpython test on Windows 10 x64 for version 3.9.0a6+

2020-05-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue37945

--
nosy: +xtreak

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-16 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In https://github.com/jaraco/path/issues/186, the Path project discovered a 
regression with Python 3.8. It seems that if one creates a symlink with an 
absolute path. I used `shutil.copytree('temp', 'temp2', True)` and it produced 
this result:

```
~ # dir temp
 Volume in drive C has no label.
 Volume Serial Number is B8F4-40BB

 Directory of C:\Users\jaraco\temp

2020-05-16  11:05 PM  .
2020-05-16  11:05 PM  ..
2020-05-16  11:05 PM  bar [c:\Users\jaraco\temp\foo]
2020-05-16  11:04 PM 0 foo
   2 File(s)  0 bytes
   2 Dir(s)  17,495,805,952 bytes free
~ # dir temp2
 Volume in drive C has no label.
 Volume Serial Number is B8F4-40BB

 Directory of C:\Users\jaraco\temp2

2020-05-16  11:05 PM  .
2020-05-16  11:05 PM  ..
2020-05-16  11:06 PM  bar [\\?\c:\Users\jaraco\temp\foo]
2020-05-16  11:04 PM 0 foo
   2 File(s)  0 bytes
   2 Dir(s)  17,495,846,912 bytes free
```

As you can see, in the copy, bar has an additional `\\?\` prefix on the symlink 
path. On Python 3.7 and earlier, the copy was made without mutating the 
metadata.

--
components: Windows
keywords: 3.8regression
messages: 369091
nosy: jaraco, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: shutil.copyfile mutates symlink for absolute path
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 2c8cd06afe8e0abb52367f85978f19b88e2df53e by Lysandros Nikolaou in 
branch 'master':
bpo-40334: Improvements to error-handling code in the PEG parser (GH-20003)
https://github.com/python/cpython/commit/2c8cd06afe8e0abb52367f85978f19b88e2df53e


--

___
Python tracker 

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



[issue40653] _dirnameW is used outside HAVE_SYMLINK

2020-05-16 Thread Minmin Gong


Change by Minmin Gong :


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

___
Python tracker 

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



[issue40653] _dirnameW is used outside HAVE_SYMLINK

2020-05-16 Thread Minmin Gong


New submission from Minmin Gong :

_dirnameW is defined inside #ifdef HAVE_SYMLINK/#endif, but it's used in 
os__getdiskusage_impl, which is outside HAVE_SYMLINK. So if HAVE_SYMLINK is not 
defined (e.g., on UWP), it'll have compiling issues.

--
components: Windows
messages: 369089
nosy: Minmin.Gong, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: _dirnameW is used outside HAVE_SYMLINK
type: compile error
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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6341fc7257d89d798675ad6e425f7eb0b6f2b4bb by Pablo Galindo in 
branch 'master':
bpo-38870: Use subTest in test_unparse for better error reporting (GH-20141)
https://github.com/python/cpython/commit/6341fc7257d89d798675ad6e425f7eb0b6f2b4bb


--

___
Python tracker 

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



[issue40652] Test test_locale failed when running cpython test on Windows 10 x64 for version 3.9.0a6+

2020-05-16 Thread kpysoze


New submission from kpysoze :

Test test_locale failed when running cpython test on Windows 10 x64 python.bat 
-m test -j3 on version Python 3.9.0a6+

0:19:51 load avg: 0.00 [209/423/2] test_locale failed
test test_locale failed -- Traceback (most recent call last):
  File "C:\personal\cpython\cpython\lib\test\test_locale.py", line 566, in 
test_getsetlocale_issue1813
locale.setlocale(locale.LC_CTYPE, loc)
  File "C:\personal\cpython\cpython\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

--
components: Windows
messages: 369087
nosy: kpysoze, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Test test_locale failed when running cpython test on Windows 10 x64 for 
version 3.9.0a6+
type: crash
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



[issue32309] Implement asyncio.run_in_executor shortcut

2020-05-16 Thread Kyle Stanley


Change by Kyle Stanley :


--
pull_requests: +19448
pull_request: https://github.com/python/cpython/pull/20143

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-05-16 Thread Chris Jerdonek


Change by Chris Jerdonek :


--
type:  -> behavior

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-05-16 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I posted a draft PR for this issue: https://github.com/python/cpython/pull/20142

--

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-05-16 Thread Chris Jerdonek


Change by Chris Jerdonek :


--
pull_requests: +19447
pull_request: https://github.com/python/cpython/pull/20142

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19446
pull_request: https://github.com/python/cpython/pull/20141

___
Python tracker 

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-16 Thread Dongfang Qu


Change by Dongfang Qu :


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

___
Python tracker 

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



[issue26329] os.path.normpath("//") returns //

2020-05-16 Thread Furkan Onder


Change by Furkan Onder :


--
pull_requests: +19444
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20138

___
Python tracker 

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



[issue40650] Pytime.c doesn't need to include windows.h

2020-05-16 Thread Minmin Gong


Change by Minmin Gong :


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

___
Python tracker 

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-16 Thread Dongfang Qu


Dongfang Qu  added the comment:

Document of `collections`.
https://docs.python.org/3/library/collections.html

--

___
Python tracker 

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-16 Thread Dongfang Qu


New submission from Dongfang Qu :

class:`OrderedDict` Examples: LRU implementation has a bug.
Details: 
The calls to the `__setitem__` method should also count as usages.

--
assignee: docs@python
components: Documentation
messages: 369083
nosy: Dongfang Qu, docs@python
priority: normal
severity: normal
status: open
title: class:`OrderedDict` Examples: LRU implementation has a bug.

___
Python tracker 

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



[issue26329] os.path.normpath("//") returns //

2020-05-16 Thread Furkan Onder


Furkan Onder  added the comment:

PR has been sent!

--
nosy: +furkanonder

___
Python tracker 

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



[issue40650] Pytime.c doesn't need to include windows.h

2020-05-16 Thread Minmin Gong


Change by Minmin Gong :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
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



[issue40649] [Errno 1]

2020-05-16 Thread Glenn Travis


Glenn Travis  added the comment:

I think that I will ask him to reinstall Python. Which can be a scary process 
for him.

--

___
Python tracker 

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



[issue40650] Pytime.c doesn't need to include windows.h

2020-05-16 Thread Minmin Gong


New submission from Minmin Gong :

Python/pytime.c includes windows.h for timeval. But it's not necessary to 
include the full header, because timeval is defined in winsock headers.

--
messages: 369082
nosy: Minmin.Gong
priority: normal
severity: normal
status: open
title: Pytime.c doesn't need to include windows.h

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-16 Thread Glenn Travis


Change by Glenn Travis :


Added file: https://bugs.python.org/file49159/errormessage.jpg

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-16 Thread Glenn Travis


Glenn Travis  added the comment:

I think that there is something odd going on with his python install.
He just tried to run a very simple python script that I made for him,

print('Hello there python interperter')

And he got the same error message again.  I do not know what more information 
you need, I sent the copy and paste terminal error text.

--

___
Python tracker 

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



[issue35890] Cleanup some non-consistent API callings

2020-05-16 Thread Minmin Gong


Change by Minmin Gong :


--
pull_requests: +19442
pull_request: https://github.com/python/cpython/pull/19974

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2020-05-16 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 837f9e42e3a1ad03b340661afe85e67d2719334f by Christian Heimes in 
branch 'master':
bpo-40645: Deprecated internal details of hmac.HMAC (GH-20132)
https://github.com/python/cpython/commit/837f9e42e3a1ad03b340661afe85e67d2719334f


--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dff92bb31f7db1a80ac431811f8108bd0ef9be43 by Batuhan Taskaya in 
branch 'master':
bpo-38870: Implement round tripping support for typed AST in ast.unparse 
(GH-17797)
https://github.com/python/cpython/commit/dff92bb31f7db1a80ac431811f8108bd0ef9be43


--

___
Python tracker 

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



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

2020-05-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

> The >else"#fca"< code was added 6 years ago (commit 
> 8b95d5e0bf00d9d0098579d29fd6bb9322071879)

That was my typo in turtledemo.__main__ (similar lines before had the space) 
and I wish that it had been caught then.  

Why did compileall in the test suite not catch this SyntaxError before 3.6.0a6 
was released?  Does it intentionally skip .__main__ files?  Should I add a 
test_turtledemo file (with checks for the presence of tkinter and turtle)?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e966af7cff78e14e1d289db587433504b4b53533 by Batuhan Taskaya in 
branch 'master':
bpo-38870: Correctly handle empty docstrings in ast.unparse (GH-18768)
https://github.com/python/cpython/commit/e966af7cff78e14e1d289db587433504b4b53533


--

___
Python tracker 

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



[issue39740] Select module fails to build on Solaris 11.4

2020-05-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

@RobHammann it should be resolved now, please feel free to re-open issue if you 
get into trouble (I manually tested on solaris)

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



[issue40211] Clarify preadv and pwritev is supported AIX 7.1 and newer.

2020-05-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue40165] Hide stderror from the user if command failes

2020-05-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue40165] Hide stderror from the user if command failes

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d5a980a60790571ec88aba4e011c91e099e31e98 by Batuhan Taskaya in 
branch 'master':
bpo-40165: Suppress stderr when checking if test_stty_match should be skipped 
(GH-19325)
https://github.com/python/cpython/commit/d5a980a60790571ec88aba4e011c91e099e31e98


--
nosy: +pablogsal

___
Python tracker 

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



[issue39740] Select module fails to build on Solaris 11.4

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 31245d19f2de03e57fd93c5169f00a36d7410fcf by Batuhan Taskaya in 
branch 'master':
bpo-39740: Early declare devpoll_methods to support old compilers (GH-19281)
https://github.com/python/cpython/commit/31245d19f2de03e57fd93c5169f00a36d7410fcf


--
nosy: +pablogsal

___
Python tracker 

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



[issue40211] Clarify preadv and pwritev is supported AIX 7.1 and newer.

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset cae2275949157490b469d79ef250387eca324b9e by Batuhan Taskaya in 
branch 'master':
bpo-40211: Clarify os.preadv and os.pwritev are supported on AIX 7.1+ (GH-19401)
https://github.com/python/cpython/commit/cae2275949157490b469d79ef250387eca324b9e


--

___
Python tracker 

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



[issue32309] Implement asyncio.run_in_executor shortcut

2020-05-16 Thread Chris Jerdonek


Change by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue40644] Text representation of Windows' file attributes similar to stat.filemode()

2020-05-16 Thread Eryk Sun


Eryk Sun  added the comment:

There's no reason this can't be generalized to file attributes/flags on other 
platforms such as st_flags on BSD/macOS and st_attributes on Linux (depending 
on bpo-39533 -- but statx only returns a small subset of attributes that are 
available via chattr and lsattr).

Here's a table of approximately corresponding file attributes in BSD, Linux, 
and Windows:


BSD [1] Linux   Windows

UF_NODUMP   STATX_ATTR_NODUMP -d
UF_APPEND   STATX_ATTR_APPEND -a
STATX_ATTR_ENCRYPTED -E FILE_ATTRIBUTE_ENCRYPTED -E
UF_COMPRESSED   STATX_ATTR_COMPRESSED -cFILE_ATTRIBUTE_COMPRESSED -C
UF_IMMUTABLESTATX_ATTR_IMMUTABLE -i FILE_ATTRIBUTE_READONLY -R [2]
UF_NOUNLINK FILE_ATTRIBUTE_READONLY -R [2]
UF_READONLY FILE_ATTRIBUTE_READONLY -R
UF_HIDDEN   FILE_ATTRIBUTE_HIDDEN -H
UF_SYSTEM   FILE_ATTRIBUTE_SYSTEM -S
UF_ARCHIVE  FILE_ATTRIBUTE_ARCHIVE -A
UF_SPARSE   FILE_ATTRIBUTE_SPARSE_FILE -P
UF_REPARSE  FILE_ATTRIBUTE_REPARSE_POINT -L
UF_OFFLINE  FILE_ATTRIBUTE_OFFLINE -O

[1] Not supported on all BSD platforms, including macOS.
[2] Readonly applies to regular file data, not metadata or directory
contents (index data). Also, it disallows unlink but allows rename.

> not surprisingly I miss all windows attributes. On the top of that I 
> get only values of stat.S_IWRITE and stat.S_IREAD as documented in
> os.chmod().

Windows doesn't implement a direct equivalent of the Unix file mode. But 
Windows file attributes partially overlap the Unix file mode for the S_IFMT 
filetype bits. In particular, WinAPI GetFileType classifies an open file based 
on the device type as one of FILE_TYPE_CHAR (S_IFCHR), FILE_TYPE_PIPE (S_IFIFO, 
S_IFSOCK), or FILE_TYPE_DISK (S_IFBLK, S_IFREG, S_IFDIR, S_IFLNK). For the 
latter, FILE_ATTRIBUTE_DIRECTORY and FILE_ATTRIBUTE_REPARSE_POINT distinguish 
S_IFDIR and reparse points, including S_IFLNK, depending on the reparse tag. 
The lack of either attribute indicates S_IFREG, and no support for file 
attributes indicates S_IFBLK. For example:

>>> stat.filemode(os.stat('//./nul').st_mode) # S_IFCHR
'c-'
>>> stat.filemode(os.stat('//./pipe').st_mode) # S_IFIFO
'p-'
>>> stat.filemode(os.stat('//./C:').st_mode) # S_IFBLK
'b-'

(Apparently, we aren't fabricating any bogus permissions for the above cases.)

Free of charge, you also get a hack that sets the execute bit on directories, 
and also on files that have a file extension in the set {".COM", ".EXE", 
".BAT", ".CMD"}. Caveat emptor: this has nothing to do with whether the file or 
directory actually grants the caller execute access.

>>> stat.filemode(os.stat('C:/').st_mode) # S_IFDIR
'drwxrwxrwx'
>>> os.stat('C:/Temp/spam.bat').st_file_attributes & 
stat.FILE_ATTRIBUTE_READONLY
1
>>> os.readlink('C:/Temp/symlink.bat')
'spam.bat'
>>> stat.filemode(os.lstat('C:/Temp/symlink.bat').st_mode) # S_IFLNK
'lrwxrwxrwx'
>>> stat.filemode(os.stat('C:/Temp/symlink.bat').st_mode) # S_IFREG
'-r-xr-xr-x'

Regarding the permission mode bits, many environments (including Python) misuse 
FILE_ATTRIBUTE_READONLY as a write permission, i.e. readonly removes the 
S_IWUSR | S_IWGRP | S_IWOTH bits. Certainly readonly should be a factor in 
os.access(), but it is not a permission; no one can be granted permission to 
write to a readonly file. Using it as such is inconsistent with UF_IMMUTABLE in 
BSD and STATX_ATTR_IMMUTABLE in Linux. It's also inconsistent with how write 
permission works in Unix, since readonly disallows deleting the file, which has 
nothing to do with write permission on a file in Unix.

--
nosy: +eryksun

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed by Batuhan Taskaya in 
branch 'master':
bpo-38870: Don't put unnecessary parentheses on class declarations in ast.parse 
(GH-20134)
https://github.com/python/cpython/commit/25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed


--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ce4a753dcb3eef3d68e892a6515490b1aa219651 by Batuhan Taskaya in 
branch 'master':
bpo-38870: Do not separate factor prefixes in ast.unparse (GH-20133)
https://github.com/python/cpython/commit/ce4a753dcb3eef3d68e892a6515490b1aa219651


--

___
Python tracker 

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



[issue39959] Bug on multiprocessing.shared_memory

2020-05-16 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 5.0 -> 6.0
pull_requests: +19441
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20136

___
Python tracker 

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



[issue34556] Add --upgrade-deps to venv module

2020-05-16 Thread Shantanu


Change by Shantanu :


--
nosy: +hauntsaninja
nosy_count: 4.0 -> 5.0
pull_requests: +19440
pull_request: https://github.com/python/cpython/pull/20135

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-16 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Glenn, this is probably not a bug in Python and more information about the 
error and the context would be needed if it was. Bugs must be reproducible to 
be looked at and fixed and your post does not contain enough information to do 
so.

You should redirect your friend to a forum like StackOverflow or the 
python-help mailing list to get help with his script.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19439
pull_request: https://github.com/python/cpython/pull/20134

___
Python tracker 

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



[issue37630] Investigate replacing SHA3 code with OpenSSL

2020-05-16 Thread Christian Heimes


Christian Heimes  added the comment:

I'll add a whatsnew later.

--
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


Added file: https://bugs.python.org/file49158/new_merge.py

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


Removed file: https://bugs.python.org/file49157/new_merge.py

___
Python tracker 

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



[issue37630] Investigate replacing SHA3 code with OpenSSL

2020-05-16 Thread miss-islington


miss-islington  added the comment:


New changeset d5b3f6b7f9fc74438009af63f1de01bd77be9385 by Christian Heimes in 
branch 'master':
bpo-37630: Use SHA3 and SHAKE XOF from OpenSSL (GH-16049)
https://github.com/python/cpython/commit/d5b3f6b7f9fc74438009af63f1de01bd77be9385


--
nosy: +miss-islington

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-16 Thread Glenn Travis


Change by Glenn Travis :


--
title: [Errno 1} -> [Errno 1]

___
Python tracker 

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



[issue40649] [Errno 1}

2020-05-16 Thread Glenn Travis


New submission from Glenn Travis :

A fellow on the X-Plane forum reported getting this:

cd desktop/Ortho4XP-130

ianrobertson@Ians-iMac Ortho4XP-130 % python3 Ortho4XP_v130.py

/Library/Frameworks/Python.framework/Versions/3.8/bin/python3: can't open file 
'Ortho4XP_v130.py': [Errno 1] Operation not permitted

he is able to run python3.8.2 from the terminal and get it to work with the 
interpreter for a print('Howdy') but Ortho4Xp not.

is this a python thing, an ortho thing or some root cause from installing 
python?

--
messages: 369065
nosy: TotallyLost
priority: normal
severity: normal
status: open
title: [Errno 1}

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19438
pull_request: https://github.com/python/cpython/pull/20133

___
Python tracker 

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



[issue32893] ast.literal_eval() shouldn't accept booleans as numbers in AST

2020-05-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No longer reproduced.

--
resolution:  -> out of date
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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

For comparison, I'm attaching an iterative version that manipulates the tree 
nodes with all local variables.  Try it out and see what you think.

--
Added file: https://bugs.python.org/file49157/new_merge.py

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that there is no much benefit in avoiding to import modules which are 
imported in libregrtest. In particular threading, subprocess, tempdir, os, 
fnmatch, etc. You should minimize import of test.libregrtest + test.support, 
not just test.support. BTW, libregrtests imports now much more modules than 
test.support.

Also, some modules, like bz2 are too small and do not have much dependencies. 
You will not save much on importing them lazily. On other hand, lazy import 
have its cost, so the real benefit will be even smaller.

--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-05-16 Thread P12 Pfx


Change by P12 Pfx :


--
nosy: +P12 Pfx

___
Python tracker 

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



[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink

2020-05-16 Thread Chris AtLee


Chris AtLee  added the comment:

Is there anything I can do to help get this landed? The PR in github works for 
me.

--
nosy: +catlee

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2020-05-16 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19437
pull_request: https://github.com/python/cpython/pull/20132

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-16 Thread hai shi


Change by hai shi :


--
pull_requests: +19436
pull_request: https://github.com/python/cpython/pull/20131

___
Python tracker 

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



[issue36264] os.path.expanduser should not use HOME on windows

2020-05-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> I thought it might be useful for testing purposes if os.path (i.e. ntpath and 
> posixpath) had a way to set the home directory that it uses in way that 
> wouldn't affect other libraries and child processes.

I was thinking about this, and I'd argue that in the general case, you _want_ 
to be able to set the home directory in a way that affects child processes. If 
you care enough to try to isolate the behavior from the user-local state, you 
probably want other libraries and child processes to honor that isolation.

This argument extends to there being a (preferably one) way override a home 
directory that's honored by tools and processes of all flavors (e.g. overriding 
USERPROFILE has no effect on git commands in a subprocess).

I agree it may prove useful not to affect the global and subprocess state if 
possible, but I'd argue in that case, you could probably just patch the library 
under test directly.

These processes patching $HOME really are attempting to suppress the user's 
local state (or simulate a specific state).

> Not for me in PowerShell 5 and 7:

Weird. You're right, I get the same thing for test-path. And indeed it's not 
set in the Python process.

PS C:\WINDOWS\system32> test-path env:home
False
PS C:\WINDOWS\system32> python -c "import os; print(os.environ.get('HOME'))"
None

But strangely, $HOME seems to have some effect.

PS C:\WINDOWS\system32> echo $HOME  
C:\Users\jaraco
PS C:\WINDOWS\system32> cd $HOME
PS C:\Users\jaraco>

Do you know what that's about?

I found a couple [Powershell users that seem to think setting $HOME is 
something you would want to 
do](https://stackoverflow.com/questions/32109375/in-powershell-how-do-i-set-home-variable-before-running-a-script).

And [this Powershell 
documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7#environment-variables-that-store-preferences)
 makes reference to $HOME.

I see. Powershell defines $HOME as an [Automatic 
Variable](https://ss64.com/ps/syntax-automatic-variables.html) internally but 
doesn't expose it as an environment variable.

--

___
Python tracker 

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



[issue40503] PEP 615: Add zoneinfo module

2020-05-16 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset b17e49e0def23238b9e7f48c8a02e2d7bbf1f653 by Paul Ganssle in 
branch 'master':
bpo-40503: Add documentation and what's new entry for zoneinfo (GH-20006)
https://github.com/python/cpython/commit/b17e49e0def23238b9e7f48c8a02e2d7bbf1f653


--

___
Python tracker 

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



[issue40646] Builtins in doc show signature in documentation

2020-05-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

It's a common convention to show a function with parens, even if it can't be 
called with no arguments. I don't think we want to make that table visually 
more complex by including all of the message signatures. open() has 8 params, 
min() and max() have multiple signatures, etc.

You could argue that removing the parens would be an improvement, since all 
items in the table are functions, but I think it's fine as it is.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40648] File mode is not tested on Windows

2020-05-16 Thread Pavol Babinčák

Change by Pavol Babinčák :


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

___
Python tracker 

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



[issue40647] Building with a libreadline.so located outside the ld.so.conf search path fails

2020-05-16 Thread Martijn Pieters


Martijn Pieters  added the comment:

Last but not least, this is essentially a duplicate of 
https://bugs.python.org/issue4010

--

___
Python tracker 

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



[issue40648] File mode is not tested on Windows

2020-05-16 Thread Pavol Babinčák

New submission from Pavol Babinčák :

>From what I can tell only place where file mode is tested is test_mode() 
>method of class TestFilemode in test_stat.py. Relevant section for Windows 
>(os.name != 'posix'):

with open(TESTFN, 'w'):
  pass

...

os.chmod(TESTFN, 0o700)
st_mode, modestr = self.get_mode()
self.assertEqual(modestr[:3], '-rw')
self.assertS_IS("REG", st_mode)
self.assertEqual(self.statmod.S_IFMT(st_mode),
 self.statmod.S_IFREG)

Doesn't test that files under Windows can have only two modes:
- 0o444 - If os.chmod() is missing stat.S_IWRITE. Effectively readonly.
- 0o666 - Regular file by default.

On the top of that I believe last two assertions are equivalent - test file is 
regular. But that would be for a different issue, I guess.

--
components: Tests
messages: 369056
nosy: scrool
priority: normal
severity: normal
status: open
title: File mode is not tested on Windows
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



[issue40647] Building with a libreadline.so located outside the ld.so.conf search path fails

2020-05-16 Thread Martijn Pieters


Martijn Pieters  added the comment:

Actually, this won't do it either, as `self.lib_dirs` already contains the 
--prefix.

Clearly, I just need to add -R=${PREFIX}/lib to CPPFLAGS.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue40647] Building with a libreadline.so located outside the ld.so.conf search path fails

2020-05-16 Thread Martijn Pieters


New submission from Martijn Pieters :

This issue goes back a long time. The libreadline handling in the modules 
setup.py doesn't add the location of the readline library to the runtime 
library paths:

self.add(Extension('readline', ['readline.c'],
   library_dirs=['/usr/lib/termcap'],
   extra_link_args=readline_extra_link_args,
   libraries=readline_libs))

This requires the readline library to have been added to a traditional location 
or has taken care of either ld.so.conf or LD_LIBRARY_PATH.

I'm building a series of Python binaries with a custom `--prefix` where I also 
installed a local copy of readline (so both are configured with the same 
prefix), and while setup.py finds the correct library, importing the compiled 
result fails because no `RPATH` is set.

This could be fixed by adding the parent path of the located `libreadline` 
shared library as a `runtime_library_dirs` entry:

readline_libdirs = None
if do_readline not in self.lib_dirs:
readline_libdirs = [
os.path.abspath(os.path.dirname(do_readline))
]

self.add(Extension('readline', ['readline.c'],
   library_dirs=['/usr/lib/termcap'],
   extra_link_args=readline_extra_link_args,
   runtime_library_dirs=readline_libdirs,
   libraries=readline_libs))

--
components: Extension Modules
messages: 369054
nosy: mjpieters
priority: normal
severity: normal
status: open
title: Building with a libreadline.so located outside the ld.so.conf search 
path fails
type: compile error
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



[issue40646] Builtins in doc show signature in documentation

2020-05-16 Thread Henk-Jaap Wagenaar


New submission from Henk-Jaap Wagenaar :

Due to a certain discussion on extending zip, I was having looking at this page:

https://docs.python.org/3/library/functions.html

It lists the builtins at the top as e.g. all() which I think is confusing: 
running all() will actually fail.

I think it should either (using "all" as example):
1. display as "all"
2. display as "all(iterable)" (what to do about 'overloaded' functions like 
e.g. range?)

I am happy to provide a PR for the preferred option.

--
assignee: docs@python
components: Documentation
messages: 369053
nosy: cryvate, docs@python
priority: normal
severity: normal
status: open
title: Builtins in doc show signature in documentation
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



[issue39305] Merge nntplib._NNTPBase and nntplib.NNTP

2020-05-16 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks, that's a nice simplification of the code ;-)

--

___
Python tracker 

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



[issue40642] Cpython "pystate.h" subdirectory wrong

2020-05-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Won't either one work, since "Include" is in the "search path"? Is this causing 
an actual problem? You have this marked as "compile error", but haven't shown 
any information about the error, such as what compiler, how it's being invoked, 
and what the error message is. We need some more information.

If this were to be changed (which I'm not advocating unless there's a real 
problem), would it be better as "initconfig.h" or "./initconfig.h"? I think 
they're equivalent.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2020-05-16 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +19434
pull_request: https://github.com/python/cpython/pull/20129

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2020-05-16 Thread Christian Heimes


New submission from Christian Heimes :

Python's hmac module provides a pure Python based implementation on top of the 
hashlib module. OpenSSL offers a dedicated HMAC implementation that has a 
couple of benefits over pure Python implementation:

- OpenSSL HMAC is slightly faster and requires slightly less memory and 
allocations.
- Python's HMAC only works for RFC 2104 HMACs with digests like MD5, SHA1, 
SHA2, and SHA3. Other digests types like Blake2 use a completely different 
style of HMAC. OpenSSL's HMAC API works for all sorts of digests. OpenSSL 3.0.0 
also supports Blake2 MAC with its standard API.
- OpenSSL HMAC is standard and compliance conform. Certain compliance 
restrictions require that MAC and keyed hashing is implemented in a certain 
way. Our HMAC code is considered a custom implementation of a crypto primitive 
and in violation of compliance rules.

For 3.9 I plan to deprecate hmac.HMAC.digest_con, hmac.HMAC.inner, and 
hmac.HMAC.outer attributes. They are implementation specific details any way. 
I'm also going to provide a _hashlib.hmac_new() function so we can test the new 
code.

For 3.10 I'll be switching over to _haslib.hmac_new() when the digestmod is a 
string or a callable that returns _hashlib.HASH code.

--
assignee: christian.heimes
components: Extension Modules
messages: 369050
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: patch review
status: open
title: Use OpenSSL's HMAC API
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



[issue36264] os.path.expanduser should not use HOME on windows

2020-05-16 Thread Eryk Sun

Eryk Sun  added the comment:

> I’m not suggesting that from within Python there should be another way 
> to detect a home directory. The expanduser functionality as written is
> just fine for that, though I agree with Steve that using an API on 
> Windows would be even better.

I thought it might be useful for testing purposes if os.path (i.e. ntpath and 
posixpath) had a way to set the home directory that it uses in way that 
wouldn't affect other libraries and child processes.

> It seems other tools like 'git' honor the HOME directory:

Many cross-platform projects follow Unix conventions, which is simpler for 
development and documentation. These projects are often targeted at developers, 
who usually have a strong understanding of Unix conventions and system 
configuration. But Python is a general-purpose scripting language used for 
everything from system administration to major applications. It needs to follow 
platform conventions, but it should also abstract away platform differences as 
much as possible. 

> Interestingly, I notice that Powershell does set the $HOME environment

Not for me in PowerShell 5 and 7:

PS C:\> test-path 'env:userprofile'
True
PS C:\> test-path 'env:home'
False

--

___
Python tracker 

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



[issue40643] Improve doc-strings for datetime.strftime & strptime

2020-05-16 Thread Paul Ganssle


Paul Ganssle  added the comment:

I agree, this can be improved (particularly the first one). I believe we'll 
need to change it in the C implementation as well as the pure python version.

That said, the most useful thing for users would be a full formatting 
reference, which is too much to put in the docstring (and to maintain in at 
least 3 different places). I'm not sure *how* much better it can get, but at 
least the first one reads like a terrible self-referential dictionary entry 
"recyclist (n). a proponent of recyclism". At the very least it should 
disambiguate between `datetime.strftime`, `time.strftime` and `stftime(3)`.

--
nosy: +p-ganssle
priority: normal -> low
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2020-05-16 Thread Paul Ganssle


Paul Ganssle  added the comment:

This is now merged, thanks for the debate and opinions offered everyone, and 
thanks to Dong-hee for the implementation!

The way we did the implementation, a pickle/unpickle cycle on the result of 
.isocalendar() will return a plain tuple. Despite the fact that I suggested it, 
I recognize that this is a /weird thing to do/, and I'm sorta banking on the 
fact that in all likelihood no one is relying on pickling and unpickling the 
result of .isocalendar() returning anything but a tuple (since, currently, 
that's already what it does, regardless of what the input type was).

I suppose we'll have to see if it causes problems in the beta period, and I'll 
keep a close eye on it.

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



[issue24416] Have date.isocalendar() return a structseq instance

2020-05-16 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset 1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330 by Paul Ganssle in 
branch 'master':
bpo-24416: Return named tuple from date.isocalendar() (GH-20113)
https://github.com/python/cpython/commit/1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330


--

___
Python tracker 

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



[issue36264] os.path.expanduser should not use HOME on windows

2020-05-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

> Platform differences can be papered over with functions.

I’m not suggesting that from within Python there should be another way to 
detect a home directory. The expanduser functionality as written is just fine 
for that, though I agree with Steve that using an API on Windows would be even 
better.

The issue is that from outside Python there’s now no platform-agnostic way to 
override the home directory, either for tests or to suppress user-local 
configuration. In addition to the test case, there is a user-facing use-case 
that's made more complicated:

- A user needs to bypass the logged-in user's state for a Python command. For 
example, there was a buggy release (of something) that stored some broken state 
in the users’ home dir, and the workaround is to run some command with an 
alternate home dir. Communicating that technique to a multi-platform audience 
is now much more difficult.

It was previously difficult enough because “set an environment variable” is a 
shell-dependent operation, so already requires the user to have some expertise 
on how to set environment variables in their environment.

This change requires the guidance to be more complicated or for the expertise 
to be greater.


> Breakage due to HOME being overridden is serious because it won't show up in 
> any other cases - Python will be the first to suffer the consequences

Evidence is to the contrary.

It seems other tools like 'git' honor the HOME directory:

PS C:\Users\jaraco> $env:HOME = "C:\Users\jaraco\temp"
PS C:\Users\jaraco> git config --global --list
fatal: unable to read config file 'C:/Users/jaraco/temp/.gitconfig': No such 
file or directory

Interestingly, I notice that Powershell does set the $HOME environment variable 
on Windows, reinforcing the concept that $HOME is a platform agnostic way to 
communicate a home directory.

It does appear as if [Ruby honors HOME and sets it if unset on 
Windows](https://stackoverflow.com/a/13670703/70170). I'm not a fan of setting 
the variable, but there is precedent.

It seems to me Python 3.8 is the outlier and that honoring $HOME, while 
somewhat awkward on Windows, was a valuable unifying behavior, and its removal 
without any plans for a replacement is causing harm. Just searching through 
some of the projects I have checked out, I find a few.

Here's [another real-world example relying on Python honoring HOME to override 
home](https://github.com/jaraco/path/blob/7789c621bb494e7c2de871221638aa642126a805/test_path.py#L1142).

[Until 
recently](https://github.com/python/cpython/commit/7ea9a85f132b32347fcbd2cbe1b553a2e9890b56),
 PDB used to look exclusively at $HOME and [the backport still 
does](https://github.com/jaraco/backports.pdb/blob/8fa8e80043a09103adac5b19cb29fe0cf5d0328c/backports/pdb.py#L164-L178).

Devpi client [relies on setting home for 
tests](https://github.com/devpi/devpi/blob/7b2a40e87e9927a28eb554d0454130cd663e34f3/client/testing/test_use.py#L380).


> we are facing a targeted exploit.

What is the exploit? I don't think the downsides of honoring HOME on Windows 
were captured above.

>From what I could tell, there was one (fairly obscure) case where HOME was set 
>unexpectedly. That hardly seems like a justification to reverse a 
>long-standing documented feature that aligns with the expectation of other 
>tools in the ecosystem.

--

___
Python tracker 

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



[issue40633] json.dumps() should encode float number NaN to null

2020-05-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think we want to generate output no matter what. Should datetime 
instances become null instead of raising an exception?

Are there types other than float where some values are json serializable and 
others aren't?

--

___
Python tracker 

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



[issue40633] json.dumps() should encode float number NaN to null

2020-05-16 Thread Haoyu SUN

Haoyu SUN  added the comment:

About using null in JSON to represnet NaN value of a float type, I prefer this 
logic: float is a numeric type that expecting a number as its value, "Not a 
Number" on a numeric type is equivalent to None (¬Number ∩ NumericValues = 
Empty). If we need to capture an error in calculation or input data, we can use 
the allow_nan option to catch it. Database connectors such as SQLAlchemy 
translate an empty field as float('nan') for a float number field. Probably we 
can safely take it as a convention. No idea yet for representing infinity.

Once encoded, there is no way to know a null originates from NaN or None 
without additional fields.

The direct conversion from Python data types to JSON may lose part of 
information due to JSON's limited data types. When converting a BMP image to 
GIF, we have to eliminate some colors to fit in the small pallet and we do not 
expect to restore the full information BMP image has from its GIF counterpart.

I suggest we make the JSON module have at least an option to generate 
 standard-compliant JSON regardless potential loss of information, instead of 
leaving each application to have its subclass of JSONEncoder just for this 
corner case.

--

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2020-05-16 Thread Eric Wieser


Eric Wieser  added the comment:

This seems somewhat related to https://bugs.python.org/issue31939

--
nosy: +Eric Wieser

___
Python tracker 

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



[issue40644] Text representation of Windows' file attributes similar to stat.filemode()

2020-05-16 Thread Pavol Babinčák

New submission from Pavol Babinčák :

I'm using Windows and lets' say I have this directory structure listed with cmd:

> dir /A
...

16.05.20  11:15  directory
16.05.20  10:47 0 hidden
16.05.20  11:25  link [regular]
16.05.20  10:47 0 readonly
16.05.20  11:15 0 regular
16.05.20  10:48 0 system

...

or PowerShell:

PS > dir -Force

ModeLastWriteTime Length Name
- -- 
d-  16.5.20 11:15directory
-a-h--  16.5.20 10:47  0 hidden
-a---l  16.5.20 11:25  0 link
-ar---  16.5.20 10:47  0 readonly
-a  16.5.20 11:15  0 regular
-a--s-  16.5.20 10:48  0 system

or attrib:

> attrib
A   Hhidden
Alink
AR   readonly
Aregular
A  S system




I'd like to print file attributes in a text form. If I use stat.filemode():

>>> import os, stat
>>> print("\n".join(["{} {}".format(stat.filemode(os.stat(n).st_mode), n) for n 
>>> in os.listdir('.')])) 
drwxrwxrwx directory
-rw-rw-rw- hidden
-rw-rw-rw- link
-r--r--r-- readonly
-rw-rw-rw- regular
-rw-rw-rw- system
>>>

not surprisingly I miss all windows attributes. On the top of that I get only 
values of stat.S_IWRITE and stat.S_IREAD as documented in os.chmod().


I'd like to have a new function, let's say fileattributes() which would behave 
like this:

>>> print("\n".join(["{} 
>>> {}".format(stat.fileattributes(os.stat(n).st_file_attributes), n) for n in 
>>> os.listdir('.')]))
d- directory
-a-h-- hidden
-a---l link
-ar--- readonly
-a regular
-a--s- system
>>>

In this example I have used same format of attributes as in PowerShell because 
it is most similar to filemode().

I guess link cannot be currently identified with contants in stat module.

--
components: Library (Lib)
messages: 369041
nosy: scrool
priority: normal
severity: normal
status: open
title: Text representation of Windows' file attributes similar to 
stat.filemode()
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



[issue40643] Improve doc-strings for datetime.strftime & strptime

2020-05-16 Thread Edison Abahurire


New submission from Edison Abahurire :

The docstring for strftime is:
```def strftime(self, fmt):
"Format using strftime()."
```

And that of strptime:
def strptime(cls, date_string, format):
'string, format -> new datetime parsed from a string (like 
time.strptime()).'


I feel like both could use a better explanation for users who will access them 
using >>> help(datetime.strftime) and users using IDEs that provide doc-strings 
on-hover over a function.

--
messages: 369040
nosy: edison.abahurire, nanjekyejoannah
priority: normal
severity: normal
status: open
title: Improve doc-strings for datetime.strftime & strptime

___
Python tracker 

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



[issue39305] Merge nntplib._NNTPBase and nntplib.NNTP

2020-05-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

I am no closing this issue :)

Thank you for the suggestion, Victor.
And also thank you for the interest in this issue, Luciana :)

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



[issue39305] Merge nntplib._NNTPBase and nntplib.NNTP

2020-05-16 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset aa92a7cf210c98ad94229f282221136d846942db by Dong-hee Na in branch 
'master':
bpo-39305: Update nntplib to merge nntplib.NNTP and nntplib._NNTPBase (GH-19817)
https://github.com/python/cpython/commit/aa92a7cf210c98ad94229f282221136d846942db


--

___
Python tracker 

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



[issue40445] compileall.compile_dir docs aren't updated for bpo-38112

2020-05-16 Thread STINNER Victor


Change by STINNER Victor :


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



[issue25920] PyOS_AfterFork should reset socketmodule's lock

2020-05-16 Thread STINNER Victor


STINNER Victor  added the comment:

> I'd drop this code instead of fixing it.

Hum, FreeBSD, OpenBSD and NetBSD versions which require the fix also look very 
old. So I agree that it became safe to remove the fix.

Would it make sense to only fix it on Python 3.10 and leave other versions with 
the bug? Or should fix all Python versions?

--

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> "Availability: Windows, Linux, Unix systems supporting 
> CLOCK_THREAD_CPUTIME_ID." covers AIX.
That was my thought too, thanks again!

--

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-16 Thread STINNER Victor


STINNER Victor  added the comment:

I close the issue, since the commit was merged.

"Availability: Windows, Linux, Unix systems supporting 
CLOCK_THREAD_CPUTIME_ID." covers AIX. But you can add AIX if you consider that 
it's not explicit enough.

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



[issue36264] os.path.expanduser should not use HOME on windows

2020-05-16 Thread Paul Moore


Paul Moore  added the comment:

> Perhaps the best approach for the sake of POSIX compatibility is to set HOME 
> on startup to the correct value? 

If Python starts setting `HOME`, that has the potential to affect programs 
called in a subprocess, possibly breaking them (making them not find the user's 
config, for example). Even if we only set `HOME` when it's not already set, we 
can get this issue. (Vim, for example, will break if you set HOME to somewhere 
other than where the user has their config stored).

Certainly, it's arguable that such programs are not respecting Windows 
conventions correctly, but in practical terms that's not really that relevant. 
The user will just see it as "Python can't call my program correctly".

This is a very real issue, that I used to hit a lot in the past, when native 
Windows support was a lot less common in open source code than it is now. And 
it was nearly always made worse by the programs that tried to be "too clever" 
about hiding the differences between Windows and Unix.

So I'm a strong -1 on Python doing anything with `HOME` here.

--

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Should we mention about AIX support in availability section @vstinner? 
https://docs.python.org/3/library/time.html#time.thread_time

--

___
Python tracker 

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



[issue40641] Reserved word pair used in lambda tutorial without being noted as a reserved word

2020-05-16 Thread Mark Dickinson


Change by Mark Dickinson :


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



[issue40275] test.support has way too many imports

2020-05-16 Thread miss-islington


miss-islington  added the comment:


New changeset 372fa3ead584876a975a61936b376259be636d27 by Hai Shi in branch 
'master':
bpo-40275: lazy import modules in test.support (GH-20128)
https://github.com/python/cpython/commit/372fa3ead584876a975a61936b376259be636d27


--
nosy: +miss-islington

___
Python tracker 

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



[issue25920] PyOS_AfterFork should reset socketmodule's lock

2020-05-16 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The macOS test checks if the binary targets macOS 10.4 or earlier.  Those 
versions of macOS have been out of support for a very long time, and we haven't 
had installers targeting those versions of macOS for a long time as well.  2.7 
and 3.5 had installers targeting macOS 10.5, current installers target macOS 
10.9. 

IMHO macOS 10.4 has moved into museum territory and I wouldn't bother 
supporting it anymore.

Support for USE_GETADDRINFO_LOCK is only enabled for very old OS releases, the 
OS that stopped requiring this the latest is OpenBSD in 2013 (7 years ago). The 
other OSes stopped requiring this in code in 2007 (13 years ago).

I'd drop this code instead of fixing it.

--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-16 Thread hai shi


hai shi  added the comment:

After PR20128, the import modules from 132 to 123.

--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-16 Thread hai shi


hai shi  added the comment:

OK, I continue to reduce the import module in test.supports.

--

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-16 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the fix!

--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-05-16 Thread hai shi


Change by hai shi :


--
pull_requests: +19433
pull_request: https://github.com/python/cpython/pull/20128

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-16 Thread STINNER Victor


Change by STINNER Victor :


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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 45410862321ae509e8753f239b0ea28fdcef5bad by Batuhan Taskaya in 
branch 'master':
bpo-40192: Use thread_cputime for time.thread_time to improve resolution 
(GH-19381)
https://github.com/python/cpython/commit/45410862321ae509e8753f239b0ea28fdcef5bad


--

___
Python tracker 

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



  1   2   >