[issue14715] test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state

2020-01-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think so. I don't think the patch even did what I wanted it to do. I'll 
close it.

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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Aurora


Aurora  added the comment:

This example is practically against Python's diversity statement.

--
nosy: +opensource-assist

___
Python tracker 

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



[issue36051] Drop the GIL during large bytes.join operations?

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



[issue36051] Drop the GIL during large bytes.join operations?

2020-01-28 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset d07d9f4c43bc85a77021bcc7d77643f8ebb605cf by Bruce Merry in branch 
'master':
bpo-36051: Drop GIL during large bytes.join() (GH-17757)
https://github.com/python/cpython/commit/d07d9f4c43bc85a77021bcc7d77643f8ebb605cf


--

___
Python tracker 

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



[issue39482] Write 2to3 fixer for MutableMapping

2020-01-28 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue39476] Not convinced with the dynamic data type assignment

2020-01-28 Thread Sushma


Sushma  added the comment:

Thank you

On Tue, Jan 28, 2020, 6:30 PM Steven D'Aprano 
wrote:

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

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



[issue39482] Write 2to3 fixer for MutableMapping

2020-01-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +benjamin.peterson, xtreak

___
Python tracker 

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



[issue39482] Write 2to3 fixer for MutableMapping

2020-01-28 Thread Orion Poplawski


New submission from Orion Poplawski :

fail2ban currently relies on 2to3 for python 3 support.  Build now fails with 
python 3.9:

Traceback (most recent call last):
  File "/builddir/build/BUILD/fail2ban-0.11.1/bin/fail2ban-testcases", line 61, 
in 
tests = gatherTests(regexps, opts)
  File "./fail2ban/tests/utils.py", line 373, in gatherTests
from . import clientreadertestcase
  File "./fail2ban/tests/clientreadertestcase.py", line 34, in 
from ..client.jailreader import JailReader, extractOptions, splitWithOptions
  File "./fail2ban/client/jailreader.py", line 34, in 
from .actionreader import ActionReader
  File "./fail2ban/client/actionreader.py", line 31, in 
from ..server.action import CommandAction
  File "./fail2ban/server/action.py", line 33, in 
from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' 
(/usr/lib64/python3.9/collections/__init__.py)

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 360936
nosy: opoplawski
priority: normal
severity: normal
status: open
title: Write 2to3 fixer for MutableMapping
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



[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)

2020-01-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)

2020-01-28 Thread Joseph Gordon


Change by Joseph Gordon :


--
nosy:  -josephgordon

___
Python tracker 

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



[issue25661] tokenize.untokenize does not maintain the order of tabbed indentations and leading spaces

2020-01-28 Thread Joseph Gordon


Change by Joseph Gordon :


--
nosy:  -josephgordon

___
Python tracker 

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



[issue24249] unittest API for detecting test failure in cleanup/teardown

2020-01-28 Thread Joseph Gordon


Change by Joseph Gordon :


--
nosy:  -josephgordon

___
Python tracker 

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



[issue39320] Handle unpacking of */** arguments and rvalues in the compiler

2020-01-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue39320] Handle unpacking of */** arguments and rvalues in the compiler

2020-01-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +17623
pull_request: https://github.com/python/cpython/pull/18243

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2020-01-28 Thread Joseph Gordon


Change by Joseph Gordon :


--
nosy:  -josephgordon

___
Python tracker 

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



[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 6a65eba44bfd82ccc8bed4b5c6dd6637549955d5 by Steve Dower in branch 
'master':
bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231)
https://github.com/python/cpython/commit/6a65eba44bfd82ccc8bed4b5c6dd6637549955d5


--

___
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 agree with Raymond that it's really seldom needed. However, I'd like to point 
out that the "trivial" implementation might not be so trivial after all: as 
Steven said, it mishandles (0,0) case. And even Tim fell into that trap, so it 
can't be said it's easily avoided. I agree that this case doesn't really appear 
in "real world" tasks, but that's not really an excuse: imagine a factorial 
that didn't work for 0.

Also, a bit more often used case: seeing the code for lcm of 2 arguments, 
people might (and do; I've seen it) generalize to 3 or more arguments in a way 
that seems logical and is often correct, but not always (a*b*c//gcd(a,b,c)).

And one more tidbit: the usual formula for lcm doesn't really work for the case 
of fraction inputs. I know that currently math.gcd doesn't handle fractions, 
but it could. It's imaginable that that feature will some day be added (just 
like pow recently started supporting modular inverses), and then suddenly lcd 
implementations will silently give the wrong result for fractions.

A smart man;-) once said that the main criteria for inclusion in stdlib is that 
the function is often needed by users, _and_ it's often implemented wrong. I 
think lcm doesn't really satisfy the first criterion, but it does satisfy the 
second.

--

___
Python tracker 

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



