[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-28 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +steve.dower

___
Python tracker 

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



[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Serhiy is right, I doubt if we can do something here.
A function address is a part of its __repr__() output.

--
nosy: +asvetlov

___
Python tracker 

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



[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Even if we change the repr of functions (I like this idea), this will not solve 
the general problem: many reprs contain an object id.

In your case I suggest to post-process the pydoc output and replace parts 
matching ' at 0x[0-9a-fA-F]+'.

--

___
Python tracker 

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



[issue39474] col_offset for parenthesized expressions looks weird on attribute access

2020-01-28 Thread Batuhan


New submission from Batuhan :

Python 3.9.0a2+ (heads/master:65ecc390c1, Jan 26 2020, 15:39:11) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> source = "(2+2).source"
>>> ast.get_source_segment(source, ast.parse(source).body[0].value)
'2+2).source'
>>> source = "(2+2)[1]"
>>> ast.get_source_segment(source, ast.parse(source).body[0].value)
'2+2)[1]'

I can prepare a patch to extend attribute's col_offset into parens if it is any 
if approved.

--
components: Interpreter Core
messages: 360844
nosy: BTaskaya, benjamin.peterson, pablogsal
priority: normal
severity: normal
status: open
title: col_offset for parenthesized expressions looks weird on attribute access
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



[issue39474] col_offset for parenthesized expressions looks weird

2020-01-28 Thread Batuhan


Change by Batuhan :


--
title: col_offset for parenthesized expressions looks weird on attribute access 
-> col_offset for parenthesized expressions looks weird
type:  -> behavior

___
Python tracker 

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread Miro Hrončok

Miro Hrončok  added the comment:

In Fedora, this has started happening after the update of the following 
packages:

https://koschei.fedoraproject.org/build/7758715

 gcc
10.0.1-0.3.fc32 (in fact, there was gcc 9 in there, the report is maybe broken)
10.0.1-0.4.fc32

 libuuid
2.35-0.5.fc32
2.35-1.fc32

 glibc
2.30.9000-30.fc32
2.30.9000-31.fc32

 libselinux
3.0-1.fc32
3.0-2.fc32

 libblkid
2.35-0.5.fc32
2.35-1.fc32

 libgomp
10.0.1-0.3.fc32
10.0.1-0.4.fc32

 util-linux
2.35-0.5.fc32
2.35-1.fc32

 libmount
2.35-0.5.fc32
2.35-1.fc32

 libsmartcols
2.35-0.5.fc32
2.35-1.fc32

 libfdisk
2.35-0.5.fc32
2.35-1.fc32

--
nosy: +hroncok

___
Python tracker 

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



[issue39460] README.md

2020-01-28 Thread CRYSTAL


Change by CRYSTAL :


--
assignee:  -> docs@python
components: +Build, Cross-Build, Documentation, Installation, Interpreter Core, 
Library (Lib), SSL, Unicode, Windows
nosy: +Alex.Willmer, Hinsonlcrystal, docs@python, ezio.melotti, paul.moore, 
steve.dower, tim.golden, zach.ware -David.Edelsohn, Dormouse759, hroncok
title: test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 
3.x -> README.md
type:  -> security

___
Python tracker 

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



[issue38883] Path.home() should ignore HOME env var like os.path.expanduser()

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset c45a2aa9e255b5c7c211faa79f6b23895b64ab27 by Steve Dower 
(Christoph Reiter) in branch 'master':
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows 
(GH-17961)
https://github.com/python/cpython/commit/c45a2aa9e255b5c7c211faa79f6b23895b64ab27


--

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


Change by miss-islington :


--
pull_requests: +17609
pull_request: https://github.com/python/cpython/pull/18229

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


Steve Dower  added the comment:


New changeset c45a2aa9e255b5c7c211faa79f6b23895b64ab27 by Steve Dower 
(Christoph Reiter) in branch 'master':
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows 
(GH-17961)
https://github.com/python/cpython/commit/c45a2aa9e255b5c7c211faa79f6b23895b64ab27


--

___
Python tracker 

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



[issue38883] Path.home() should ignore HOME env var like os.path.expanduser()

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17608
pull_request: https://github.com/python/cpython/pull/18229

___
Python tracker 

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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17610
pull_request: https://github.com/python/cpython/pull/18230

___
Python tracker 

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



[issue39475] window.getmaxyx() doesn't return updated height when window is resized

2020-01-28 Thread nova


New submission from nova :

Package : python(v3.6.9)
Severity: normal

When a window object has been created using curses.newwin(), increasing
the terminal size produces the KEY_RESIZE events, but getmaxyx() returns
the previous terminal size. Only by decreasing the terminal size does it
return the correct terminal dimensions.

Attachment includes:
1. video demonstrating the effect

Following is the script to reproduce the effect:

import curses

def init_curses():
curses.initscr()
window = curses.newwin(curses.LINES - 1, curses.COLS, 0, 0)

# window = curses.initscr()

curses.raw()
curses.noecho()
curses.cbreak()
window.keypad(True)

return window

def restore_terminal(window):
curses.noraw()
curses.nocbreak()
window.keypad(False)
curses.echo()
curses.endwin()

def main():
try:
window = init_curses()
resize_no = 0
maxy, maxx = window.getmaxyx()

dimension_string = "resize_no: " + str(resize_no) + ". maxy: " + 
str(maxy) + "; maxx: " + str(maxx) + '\n'
window.addstr(dimension_string)

while True:
ch = window.getch()
window.clear()

if ch == curses.KEY_RESIZE:
resize_no += 1

maxy, maxx = window.getmaxyx()
dimension_string = "resize_no: " + str(resize_no) + ". maxy: " 
+ str(maxy) + "; maxx: " + str(maxx) + '\n'
window.addstr(dimension_string)


finally:
restore_terminal(window)

if __name__ == '__main__':
main()

--
components: Extension Modules
files: bug_curses.mp4
messages: 360849
nosy: nova
priority: normal
severity: normal
status: open
title: window.getmaxyx() doesn't return updated height when window is resized
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48868/bug_curses.mp4

___
Python tracker 

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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 13c1c3556f2c12d0be2af890fabfbf44280b845c by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-39393: Misleading error message on dependent DLL resolution failure 
(GH-18093)
https://github.com/python/cpython/commit/13c1c3556f2c12d0be2af890fabfbf44280b845c


--

___
Python tracker 

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



[issue38704] Prevent installation on unsupported Windows versions

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

Zackery - I left you a comment on the PR.

--

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +17611
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18231

___
Python tracker 

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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

Thanks, Zackery!

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



[issue38883] Path.home() should ignore HOME env var like os.path.expanduser()

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

Thanks, Christoph!

--
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-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset 595b516965ee88b817dc1b3d7713e1f3f263634d by Miss Islington (bot) 
in branch '3.8':
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows 
(GH-17961)
https://github.com/python/cpython/commit/595b516965ee88b817dc1b3d7713e1f3f263634d


--
nosy: +miss-islington

___
Python tracker 

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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset 46735c7e101753769e31c69a36d0030bb056a162 by Miss Islington (bot) 
in branch '3.8':
bpo-39393: Misleading error message on dependent DLL resolution failure 
(GH-18093)
https://github.com/python/cpython/commit/46735c7e101753769e31c69a36d0030bb056a162


--
nosy: +miss-islington

___
Python tracker 

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



[issue38883] Path.home() should ignore HOME env var like os.path.expanduser()

2020-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset 595b516965ee88b817dc1b3d7713e1f3f263634d by Miss Islington (bot) 
in branch '3.8':
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows 
(GH-17961)
https://github.com/python/cpython/commit/595b516965ee88b817dc1b3d7713e1f3f263634d


--
nosy: +miss-islington

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +17612
pull_request: https://github.com/python/cpython/pull/18232

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +17613
pull_request: https://github.com/python/cpython/pull/18233

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +17614
pull_request: https://github.com/python/cpython/pull/18234

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 148610d88a2785751ed435a4e60f07a9f1bc50a6 by Inada Naoki in branch 
'master':
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
https://github.com/python/cpython/commit/148610d88a2785751ed435a4e60f07a9f1bc50a6


--

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17616
pull_request: https://github.com/python/cpython/pull/18236

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17615
pull_request: https://github.com/python/cpython/pull/18235

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset 5a49ccac443ae84b8e142473a659c73032e9fe53 by Miss Islington (bot) 
in branch '3.7':
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
https://github.com/python/cpython/commit/5a49ccac443ae84b8e142473a659c73032e9fe53


--
nosy: +miss-islington

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

For clarity, I'm removing 3.9 from the affected versions. This version does not 
support Windows 7, and only Windows 7 is vulnerable to this DLL hijack.

Also submitting the CVE request.

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset cee5da861091cdaca99f0636af7ab8c4b0274e5f by Miss Islington (bot) 
in branch '3.8':
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
https://github.com/python/cpython/commit/cee5da861091cdaca99f0636af7ab8c4b0274e5f


--

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-28 Thread Inada Naoki


Change by Inada Naoki :


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



[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 6990d1b6131873c7f0913908162e4c723d00ea19 by Steve Dower (Adam 
Meily) in branch '3.7':
bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual 
environment (GH-16098)
https://github.com/python/cpython/commit/6990d1b6131873c7f0913908162e4c723d00ea19


--

___
Python tracker 

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



[issue39467] Allow to deprecate CLI arguments in argparse

2020-01-28 Thread hervé

hervé  added the comment:

First, thanks Raymond for your worth useful comment.

* Concerning the usage of the warning module what do you suggest to use then?  
To use "print"? 

* Concerning "hook or flag" and the 3 new params in my PR, I think developers 
would appreciate to give a customized message to their users to inform that 
something will be removed for X reasons in the X release. The "pending" notion 
could be removed to keep the API lightweight, but with a well documented 
feature I don't seen terrible thing to understand here, maybe we need to put 
more effort on documentation and example (related to my changes).

* Concerning the fact to move deprecation management outside the declaration of 
the argument, I think it could be misleading to deprecate something in another 
place in the code, in other words it could introduce some more difficulties to 
understand the code. If the deprecation is declared in the argument declaration 
then all the info are centralized in one place and the parser know what to do 
in this situation.

Thoughts?

--
nosy: +4383

___
Python tracker 

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



[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17617
pull_request: https://github.com/python/cpython/pull/18237

___
Python tracker 

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



[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

Fixed via issue39439

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
assignee: docs@python -> 
components:  -Build, Cross-Build, Documentation, Installation, Interpreter 
Core, Library (Lib), SSL, Unicode, Windows
nosy: +David.Edelsohn, Dormouse759, hroncok -Alex.Willmer, Hinsonlcrystal, 
docs@python, ezio.melotti, paul.moore, steve.dower, tim.golden, zach.ware
title: README.md -> test_zipfile: test_add_file_after_2107() fails on s390x 
Fedora Rawhide 3.x
type: security -> behavior

___
Python tracker 

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



[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0be3246d4f9c8eddcd55491901d95b09fe163f15 by Steve Dower (Adam 
Meily) in branch 'master':
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
https://github.com/python/cpython/commit/0be3246d4f9c8eddcd55491901d95b09fe163f15


--

___
Python tracker 

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



[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17618
pull_request: https://github.com/python/cpython/pull/18238

___
Python tracker 

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



[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-28 Thread Steve Dower


Change by Steve Dower :


--
resolution: duplicate -> fixed
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



[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-28 Thread miss-islington


miss-islington  added the comment:


New changeset dbb37aac1428ddcba784d9ddc77c1708c391aa80 by Miss Islington (bot) 
in branch '3.8':
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
https://github.com/python/cpython/commit/dbb37aac1428ddcba784d9ddc77c1708c391aa80


--
nosy: +miss-islington

___
Python tracker 

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



[issue24666] Buffered I/O does not take file position into account when reading blocks

2020-01-28 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy:  -Alex.Willmer, ezio.melotti, vstinner

___
Python tracker 

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



[issue24666] Buffered I/O does not take file position into account when reading blocks

2020-01-28 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
assignee: docs@python -> 
components:  -2to3 (2.x to 3.x conversion tool), Build, Cross-Build, 
Documentation, Extension Modules, FreeBSD, Installation, Interpreter Core, 
Library (Lib), SSL, Tests, Unicode, ctypes
nosy:  -docs@python, koobs

___
Python tracker 

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



[issue39476] Not convinced with the dynamic data type assignment

2020-01-28 Thread Sushma


New submission from Sushma :

Hi 

Please find below example and the compiler error,

when i'm assigning value dynamically and when we comparing in "if" loop it is 
throwing compiler error. It should not throw error it should assign and act as 
int why it is thinking as string.
Code Snippet:
print("Hello World")

num = input("Enter number ")

print(num)

if(num%3 == 0):
num+=num
print(num)

Output in Console:
Hello World
Enter number 15
15
Traceback (most recent call last):
File "main.py", line 15, in 
   if(num%3 == 0):
TypeError: not all arguments converted during string formatting

--
messages: 360865
nosy: Sush0907
priority: normal
severity: normal
status: open
title: Not convinced with the dynamic data type assignment
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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

I tried but failed to reproduce the issue on Fedora Rawhide x86-64. I built 
Python from source and run Python from its source tree:

./python -m test -v test_zipfile

Maybe the issue only occurs if Python is installed? Or it depends on the 
filesystem where the ZIP file is created?

On my Fedora 31, /tmp is mounted as a tmpfs filesystem. Using it explicitly 
doesn't make the test to fail:

./python -m test -v test_zipfile -m test_add_file_after_2107 --tempdir /tmp

--

___
Python tracker 

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



[issue39472] IDLE: improve handling of int entry in settings dialog

2020-01-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

With keeping it a StringVar, there is an issue where it writes a blank (ie, bad 
data) to the config file.  Steps to reproduce:

- Go into config dialog and click 'General' tab.
- Delete value from 'Auto squeeze min line'
- Click apply or OK.  A warning message appears in the terminal 
   Warning: config.py - IdleConf.GetOption -
   invalid 'int' value for configuration option 'auto-squeeze-min-lines'
   from section 'PyShell': ''
- Close out of IDLE.
- Start IDLE again - the warning reappears, but on the General tab, it shows 
the original value.

The issue here is that the custom config-main.cfg is being written to (and then 
read back in) with the blank.

I picked the auto-squeezer because it has validation on it - 
`validatecommand=self.digits_only`.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36350] inspect.Signature.parameters and inspect.BoundArguments.arguments should be dicts instead of OrderedDicts

2020-01-28 Thread Inada Naoki


Change by Inada Naoki :


--
nosy:  -inada.naoki
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue36350] inspect.Signature.parameters and inspect.BoundArguments.arguments should be dicts instead of OrderedDicts

2020-01-28 Thread Inada Naoki

Inada Naoki  added the comment:


New changeset 2cca8efe46935c39c445f585bce54954fad2485b by Inada Naoki (Rémi 
Lapeyre) in branch 'master':
bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412)
https://github.com/python/cpython/commit/2cca8efe46935c39c445f585bce54954fad2485b


--
nosy: +inada.naoki

___
Python tracker 

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



[issue38960] DTrace FreeBSD build fix

2020-01-28 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset aabdeb766b7fa581e7de01f3c953b12792f0736d by Petr Viktorin (David 
Carlier) in branch 'master':
bpo-38960: DTrace build fix for FreeBSD. (GH-17451)
https://github.com/python/cpython/commit/aabdeb766b7fa581e7de01f3c953b12792f0736d


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue39476] Not convinced with the dynamic data type assignment

2020-01-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The "num" variable is not a number, it *is* a string. Just because you call it 
"num" doesn't magically turn it into a number. The `input` function returns a 
string.

You might be thinking of Python 2.7 where `input` automatically evaluated the 
string as Python code. Python 3 does not do that. If you want to convert the 
string result of `input` to be a float or an int or some other type, you need 
to call the `float` or `int` functions.

--
nosy: +steven.daprano
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



[issue39468] .python_history write permission improvements

2020-01-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Reporting a better error message than just "Unknown error -1" is a good idea. 
Stating "an error occurred..." is hardly any better.

The correct error is, I think, "permission denied". Trying to diagnose the 
*specific* issue (read-only file? file owned by another user? read-only file 
system? samba permissions? etc) is probably a waste of time. The human reading 
the error can do that.

Having Python automatically run chattr -i is a bad design. If I've made the 
history file immutable, it is because I want it to be immutable, not because I 
want random applications to try to sneakily make it mutable again. Python's 
role in this should end when it reports that it doesn't have write permission 
to the file.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39477] multiprocessing Pool maxtasksperchild=0 raises exception with endless traceback

2020-01-28 Thread Tomáš Jeziorský

New submission from Tomáš Jeziorský :

The following code is expected to fail:


import multiprocessing

def f(x):
return x

if __name__ == '__main__':
with multiprocessing.Pool(2, maxtasksperchild=0) as pool:
pool.map(f, range(3))


since it uses a wrong value of the 'maxtasksperchild' parameter. I expect it to 
raise a ValueError but instead it starts to fill the stderr with practically 
endless traceback:


Process ForkPoolWorker-2:
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 95, in worker
assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
Traceback (most recent call last):
AssertionError
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 95, in worker
assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
AssertionError
Process ForkPoolWorker-4:
Process ForkPoolWorker-3:
...


I don't think this is expected behavior.
Tested with Python 3.6.9 on Ubuntu 18.04.3.

--
messages: 360872
nosy: jeyekomon
priority: normal
severity: normal
status: open
title: multiprocessing Pool maxtasksperchild=0 raises exception with endless 
traceback
type: behavior

___
Python tracker 

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



[issue39478] can we add a median function

2020-01-28 Thread Ananthakrishnan A S


New submission from Ananthakrishnan A S :

add a function called 'median' that we can use like:

list=[1,2,3,4,5,6,7,8,9] # declaring list

median(list)  #returns 5

--
components: Library (Lib)
messages: 360873
nosy: Ananthakrishnan A S
priority: normal
severity: normal
status: open
title: can we add a median function
type: enhancement
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



[issue39478] can we add a median function

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

It already exists since Python 3.4:
https://docs.python.org/dev/library/statistics.html#statistics.median

Enjoy!

--
nosy: +vstinner
resolution:  -> fixed
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



[issue39477] multiprocessing Pool maxtasksperchild=0 raises exception with endless traceback

2020-01-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue39479] can we add a lcm and gcd function.

2020-01-28 Thread Ananthakrishnan A S


New submission from Ananthakrishnan A S :

can we add an lcm and gcd function that can work as:

lcm(4,6) # returns 12

gcd(4,6) # returns 2

--
components: Library (Lib)
messages: 360875
nosy: Ananthakrishnan A S
priority: normal
severity: normal
status: open
title: can we add a lcm and gcd function.
type: enhancement
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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

There is math.gcd():
https://docs.python.org/dev/library/math.html#math.gcd

You can use numpy.lcm():
https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.lcm.html

Is it common to need lcm()? Do you have examples of applications which need 
lcm()? It's trivial to implement lcm():
https://stackoverflow.com/questions/51716916/built-in-module-to-calculate-least-common-multiple

I suggest to reject this feature request, since I never needed lcm() in 10 
years of Python, whereas I use gcd() time to time.

--
nosy: +lemburg, mark.dickinson, rhettinger, stutzbach, vstinner
title: can we add a lcm and gcd function. -> [RFE] Add math.lcm() function: 
Least Common Multiple
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Uses for lcm are common enough that it is provided by Excel and the C++ boost. 
You can use it for working out problems like:

- if event A happens every 14 days, and event B happens every 6 days, then A 
and B will occur together even lcm(14, 6) days.


By the way, the "trivial" implementation given in the Stackoverflow link has a 
bug: if both arguments are zero, it raises instead of returning zero.

I wish that gcd took an arbitrary number of arguments, I often need to find the 
gcd of three or more numbers, and this is a pain:

gcd(a, gcd(b, gcd(c, gcd(d, e)

when I could just say gcd(a, b, c, d, e) and have it work. Likewise of lcm. 
(For that matter, the gcd of a single number a is just a.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

I put the priority on release blocker to ensure that we don't miss Python 3.9 
deadline. It would be great to not miss 3.9 release.

--
nosy: +vstinner
priority: normal -> release blocker

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

reduce(gcd, [a, b, c, d, e])

--

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Ananthakrishnan A S


Ananthakrishnan A S  added the comment:

I created this issue as i came across the following question:

There are n students in class A,and m students in class B.each class divides 
into teams for a competition.What is the biggest possible team size that can be 
divided,such that  each team has same number of members.

We can solve this type of problems easily if we have lcm() in math library.And 
there are lots of real life applications where we have to use lcm.

--

___
Python tracker 

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread Marcel Plch


Marcel Plch  added the comment:

Is currently anybody actively working on this? Please, report what you have 
found out, if so.
I'd like to start digging into this tomorrow and possibly avoid any duplicit 
work.

--

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Eryk Sun


Eryk Sun  added the comment:

> For clarity, I'm removing 3.9 from the affected versions. This version 
> does not support Windows 7, and only Windows 7 is vulnerable to this
> DLL hijack.

I added 3.9 for the related issue to switch to using a static import, since 
Windows 7 isn't supported in 3.9. But I guess that should have been made a 
separate issue, or added to the omnibus issue bpo-32592.

--

___
Python tracker 

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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Ian Jackson


New submission from Ian Jackson :

The section "Fancier Output Formatting" has the example below.  This will 
remind many UK readers of the 2016 EU referendum.  About half of those readers 
will be quite annoyed.

This annoyance seems entirely avoidable; a different example which did not 
refer to politics would demonstrate the behaviour just as well.

Changing this example would (in the words of the CoC) also show more empathy, 
and be more considerate towards, python contributors unhappy with recent 
political developments in the UK, without having to make anyone else upset in 
turn.

  >>> year = 2016
  >>> event = 'Referendum'
  >>> f'Results of the {year} {event}'
  'Results of the 2016 Referendum'

  >>> yes_votes = 42_572_654
  >>> no_votes = 43_132_495
  >>> percentage = yes_votes / (yes_votes + no_votes)
  >>> '{:-9} YES votes  {:2.2%}'.format(yes_votes, percentage)' 42572654 YES 
votes  49.67%'

--
assignee: docs@python
components: Documentation
messages: 360883
nosy: diziet, docs@python
priority: normal
severity: normal
status: open
title: referendum reference is needlessly annoying
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



[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +17619
pull_request: https://github.com/python/cpython/pull/18240

___
Python tracker 

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



[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-28 Thread Brandt Bucher


Brandt Bucher  added the comment:

Perhaps. I've opened a PR to update the comment with more info.

--

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-01-28 Thread Guido van Rossum


New submission from Guido van Rossum :

See PEP 585, which is still under review and may change in response to this 
work.

https://www.python.org/dev/peps/pep-0585/

--
components: Interpreter Core
messages: 360885
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Implement PEP 585 (Type Hinting Generics In Standard Collections)
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +akuchling

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-01-28 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Fred Drake


Change by Fred Drake :


--
nosy: +fdrake

___
Python tracker 

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



[issue39469] Support for relative home path in pyvenv.cfg

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

Do note that virtual environments are not designed to be portable in general, 
so this would be a fundamental change in the design and purpose of virtual 
environments.

--
nosy: +brett.cannon, vinay.sajip

___
Python tracker 

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



[issue39469] Support for relative home path in pyvenv.cfg

2020-01-28 Thread Jeff Edwards

Jeff Edwards  added the comment:

I would say they’re not designed to be, but the also aren’t designed to not
be portable.  This is often useful where open network access isn’t
reasonable, so access to Pip/pipx/pipenv is limited at best.

Suffice to say, is there a significant reason to not allow it?

On Tue, Jan 28, 2020 at 10:28 AM Brett Cannon 
wrote:

>
> Brett Cannon  added the comment:
>
> Do note that virtual environments are not designed to be portable in
> general, so this would be a fundamental change in the design and purpose of
> virtual environments.
>
> --
> nosy: +brett.cannon, vinay.sajip
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39468] .python_history write permission improvements

2020-01-28 Thread Eryk Sun


Eryk Sun  added the comment:

This issue is due to a bug in GNU Readline (actually GNU History). It's 
documented that write_history [1] returns an errno value. But the internal 
history_do_write [2] function in this case returns the value from a rename() 
system call, via the value from histfile_restore [3]. rename() returns -1 on 
failure, which is being mishandled here as an errno value.

Actually, write permission to the original history file isn't required. GNU 
History writes to a temp file and then replaces the original via rename(). 
Normally this just requires write access to the directory. But if the directory 
or target file has the immutable file attribute set, then rename() fails with 
errno set to EPERM (at least in Linux; maybe it's a different error in BSD or 
macOS).

If not for the GNU History bug, this failed call would raise a PermissionError, 
which is already handled. Maybe it could also write an error message to stderr 
that write_history failed. For example:

def write_history():
try:
readline.write_history_file(history)
except OSError as e:
# bpo-19891: home directory does not exist or is not
# writable
if not (isinstance(e, (FileNotFoundError, PermissionError))
# bpo-39468: GNU History may return -1 as an errno value
or e.errno == -1):
raise
print('write_history failed: {!r}'.format(history),
file=sys.stderr)

I agree with Steven that the handler should not presume to modify file 
permissions or attributes.

[1] https://tiswww.case.edu/php/chet/readline/history.html#IDX29
[2] http://git.savannah.gnu.org/cgit/readline.git/tree/histfile.c#n630
[3] http://git.savannah.gnu.org/cgit/readline.git/tree/histfile.c#n458

--
nosy: +eryksun

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Ananthakrishnan A S


Ananthakrishnan A S  added the comment:

Should i proceed with adding a pull request for adding a 'lcm' function in 
python's math module.

--

___
Python tracker 

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



[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

> but now it's too change to change it again :-)

I actually don't think it is if we want to revert this. We can raise a 
deprecation warning if the call to os.fsencode() leads to a value different 
than its argument and say that people are expected to handle conversions 
themselves.

> The idea behind PEP 519 was to alleviate str(path_obj) calls between the 
> os/program interface

... where file paths were explicitly expected. os.environ is not a place where 
file paths are explicitly expected, just a place where they _might_ end up. 
Basically I only consider PEP 519 valid in places where file paths are the only 
thing that are expected (e.g. all the path manipulation functions in os.path). 
Everywhere else where paths are only a "maybe" I would say it shouldn't be 
relied upon to do implicit conversions.

> Out of curiosity, any idea how often non-strings are used to set os.environ, 
> and so need explicit conversion?

I have anecdotal evidence from outside of Python that people will do this when 
they can and then are surprised when the conversion doesn't work the way they 
expect (e.g. floats).

--

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

Did the Windows-equivalent project files also get updated?

--

___
Python tracker 

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

> Is currently anybody actively working on this? Please, report what you have 
> found out, if so. I'd like to start digging into this tomorrow and possibly 
> avoid any duplicit work.

I tried but failed to reproduce the bug on Fedora 31 and Fedora Rawhide.

I tested 3.8 and master development branches on Fedora 31 x86-64 laptop: 
"./configure --with-pydebug CFLAGS=-O0 && make && ./python -m test -v 
test_zipfile" pass.

I tested Python 3.9.0a3 on my up-to-date Fedora Rawhide x86-64 VM: "./configure 
--with-pydebug CFLAGS=-O0 && make && ./python -m test -v test_zipfile" pass. I 
also tried to install Python in /opt/py39 and run tests using 
/opt/py39/bin/python3.9: the test still pass.

I also tested Python 3.9.0a3 on an up-to-date Fedora Rawhide ppc64 mock 
container: Python configured as the Fedora package does (LTO, PGO, CFLAGS, 
LDFLAGS, etc.). test_zipfile pass as well.

Since I cannot reproduce the issue, nor access a machine which the bug occurs, 
I don't know how to debug this issue.

Can I get access to "s390x Fedora Rawhide 3.x" buildbot worker?

I didn't try to rebuild Python using the Fedora specfile. I only built Python 
manually.

--

___
Python tracker 

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



[issue39469] Support for relative home path in pyvenv.cfg

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

> Suffice to say, is there a significant reason to not allow it?

We have to support that use-case forever. ;) In all seriousness, relative paths 
get tricky when you forget to resolve the path as appropriate (and in a way 
that people expect) and it requires making sure that this will work for the 
next 30 years, so it's not a small thing to take on.

--

___
Python tracker 

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



[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-28 Thread Antony Lee


Antony Lee  added the comment:

FWIW, I'm actually fine with not supporting Path objects in os.environ, as long 
as the behavior is *consistent* with the env kwarg to subprocess.run() -- note 
that the original title of the thread only pointed out to the inconsistency, 
and did not strongly request that os.environ support Paths.

--

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Vedran Čačić

Vedran Čačić  added the comment:

I must say that the problem (with two classes divided into teams) seems to me 
to be exactly one that can be solved with gcd, and lcm itself is mostly useless 
for it.

--
nosy: +veky

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread Dino Viehland


Change by Dino Viehland :


--
pull_requests: +17621
pull_request: https://github.com/python/cpython/pull/18241

___
Python tracker 

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

$ ./python -m test tet_zipfile
0:00:00 load avg: 0.03 Run tests sequentially
0:00:00 load avg: 0.03 [1/1] tet_zipfile
test tet_zipfile crashed -- Traceback (most recent call last):
  File "/home/dje/src/cpython/Lib/test/libregrtest/runtest.py", line 270, in 
_runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File "/home/dje/src/cpython/Lib/test/libregrtest/runtest.py", line 221, in 
_runtest_inner2
the_module = importlib.import_module(abstest)
  File "/home/dje/src/cpython/Lib/importlib/__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1021, in _gcd_import
  File "", line 998, in _find_and_load
  File "", line 975, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.tet_zipfile'

tet_zipfile failed

== Tests result: FAILURE ==

1 test failed:
tet_zipfile

Total duration: 76 ms
Tests result: FAILURE

--

___
Python tracker 

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



[issue39460] test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

Sorry, posted the wrong output above.

$ ./python -m test test_zipfile
0:00:00 load avg: 0.01 Run tests sequentially
0:00:00 load avg: 0.01 [1/1] test_zipfile
test test_zipfile failed -- Traceback (most recent call last):
  File "/home/dje/src/cpython/Lib/test/test_zipfile.py", line 620, in 
test_add_file_after_2107
self.assertRaises(struct.error, zipfp.write, TESTFN)
AssertionError: error not raised by write

test_zipfile failed in 55.6 sec

== Tests result: FAILURE ==

1 test failed:
test_zipfile

Total duration: 55.6 sec
Tests result: FAILURE

--

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Ananthakrishnan A S


Ananthakrishnan A S  added the comment:

some problems that needs lcm function:

1:find the least number which when divided by 'a','b','c','d' leaves remainder 
'e' in each case.

2:person A exercises every 'n' days and person B every 'm' days. A and B both 
exercised today. How many days will it be until they exercise together again?

3:The LCM is important when adding fractions which have different denominators



we have to use the lcm function when,

1) an event that is or will be repeating over and over.
2) To purchase or get multiple items in order to have enough.
3) To figure out when something will happen again at the same time.

All these shows lcm function should be included in the math library.

So can i proceed with adding pull request to add lcm function in python's math 
module.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2020-01-28 Thread David Filiatrault


Change by David Filiatrault :


--
nosy: +David Filiatrault

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2020-01-28 Thread David Filiatrault


Change by David Filiatrault :


--
nosy: +David Filiatrault

___
Python tracker 

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



[issue39476] Not convinced with the dynamic data type assignment

2020-01-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Sushma, asking about the exception message on python-list was the right thing 
to do.  You should have waited for the answers you got there.  At this point, 
bugs in basic python operations are extremely rare.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

-1 Given that we had gcd(), I don't see any value to adding *lcm()* as well. 
 
Once you have gcd(), getting the least common multiple is trivial.

Also, it is rare to ever need a lcm() function.  I don't think I've ever seen 
it in real code.

--

___
Python tracker 

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



[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-28 Thread Eryk Sun


Eryk Sun  added the comment:

> as long as the behavior is *consistent* with the env kwarg to 
> subprocess.run() 

subprocess isn't consistent with itself across platforms. The env parameter in 
Windows is strictly an str->str mapping, like os.environ. This is coded in 
getenvironment in Modules/_winapi.c:

if (! PyUnicode_Check(key) || ! PyUnicode_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"environment can only contain strings");
goto error;
}

At a lower level, should the env parameter of os.spawnve and os.execve  allow 
path-like objects? Should (Unix) os.putenv allow the name and value to be 
path-like?

Currently these cases use PyUnicode_FSConverter and PyUnicode_FSDecoder, which 
support __fspath__ via PyOS_FSPath. PyUnicode_FSDecoder also supports the 
buffer protocol, with a warning. 

Since we have cases like this where the filesystem encoding is used for string 
data that's not actually a file path, should alternate ParseTuple converters be 
added that are limited to just str and bytes? Maybe name them 
PyUnicode_FSStringEncoder and PyUnicode_FSStringDecoder, where "String" 
emphasizes that fspath and buffer objects are not allowed. For example:

int
PyUnicode_FSStringEncoder(PyObject *path, void *addr)
{
PyObject *output = NULL;

if (path == NULL) {
Py_DECREF(*(PyObject **)addr);
*(PyObject **)addr = NULL;
return 1;
}

if (PyBytes_Check(path)) {
output = path;
Py_INCREF(output);
}
else if (PyUnicode_Check(path)) {
output = PyUnicode_EncodeFSDefault(path);
if (!output)
return 0;
}
else {
PyErr_Format(PyExc_TypeError, "path should be str or bytes, not "
"%.200s", _PyType_Name(Py_TYPE(path)));
return 0;
}

if ((size_t)PyBytes_GET_SIZE(output) !=
strlen(PyBytes_AS_STRING(output)))
{
PyErr_SetString(PyExc_ValueError, "embedded null byte");
Py_DECREF(output);
return 0;
}

*(PyObject **)addr = output;
return Py_CLEANUP_SUPPORTED;
}


int
PyUnicode_FSStringDecoder(PyObject *path, void *addr)
{
PyObject *output = NULL;

if (arg == NULL) {
Py_DECREF(*(PyObject **)addr);
*(PyObject **)addr = NULL;
return 1;
}

if (PyUnicode_Check(path)) {
output = path;
Py_INCREF(output);
}
else if (PyBytes_Check(path)) {
output = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AS_STRING(path),
PyBytes_GET_SIZE(path));
if (!output)
return 0;
}
else {
PyErr_Format(PyExc_TypeError, "path should be str or bytes, not "
"%.200s", _PyType_Name(Py_TYPE(path)));
return 0;
}

if (PyUnicode_READY(output) == -1) {
Py_DECREF(output);
return 0;
}

if (findchar(PyUnicode_DATA(output), PyUnicode_KIND(output),
 PyUnicode_GET_LENGTH(output), 0, 1) >= 0) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
Py_DECREF(output);
return 0;
}

*(PyObject **)addr = output;
return Py_CLEANUP_SUPPORTED;
}

--

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread Dino Viehland


Dino Viehland  added the comment:

Nope, thank you for pointing that out.  I've updated them now with PR 18241

--

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread Dino Viehland


Dino Viehland  added the comment:


New changeset 0cd5bff6b7da3118d0c5a88fc2b80f80eb7c3059 by Dino Viehland in 
branch 'master':
bpo-39459: include missing test files in windows installer 
https://github.com/python/cpython/commit/0cd5bff6b7da3118d0c5a88fc2b80f80eb7c3059


--

___
Python tracker 

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



[issue37860] Add netlify deploy preview for docs

2020-01-28 Thread Ernest W. Durbin III


Change by Ernest W. Durbin III :


--
pull_requests: +17622
pull_request: https://github.com/python/cpython/pull/18242

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

The Windows installer copies Lib/test/ and subdirectories: see  in Tools/msi/test/test.wixproj.

--

___
Python tracker 

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



[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think proposal this makes sense.  os.environ is a dict-like object 
providing clean access to the environment variables.  Use of Paths is an 
orthogonal problem unrelated to environment variables.

--
nosy: +rhettinger

___
Python tracker 

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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Oh come on now, this is such a trivialisation of the CoC that I cannot believe 
that it is a good-faith bug report and not a troll. I'm surprised you didn't 
toss in the words "triggered" and "micro-aggression" while you're at it.

The example has nothing to do with the UK Referendum (or for that matter, the 
2016 referendums in Zambia, Columbia, Bolivia, or Italy): the numbers are 
completely different, the results and percentages are different, and there is 
no non-arbitrary way to map Yes/No of a made up example to either Leave/Remain 
or any other actual results. If you want to read the example as a better world 
where the majority of peole voted "No" to leaving the EU, then go ahead.

Why should you privilege the Brexit referendum over (let's say) the Irish 
referendum which voted in favour of allowing same-sex marriages? Or are you 
annoyed by that too?

Any year is going to "annoy" some fraction of the readers:

2019 is the year that the Liberal Party (don't be fooled by the name: they're 
the authoritarian-right, climate-change-denying reactionary-right party) won 
the Australian Federal election on a campaign of Facebook fake news, "annoying" 
almost half the country. It is also the year that President Trump was 
impeached, annoying half of the USA. 2018 was the year Vladimir Putin was 
re-elected president of Russia, annoying and *terrifying* some percentage of 
Russians. 2017 was the year that Trump was sworn in as US President. Shall we 
go on?

2016 was also the year that Taiwan saw the first ever majority by a non-KMT 
party, and the first female prime minister, when the Democratic Progressive 
Party won their elections.

By the way, the fact that I've just spent easily half an hour getting annoyed 
at this bug report and writing this response disproves your claim about 
avoiding making others upset.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39459] test_import: test_unwritable_module() fails on AMD64 Fedora Stable Clang Installed 3.x

2020-01-28 Thread Dino Viehland


Dino Viehland  added the comment:

I guess the update to lib.pyproj probably just makes the files show up when 
opening the solution in Visual Studio then.

--

___
Python tracker 

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



[issue39469] Support for relative home path in pyvenv.cfg

2020-01-28 Thread Eryk Sun


Eryk Sun  added the comment:

> Suffice to say, is there a significant reason to not allow it?

It's poorly supported by packaging. In particular, relocating an environment 
isn't supported with entry-point scripts, which pip installs with a 
fully-qualified shebang. Moreover, entry-point scripts in Windows are created 
as exe files (e.g. "pip.exe") that embed the fully-qualified path of 
python[w].exe in the environment, plus a zipped __main__.py. For example, given 
an environment at "C:\Temp\env", running "C:\Temp\env\Scripts\pip.exe" in turn 
spawns a child process with the command line: "C:\Temp\env\Scripts\python.exe" 
"C:\Temp\env\Scripts\pip.exe". This breaks if the environment is renamed or 
relocated.

--
nosy: +eryksun

___
Python tracker 

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



[issue39469] Support for relative home path in pyvenv.cfg

2020-01-28 Thread Jeff Edwards

Jeff Edwards  added the comment:

Interesting, I hadn’t realized that it would embed the FQ Executable path,
but that does make sense overall.  I guess I had always planned on fixing
the ‘bin’ directory anyway afterwards, it’s just that the lack of relative
home made it significantly harder to encapsulate multiple environments
running with the same interpreter without having to do a complete
reinstall, and venv did seem like the best and most-pythonic way to do it.

I’ll think about it a bit more

On Tue, Jan 28, 2020 at 2:33 PM Eryk Sun  wrote:

>
> Eryk Sun  added the comment:
>
> > Suffice to say, is there a significant reason to not allow it?
>
> It's poorly supported by packaging. In particular, relocating an
> environment isn't supported with entry-point scripts, which pip installs
> with a fully-qualified shebang. Moreover, entry-point scripts in Windows
> are created as exe files (e.g. "pip.exe") that embed the fully-qualified
> path of python[w].exe in the environment, plus a zipped __main__.py. For
> example, given an environment at "C:\Temp\env", running
> "C:\Temp\env\Scripts\pip.exe" in turn spawns a child process with the
> command line: "C:\Temp\env\Scripts\python.exe"
> "C:\Temp\env\Scripts\pip.exe". This breaks if the environment is renamed or
> relocated.
>
> --
> nosy: +eryksun
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



  1   2   >