[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-28 Thread Steve Dower


Steve Dower  added the comment:

This is now assigned CVE-2020-8315 
(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8315 
https://nvd.nist.gov/vuln/detail/CVE-2020-8315)

Thanks Anthony for the report! I included your name as the reporter, though I 
don't see it on any of the pages.

--
title: Unsafe dll loading in getpathp.c on Win7 -> [CVE-2020-8315] Unsafe dll 
loading in getpathp.c on Win7

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

In utime_stat_localtime.py, "os.stat (sec)" is the result of os.utime.
In utime_stat_localtime2.py "os.stat (sec int)" is the result of os.stat.

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

[dje@rawhide ~]$ touch testfn
[dje@rawhide ~]$ python3 -c 'import os; os.utime("testfn", (4386268800, 
4386268800))'
[dje@rawhide ~]$ stat testfn
  File: testfn
  Size: 0   Blocks: 0  IO Block: 4096   regular empty file
Device: fd00h/64768dInode: 17887487Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1001/ dje)   Gid: ( 1001/ dje)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2038-01-18 22:14:07.0 -0500
Modify: 2038-01-18 22:14:07.0 -0500
Change: 2020-01-28 21:19:14.707112199 -0500
 Birth: 2020-01-28 21:19:01.627112199 -0500
[dje@rawhide ~]$ python3 -c 'import os; st=os.stat("testfn"); print(st); 
print(tuple(st)); print(st.st_mtime_ns)'
os.stat_result(st_mode=33204, st_ino=17887487, st_dev=64768, st_nlink=1, 
st_uid=1001, st_gid=1001, st_size=0, st_atime=2147483647, st_mtime=2147483647, 
st_ctime=1580264354)
(33204, 17887487, 64768, 1, 1001, 1001, 0, 2147483647, 2147483647, 1580264354)
21474836470

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

"""
$ ./python utime_stat_localtime2.py 
os.utime (sec): 4386268800
os.stat (sec int): 2147483647
os.stat (sec float): 2147483647.0
os.stat (ns): 21474836470
"""

It doesn't make sense !? In msg360916, you had:

os.stat (sec): 4386268800 <= os.stat().st_mtime
os.stat (ns): 21474836470 <= os.stat().st_mtime._ns

How is it possible that sometimes st_mtime is right, and sometimes st_mtime is 
so plain wrong?

--

Test setting mtime in Python, reading mtime using /usr/bin/stat, then reading 
file stat in Python:

$ touch testfn

$ python3 -c 'import os; os.utime("testfn", (4386268800, 4386268800))'

$ stat testfn 
(...)
Modify: 2108-12-30 01:00:00.0 +0100
(...)

$ python3 -c 'import os; st=os.stat("testfn"); print(st); print(tuple(st)); 
print(st.st_mtime_ns)'

os.stat_result(st_mode=33204, st_ino=24648296, st_dev=40, st_nlink=1, 
st_uid=1000, st_gid=1000, st_size=0, st_atime=4386268800, st_mtime=4386268800, 
st_ctime=1580263179)
(33204, 24648296, 40, 1, 1000, 1000, 0, 4386268800, 4386268800, 1580263179)
43862688000

--

___
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 Ethan Furman


Ethan Furman  added the comment:

Well, I would prefer if Path objects were seamless to use since at one time 
they were actually strings, but I can live with Brett's rationale that they are 
only seamless where paths are explicitly expected.

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

Not -O3, but it's calling PyLong_FromLongLong on s390x as well

   0x011ca524 <+28>:brasl   %r14,0x10649b0 

--

___
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 STINNER Victor


STINNER Victor  added the comment:

I understand that os.fsencode() was modified to support the fspath protocol to 
be consistent with the C implementation PyUnicode_FSConverter() which calls 
PyOS_FSPath().

I agree that at least in C, we need two functions: one which accepts (str, 
bytes), another which also supports the fspath protocol.

IMHO PyUnicode_FSConverter() was modified to support fspath because it was 
convenient to only modify one function. But this change wasn't designed to 
decide in each function if fspath should be accepted or not.

For me, os.putenv() should not accept fspath neither.

This issue is not specific to os.environ. It's more general about the PEP 519 
implementation. IMHO the implementation should be "adjusted".

I like the deprecation idea ;-) We did something similar with functions 
accepting float by mistake. First a deprecation warning was emited, and then it 
became a hard error (exception).

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

$ ./python utime_stat_localtime2.py 
os.utime (sec): 4386268800
os.stat (sec int): 2147483647
os.stat (sec float): 2147483647.0
os.stat (ns): 21474836470

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_zipfile: test_add_file_after_2107() sometimes fails on Fedora 
Rawhide 3.x: time.localtime() limited to year 2038 -> test_zipfile: 
test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

___
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() sometimes fails on Fedora Rawhide 3.x: time.localtime() limited to year 2038

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

David Edelsohn:

> Output on s390x Fedora Rawhide:
> (...)
> os.stat (sec): 4386268800
> os.stat (ns): 21474836470

Oh wait, ns != sec * 10**9 here. "2147483647" is 2**31-1 (INT_MAX).

It looks like a bug in fill_time() of Modules/posixmodule.c. I suspect a bug in 
_PyLong_FromTime_t().

On this buildbot worker, we have:

checking size of long long... 8
checking size of time_t... 8

So _PyLong_FromTime_t() should be implemented as:

return PyLong_FromLongLong((long long)t);

_PyLong_FromTime_t() raw value is exported in os.stat() as os.stat(filename)[8].

Attached utime_stat_localtime2.py exposes it:

vstinner@apu$ ./python utime_stat_localtime2.py 
os.utime (sec): 4386268800
os.stat (sec int): 4386268800
os.stat (sec float): 4386268800.0
os.stat (ns): 43862688000

On Fedora 31 x86-64 with GCC 9.2.1, gcc -O3, _PyLong_FromTime_t() really just 
calls PyLong_FromLongLong():

(gdb) disassemble _PyLong_FromTime_t
Dump of assembler code for function _PyLong_FromTime_t:
   0x00521f30 <+0>: jmp0x457800 

--
Added file: https://bugs.python.org/file48870/utime_stat_localtime2.py

___
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() sometimes fails on Fedora Rawhide 3.x: time.localtime() limited to year 2038

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

$ ./python
Python 3.9.0a3+ (heads/master:aabdeb766b, Jan 28 2020, 13:50:48) 
[GCC 10.0.1 20200121 (Red Hat 10.0.1-0.4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.localtime(2**31)
time.struct_time(tm_year=2038, tm_mon=1, tm_mday=18, tm_hour=22, tm_min=14, 
tm_sec=8, tm_wday=0, tm_yday=18, tm_isdst=0)
>>> time.localtime(2**31-3600*24)
time.struct_time(tm_year=2038, tm_mon=1, tm_mday=17, tm_hour=22, tm_min=14, 
tm_sec=8, tm_wday=6, tm_yday=17, tm_isdst=0)
>>> time.localtime(2**32)
time.struct_time(tm_year=2106, tm_mon=2, tm_mday=7, tm_hour=1, tm_min=28, 
tm_sec=16, tm_wday=6, tm_yday=38, tm_isdst=0)
>>> time.localtime(2**33)
time.struct_time(tm_year=2242, tm_mon=3, tm_mday=16, tm_hour=8, tm_min=56, 
tm_sec=32, tm_wday=2, tm_yday=75, tm_isdst=1)

--

___
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() sometimes fails on Fedora Rawhide 3.x: time.localtime() limited to year 2038

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

Notes on the glibc:

* localtime() calls __tz_convert()
* localtime() and __tz_convert() have been modified recently to support 64-bit 
timestamp
* __tz_convert() is implemented in time/tzset.c
* localtime() is implemented in time/localtime.c

--
title: test_zipfile: test_add_file_after_2107() sometimes fails on Fedora 
Rawhide 3.x -> test_zipfile: test_add_file_after_2107() sometimes fails on 
Fedora Rawhide 3.x: time.localtime() limited to year 2038

___
Python tracker 

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



[issue15600] expose the finder details used by the FileFinder path hook

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

Since Eric never replied I'm just closing this.

--

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue14604] spurious stat() calls in importlib

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

> s390x Fedora Rawhide 3.x:
> https://buildbot.python.org/all/#/builders/323/builds/6

I also checked the configure: time_t size is 64-bit on this system, so it 
should not be impacted on the glibc/Linux kernel work on the year 2038 bug.

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

I don't see anything about localtime() or the year 2038 bug in glibc 2.30 
release notes:
https://lwn.net/Articles/795127/

I'm aware of work in the Linux kernel and glibc for the year 2038 bug, but for 
32-bit systems:
https://lwn.net/Articles/776435/

--

___
Python tracker 

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



[issue14678] Update zipimport to support importlib.invalidate_caches()

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
keywords: +easy

___
Python tracker 

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



[issue14715] test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

Do we still care about this, Eric?

--
versions: +Python 3.9 -Python 3.3

___
Python tracker 

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



[issue15693] expose glossary link on hover

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

> os.stat (sec): 4386268800
> ...
> localtime: (2038, 1, 18, 22, 14, 7)

Aha, localtime() behavior changed for timestamp larger than 2**31. What is the 
version of the glibc package?

> s390x Fedora Rawhide 3.x:
> https://buildbot.python.org/all/#/builders/323/builds/6

pythoninfo of this build says:

platform.libc_ver: glibc 2.30.9000

(Same in the latest build, build 25.)

--

On AMD64 Fedora Rawhide 3.x with glibc-2.30.9000-31.fc32.x86_64, I get years 
after 2038:

vstinner@python-builder-rawhide$ ./python
Python 3.9.0a3+ (heads/master:0cd5bff6b7, Jan 28 2020, 19:39:07) 
[GCC 10.0.1 20200123 (Red Hat 10.0.1-0.5)] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import time
>>> time.localtime(2**31)
time.struct_time(tm_year=2038, tm_mon=1, tm_mday=18, tm_hour=22, tm_min=14, 
tm_sec=8, tm_wday=0, tm_yday=18, tm_isdst=0)

>>> time.localtime(2**31-3600*24)
time.struct_time(tm_year=2038, tm_mon=1, tm_mday=17, tm_hour=22, tm_min=14, 
tm_sec=8, tm_wday=6, tm_yday=17, tm_isdst=0)

>>> time.localtime(2**32)
time.struct_time(tm_year=2106, tm_mon=2, tm_mday=7, tm_hour=1, tm_min=28, 
tm_sec=16, tm_wday=6, tm_yday=38, tm_isdst=0)

>>> time.localtime(2**33)
time.struct_time(tm_year=2242, tm_mon=3, tm_mday=16, tm_hour=8, tm_min=56, 
tm_sec=32, tm_wday=2, tm_yday=75, tm_isdst=1)

--

___
Python tracker 

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



[issue15867] make importlib documentation easier to use

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue15911] can't step through _frozen_importlib/importlib._bootstrap using pdb

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
versions: +Python 3.9 -Python 3.4

___
Python tracker 

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



[issue15911] can't step through _frozen_importlib/importlib._bootstrap using pdb

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
title: can't step through _frozen_importlib/importlib._bootstrap using gdb -> 
can't step through _frozen_importlib/importlib._bootstrap using pdb

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16101] Verify all imported modules at startup are needed

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16392] import crashes on circular imports in ext modules

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16721] configure incorrectly adds -OPT:Olimit=0 for clang

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16748] Make CPython test package discoverable

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue16826] Don't check for PYTHONCASEOK if interpreter started with -E

2020-01-28 Thread Brett Cannon


Brett Cannon  added the comment:

This is still occurring. Probably need to add `and sys.ignore_environment` to 
https://github.com/python/cpython/blob/0cd5bff6b7da3118d0c5a88fc2b80f80eb7c3059/Lib/importlib/_bootstrap_external.py#L38.

--
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



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

2020-01-28 Thread David Edelsohn


David Edelsohn  added the comment:

Output on s390x Fedora Rawhide:
$ ./python utime_stat_localtime.py 
os.utime (sec): 4386268800
os.stat (sec): 4386268800
os.stat (ns): 21474836470
stat==utime? False
localtime: (2038, 1, 18, 22, 14, 7)

--

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread STINNER Victor


STINNER Victor  added the comment:

I suspect that the timestamp set by os.utime() is not the one seen by 
os.stat(). Or maybe time.localtime() behavior changed.

Try attached utime_stat_localtime.py script.

Output on Fedora 31 in my home directory which uses btrfs:

$ python3.7 utime_stat_localtime.py 
os.utime (sec): 4386268800
os.stat (sec): 4386268800
os.stat (ns): 43862688000
stat==utime? True
localtime: (2108, 12, 30, 1, 0, 0)

--
Added file: https://bugs.python.org/file48869/utime_stat_localtime.py

___
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() sometimes fails on Fedora Rawhide 3.x

2020-01-28 Thread Miro Hrončok

Miro Hrončok  added the comment:

I think this happens "randomly" regardless of the architecture. I've seen it on 
x86_64 as well.

--
title: test_zipfile: test_add_file_after_2107() fails on s390x Fedora Rawhide 
3.x -> test_zipfile: test_add_file_after_2107() sometimes fails on Fedora 
Rawhide 3.x

___
Python tracker 

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



[issue16027] pkgutil doesn't support frozen modules

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue14787] pkgutil.walk_packages returns extra modules

2020-01-28 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

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

Do you believe that a single GCC 10 issue is affecting PPC64LE, ARM, and s390x, 
but expressed in different manners on the different architectures OR is the 
PPC64LE issue separate and architecture-depdendent?

--

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

Fedora downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=1795576

--

___
Python tracker 

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



[issue34095] [2.7] Seg fault on archlinux 32 when run tests with xvfb-run

2020-01-28 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

2.7 is dead.

--
nosy: +benjamin.peterson
resolution:  -> wont fix
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



[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Steven.  The association with Brexit is specious and the CoC 
wasn't intended to apply to second guessing technical examples.

--
assignee: docs@python -> willingc
nosy: +rhettinger, willingc
priority: normal -> low

___
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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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



  1   2   >