[issue35810] Object Initialization does not incref Heap-allocated Types

2020-02-23 Thread Christian Tismer


Christian Tismer  added the comment:

> How does this change affect stable ABI? Is it necessary to change the 
> logic in modules that use only the Py_LIMITED_API?

If you use heap types, you need to adjust refcounts beginning
with Python 3.8 . And since the Py_LIMITED_API uses heap types
without hiding these refcount changes by an API call,
this breaks the stable API.

But it is easily fixable by a runtime version check, or you start
over with Python 3.8 as lowest version .

--

___
Python tracker 

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



[issue31718] some methods of uninitialized io.IncrementalNewlineDecoder objects raise SystemError

2020-02-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
nosy_count: 5.0 -> 6.0
pull_requests: +18006
pull_request: https://github.com/python/cpython/pull/18640

___
Python tracker 

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



[issue39736] const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

2020-02-23 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset c3fa634096eedbaf477698adab666f03085a7928 by Andy Lester in branch 
'master':
closes bpo-39736: const strings in Modules/_datetimemodule.c and 
Modules/_testbuffer.c (GH-18637)
https://github.com/python/cpython/commit/c3fa634096eedbaf477698adab666f03085a7928


--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Ethan Furman


Ethan Furman  added the comment:

`Fraid not.  It is still going to be a case-by-case basis -- sometimes the 
previous exception just doesn't add any value, and sometimes it does.

PEP3134 did add a lot of justification for your changes, though.

--

___
Python tracker 

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



[issue39672] SIGSEGV crash on shutdown with shelve & c pickle

2020-02-23 Thread zd nex


Change by zd nex :


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



[issue15474] Differentiate decorator and decorator factory in docs

2020-02-23 Thread Andrei Daraschenka

Andrei Daraschenka  added the comment:

Hi, Andrés Delfino. Are you still working on it? I could help with this issues.

--
nosy: +dorosch

___
Python tracker 

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



[issue39693] tarfile's extractfile documentation is misleading

2020-02-23 Thread Andrei Daraschenka


Change by Andrei Daraschenka :


--
keywords: +patch
nosy: +dorosch
nosy_count: 3.0 -> 4.0
pull_requests: +18005
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18639

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Ram Rachum


Ram Rachum  added the comment:

Ethan, did we successfully convince you not to use `from None`?

--

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-23 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-23 Thread Dennis Sweeney


New submission from Dennis Sweeney :

The following tiny change:

diff --git a/Objects/listobject.c b/Objects/listobject.c
index 3c39c6444b..3ac03b71d0 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2643,8 +2643,7 @@ list_richcompare(PyObject *v, PyObject *w, int op)

 Py_INCREF(vitem);
 Py_INCREF(witem);
-int k = PyObject_RichCompareBool(vl->ob_item[i],
- wl->ob_item[i], Py_EQ);
+int k = PyObject_RichCompareBool(vitem, witem, Py_EQ);
 Py_DECREF(vitem);
 Py_DECREF(witem);
 if (k < 0)

Creates the following performance improvement:

Before:
> .\python.bat -m timeit -s "A = list(range(10**7)); B = list(range(10**7))" 
> "A==B"
2 loops, best of 5: 134 msec per loop
> .\python.bat -m timeit -s "A = list(range(10**7)); B = list(range(10**7))" 
> "A==B"
2 loops, best of 5: 134 msec per loop

After:
> .\python.bat -m timeit -s "A = list(range(10**7)); B = list(range(10**7))" 
> "A==B"
2 loops, best of 5: 126 msec per loop
> .\python.bat -m timeit -s "A = list(range(10**7)); B = list(range(10**7))" 
> "A==B"
2 loops, best of 5: 126 msec per loop

--
components: Interpreter Core
messages: 362566
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Speed up list.__eq__ by about 6%
type: performance
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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue39712] Doc for `-X dev` option should mention PYTHONDEVMODE

2020-02-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue39736] const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

2020-02-23 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39736] const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

2020-02-23 Thread Andy Lester


New submission from Andy Lester :

In Modules/_datetimemodule.c, the char *timespec and char *specs[] can be made 
const.  Their contents are never modified.

In ndarray_get_format in Modules/_testbuffer.c, char *fmt can be made const.

--
components: Interpreter Core
messages: 362565
nosy: petdance
priority: normal
severity: normal
status: open
title: const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

___
Python tracker 

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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread miss-islington


miss-islington  added the comment:


New changeset c97fc564a6c76ba5287f1b16bc841a1765820b0c by Miss Islington (bot) 
in branch '3.8':
bpo-39649: Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry 
(GH-18531)
https://github.com/python/cpython/commit/c97fc564a6c76ba5287f1b16bc841a1765820b0c


--

___
Python tracker 

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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread miss-islington


miss-islington  added the comment:


New changeset 097612a3f711f5a6a3aec207cad78a35eb3a756d by Miss Islington (bot) 
in branch '3.7':
bpo-39649: Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry 
(GH-18531)
https://github.com/python/cpython/commit/097612a3f711f5a6a3aec207cad78a35eb3a756d


--

___
Python tracker 

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



[issue39735] Signal handler is invoked recursively

2020-02-23 Thread Masahiro Sakai


New submission from Masahiro Sakai :

If I run following program, the parent process fails with "RecursionError: 
maximum recursion depth exceeded", because the signal handler is invoked during 
the execution of the same handler.


import os
import signal
import time

def f(signum, frame):
time.sleep(1)

signal.signal(signal.SIGUSR1, f)

parent_pid = os.getpid()
child_pid = os.fork()
if child_pid == 0:
for i in range(10):
os.kill(parent_pid, signal.SIGUSR1)
time.sleep(0.01)
else:
os.waitpid(child_pid, 0)


This behavior is in contrast to other languages such as C or Ruby.

In C, when a handler function is invoked on a signal, that signal is 
automatically blocked during the time the handler is running, unless SA_NODEFER 
is specified.

In Ruby, signal handler is handled in a way similar to Python (i.e. flag is set 
by C-level signal handler and Ruby/Python-level signal handler is executed 
later point which is safe for VM), but it prevents recursive signal handler 
invocation. (Related issue and commit: https://bugs.ruby-lang.org/issues/6009 
https://github.com/ruby/ruby/commit/6190bb4d8ad7a07ddb1da8fc687b20612743a34a )

I believe that behavior of C and Ruby is desirable, because writing reentrant 
signal handler is sometimes error prone.

--
components: Extension Modules
messages: 362562
nosy: msakai
priority: normal
severity: normal
status: open
title: Signal handler is invoked recursively
type: behavior

___
Python tracker 

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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18002
pull_request: https://github.com/python/cpython/pull/18636

___
Python tracker 

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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39649] bdb.Bdb.format_stack_entry: checks for obsolete __args__

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 4015d1cda3cdba869103779eb6ff32ad798ff885 by Daniel Hahler in 
branch 'master':
bpo-39649: Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry 
(GH-18531)
https://github.com/python/cpython/commit/4015d1cda3cdba869103779eb6ff32ad798ff885


--
nosy: +terry.reedy

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread miss-islington


miss-islington  added the comment:


New changeset d57f99929a4013741f14233ed6e517ad6c9b24d0 by Miss Islington (bot) 
in branch '3.7':
bpo-39654: Update pyclbr doc to reflect additional information returned 
(GH-18528)
https://github.com/python/cpython/commit/d57f99929a4013741f14233ed6e517ad6c9b24d0


--

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread miss-islington


miss-islington  added the comment:


New changeset 973348427e3e987f42ea8a871e18c8d17b5abf52 by Miss Islington (bot) 
in branch '3.8':
bpo-39654: Update pyclbr doc to reflect additional information returned 
(GH-18528)
https://github.com/python/cpython/commit/973348427e3e987f42ea8a871e18c8d17b5abf52


--

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +17999
pull_request: https://github.com/python/cpython/pull/18633

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset aea045adb8c90394264908670cbc495c5a41b65e by Hakan Çelik in branch 
'master':
bpo-39654: Update pyclbr doc to reflect additional information returned 
(GH-18528)
https://github.com/python/cpython/commit/aea045adb8c90394264908670cbc495c5a41b65e


--

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18000
pull_request: https://github.com/python/cpython/pull/18634

___
Python tracker 

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



[issue38597] C Extension import limit

2020-02-23 Thread Xinfa Zhu


Xinfa Zhu  added the comment:

Thanks Steve. Here is what you requested.

xinfa@LAPTOP-71TBJKSA MINGW64 /c/Program Files (x86)/Microsoft Visual Studio
$ ./Installer/vswhere.exe
Visual Studio Locator version 2.7.1+180c706d56 [query version 2.3.2200.14893]
Copyright (C) Microsoft Corporation. All rights reserved.

xinfa@LAPTOP-71TBJKSA MINGW64 /c/Program Files (x86)/Microsoft Visual Studio
$ find . -name "vcvarsall.bat"
./2019/BuildTools/VC/Auxiliary/Build/vcvarsall.bat

xinfa@LAPTOP-71TBJKSA MINGW64 /c/Program Files (x86)/Microsoft Visual Studio
$ find . -name "vcruntime140.dll"
./2019/BuildTools/VC/Redist/MSVC/14.24.28127/onecore/x64/Microsoft.VC142.CRT/vcruntime140.dll
./2019/BuildTools/VC/Redist/MSVC/14.24.28127/onecore/x86/Microsoft.VC142.CRT/vcruntime140.dll
./2019/BuildTools/VC/Redist/MSVC/14.24.28127/x64/Microsoft.VC142.CRT/vcruntime140.dll
./2019/BuildTools/VC/Redist/MSVC/14.24.28127/x86/Microsoft.VC142.CRT/vcruntime140.dll
./2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/vcruntime140.dll
./2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x86/vcruntime140.dll
./2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx86/x64/vcruntime140.dll
./2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx86/x86/vcruntime140.dll
./Installer/resources/app/ServiceHub/Services/Microsoft.VisualStudio.Setup.Service/vcruntime140.dll
./Installer/vcruntime140.dll

xinfa@LAPTOP-71TBJKSA MINGW64 /c/Program Files (x86)/Microsoft Visual Studio


I want mention that I have 301 extension modules. I used setuptools in my 
setup.py
from setuptools import setup
from setuptools.extension import Extension
python setup.py build_ext
python setup.py bdist_wheel
I bring the whl file to another computer, pip install, then launch the app and 
I get this error
ImportError: DLL load failed: A dynamic link library (DLL) initialization 
routine failed.

I tried using distutils instead, but it says: error: invalid command 
'bdist_wheel'
from distutils.core import setup
from distutils.extension import Extension

--

___
Python tracker 

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



[issue39654] pyclbr: remove old references to class browser & add explain readmodule

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Unlike the 3.9 code and doc change in #39411, this doc change applies since 
3.7.  It does not conflict with #39411.

--
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2020-02-23 Thread Berker Peksag


Change by Berker Peksag :


--
keywords: +patch
nosy: +berker.peksag
nosy_count: 3.0 -> 4.0
pull_requests: +17998
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18632

___
Python tracker 

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



[issue39653] test_posix fails during make test

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

My understanding that Python is compiled and installed and that the failure was 
during a later test.

In repository master (3.9) the line is 1549 instead of 1529.  The test function 
code is

def test_no_such_executable(self):
no_such_executable = 'no_such_executable'
try:
pid = self.spawn_func(no_such_executable,
  [no_such_executable],
  os.environ)
# bpo-35794: PermissionError can be raised if there are
# directories in the $PATH that are not accessible.
except (FileNotFoundError, PermissionError) as exc:
self.assertEqual(exc.filename, no_such_executable)
else:
pid2, status = os.waitpid(pid, 0)
self.assertEqual(pid2, pid)
self.assertNotEqual(status, 0)

It is part of a mixin class and once mixed in, spawn_func is either posix_spawn 
or posix_spawnp.  The first parameter is 'path'.

"The path parameter is the path to the executable file.The path should contain 
a directory.  Use posix_spawnp() to pass an executable file without directory."

FileNotFoundError and PermissionError are subclasses of OSError.  So is 
NotADirectoryError.  I was initially tempted to say that either the latter 
should be added to the tuple or that the tuple should be replaced by OSError.  
However, the test failed with posix_spawnp, when the path should not be 
required to have a directory.  So I wonder if there is a problem with this 
function on this Debian.  (I do not work with Linux at all.)

Zachary, could you try adding NotADirectoryError to the exception list and see 
if the test
self.assertEqual(exc.filename, no_such_executable)
passes?

--
components: +Library (Lib), Tests -Installation
nosy: +larry, vstinner
stage:  -> test needed
type: compile error -> behavior

___
Python tracker 

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



[issue37539] CheckCommitCursorReset regression sqlite3 test fails with old sqlite3

2020-02-23 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report and for the patch!

The minimum supported SQLite 3 version in Python 3 is 3.7.2 as declared at 
https://github.com/python/cpython/blob/9f37872e307734666a7169f7be6e3370d3068282/setup.py#L1364
 

While it's still 3.0.8 in Python 2.7 
(https://github.com/python/cpython/blob/249706c1fbce04125d81bd9993e6c010ae30f8e4/setup.py#L1175),
 I think we can live without the patch as Python 2.7 is now officially dead.

Of course, we can still apply it if one of our 2.7 buildbots were failing due 
to an ancient version of SQLite 3.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions:  -Python 3.8, Python 3.9

___
Python tracker 

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



[issue39642] Behaviour of disabled widgets: widget.bind(func) -vs- w = widget(command=func)

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am sure that the behavior you observe is correct.  The default button click 
handler must check the state before calling the command function, while I 
presume that your printBtn_onclick function (not shown) does not.  If Serhiy 
disagrees, he can reopen.

--
nosy: +terry.reedy
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



[issue39636] Can't change Treeview row color in Tkinter

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When I ran the initial test code of #36468, everything was black on white.  
When I added Matthew Barnett's fix, both text and background were changed.  
Until we get test code and version information that we can run and verify a 
problem with the fix, I am closing this.

The fix was copied from the tk buglist, https://core.tcl.tk/tk/info/509cafafae, 
where it got other verifications.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue36468] Treeview: wrong color change

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I verified that problem continues on Windows with 3.8 and 3.9 alpha (with tk 
8.6.9 -- might get updated later) and that fix posted by Matthew works.  I am 
testing because of #39636.

--
nosy: +terry.reedy
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2020-02-23 Thread Ido Michael


Ido Michael  added the comment:

Created PR, most of the documentation besides the func signature looked 
alright: GH-18631

--

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17997
pull_request: https://github.com/python/cpython/pull/18631

___
Python tracker 

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



[issue38597] C Extension import limit

2020-02-23 Thread Steve Dower


Steve Dower  added the comment:

Okay, looking at _find_vcvarsall in distutils, I'm guessing that something 
about how your machines are set up means that the vcredist search is failing.

First, could you specify which versions of Visual Studio you have installed, 
and if possible which one is being found and used by your builds.

Then, if you can search your install to find both vcvarsall.bat and 
vcruntime140.dll (there will be a few of these) and post the paths, that may 
indicate if the layout isn't consistent.

Distutils will try and dynamically link to the runtime if you have the redist, 
and statically link it if you don't (though I don't remember why it doesn't 
just rely on the copy included with Python... probably future-proofing or 
licencing).

--

___
Python tracker 

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



[issue39681] pickle.load expects an object that implements readinto

2020-02-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b19f7ecfa3adc6ba1544225317b9473649815b38 by Miss Islington (bot) 
in branch '3.8':
bpo-39681: Fix C pickle regression with minimal file-like objects (GH-18592) 
(#18630)
https://github.com/python/cpython/commit/b19f7ecfa3adc6ba1544225317b9473649815b38


--

___
Python tracker 

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



[issue39734] Deprecate readinto() fallback path in _pickle.c

2020-02-23 Thread Antoine Pitrou


New submission from Antoine Pitrou :

In issue39681 we reestablished the fallback to read() when a file-like object 
doesn't provide readinto() in _pickle.c.  However, doing so leads to lower 
performance and all file-like object should nowadays provide readinto() (simply 
by deriving from the right base class - e.g. io.BufferedIOBase).

I propose to issue a DeprecationWarning when the fallback behaviour is 
selected, so that one day we can finally remove it.

--
components: Library (Lib)
messages: 362547
nosy: ogrisel, pierreglaser, pitrou
priority: low
severity: normal
status: open
title: Deprecate readinto() fallback path in _pickle.c
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



[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -17994

___
Python tracker 

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



[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39681] pickle.load expects an object that implements readinto

2020-02-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9f37872e307734666a7169f7be6e3370d3068282 by Antoine Pitrou in 
branch 'master':
bpo-39681: Fix C pickle regression with minimal file-like objects (#18592)
https://github.com/python/cpython/commit/9f37872e307734666a7169f7be6e3370d3068282


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue39681] pickle.load expects an object that implements readinto

2020-02-23 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-02-23 Thread Marco Sulla

Marco Sulla  added the comment:

I think in this case the error is more trivial: simply `Programs/_testembed.c` 
is compiled with g++ but it should be compiled with gcc.

Indeed, there are much gcc-only options in the compilation of 
`Programs/_testembed.c`, and g++ complains about them:

> cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ 
> is not valid for C++
> cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not 
> for C++

--

___
Python tracker 

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



[issue39732] plistlib should export UIDs in XML like Apple does

2020-02-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



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

2020-02-23 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

After opening the PR, I see that add_signal_handler is not supported on 
non-unix event loop. After looking at the code, it seems there is no problem to 
implement it for other platforms, as it relies on signal.set_wakeup_fd() which 
seems to support all platforms. Should I open an enhancement issue for 
implementing add_signal_handler for all platforms?

--

___
Python tracker 

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



[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 4.0 -> 5.0
pull_requests: +17994
pull_request: https://github.com/python/cpython/pull/18629

___
Python tracker 

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



[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is more complicated. In the following example

try:
try:
raise TypeError
except:
try:
try:
raise OverflowError
except:
raise ValueError
except:
raise KeyError from None
except BaseException as exc:
e = exc

the __context__ chain is KeyError -> ValueError -> OverflowError -> TypeError. 
We want to suppress ValueError and OverflowError, and keep KeyError -> 
TypeError. I afraid that the chain of exceptions just do not have enough 
information to do this. Maybe analyzing tracebacks can help, but it looks too 
complex.

Maybe the simpler solution is to "cut" __context__ when we leave an exception 
handler. If __suppress_context__ is true and the current handled exception is 
not __context__, set it as __context__.

Here is a PR which implements this solution. I am not sure that it is correct, 
and it may miss some corner cases, it is just an example. Pay attention to the 
ipaddress module: in some cases we want to suppress more than one exception, 
and currently it is inconvenient.


Maybe we incorrectly handle exception chains. Maybe they should be build in a 
way similar to tracebacks: initially set __context__ to None and add a handled 
exception to the end of the chain when leave an exception handler.

--

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy:  -rhettinger

___
Python tracker 

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



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

2020-02-23 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

After digging into asyncio, I stumbled upon this particularly suspicious block 
in BaseEventLoop._run_once: 
https://github.com/python/cpython/blob/v3.9.0a3/Lib/asyncio/base_events.py#L1873

handle = self._ready.popleft()
if handle._cancelled:
continue
if self._debug:
...
handle._run()
...
else:
handle._run()

As you can see, a callback is popped from the dequeue of ready callbacks, and 
only after a couple of lines that callback is called. The question arises, what 
happens if an exception is raised in between? Or more specifically, What 
happens to that callback if a KeyboardInterrupt is raised before it is called?
Well, appparently it dies and becomes one with the universe. The chances of it 
happening are the highest when the ioloop is running very short coroutines 
(like sleep(0)), and are increased when debug is on (because more code is 
executed in between).

This is how the bug we've been experiencing came to life:
When SIGINT is received it raises a KeyboardInterrupt in the running frame. If 
the running frame is a coroutine, it stops, the exception climbs up the stack, 
and the ioloop shuts down. Otherwise, the KeyboardInterrupt is probably raised 
inside asyncio's code, somewhere inside run_forever. In that case, the ioloop 
stops and proceeds to cancel all of the running tasks. After cancelling all the 
tasks, asyncio actually reruns the ioloop so all tasks receive the 
CancelledError and handle it or just die (see 
asyncio.runners._cancel_all_tasks).
Enter our bug; sometimes, randomly, the loop gets stuck waiting for all the 
cancelled tasks to finish. This behavior is caused by the flaw I described 
earlier - if the KeyboardInterrupt was raised after a callback was popped and 
before it was run, the callback is lost and the task that was waiting for it 
will wait forever.
Depending on the running tasks, the event loop might hang on the select call 
(until a interrupted by a signal, like SIGINT). This is what happens in 
SleepTest.py. Another case might be that only a part of the ioloop gets stuck, 
and other parts that are not dependent on the lost call still run correctly 
(and run into a CancelledError). This behavior is demonstrated in the script I 
added to this thread, asyncio_bug_demo.py.

I see two possible solutions:
1. Make all the code inside run_forever signal safe
2. Override the default SIGINT handler in asyncio.run with one more fitting the 
way asyncio works

I find the second solution much easier to implement well, and I think it makes 
more sense. I think python's default SIGINT handler fits normal single-threaded 
applications very well, but not so much an event loop. When using an event loop 
it makes sense to handle a signal as an event an process it along with the 
other running tasks. This is fully supported by the ioloop with the help of 
signal.set_wakeup_fd.
I have implemented the second solution and opened a PR, please review it and 
tell me what you think!

--
Added file: https://bugs.python.org/file48906/asyncio_bug_demo.py

___
Python tracker 

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



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

2020-02-23 Thread Maor Kleinberger


Change by Maor Kleinberger :


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

___
Python tracker 

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



[issue39733] Bug in hypergeometric function

2020-02-23 Thread SilentGhost


SilentGhost  added the comment:

Hi, this is a wrong bug tracker. You can report numpy issues at 
https://github.com/numpy/numpy/issues and scipy one's at 
https://github.com/scipy/scipy/issues

--
nosy: +SilentGhost
resolution:  -> third party
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



[issue39733] Bug in hypergeometric function

2020-02-23 Thread 12345NotFromHere54321


New submission from 12345NotFromHere54321 :

I want to evaluate Kummer's hypergeometric function. 

Code:
import scipy.special as sc
import numpy as np
 
#Parameters etc:
p=2 
s = -4.559190954155 -51.659216953928*1j

Evaluation:
s = -4.559190954155 -51.659216953928*1j
sc.hyp1f1(1/p, 1/p + 1, -s) 

Output:
(0.721-2.57668886227691e-13j)
This is close to 1 and agrees with Mathematica (see below)

Because the parameters 1/p and 1/p+1 are real, we know that if we replace s by 
its conjugate, the output should be the conjugate of the first output. This 
turns out not to be the case:

Evaluation:
s = -4.559190954155 -51.659216953928*1j
s = np.conj(s)
sc.hyp1f1(1/p, 1/p + 1, -s) 

Output:
(0.8337882727951572+0.1815268182862942j)

This is very far from 1. There seems to be a bug.


Mathematica:
s =  (-4.559190954155+51.659216953928I)
sconj=Conjugate[s]
Hypergeometric1F1[1/2,3/2,-s]
Hypergeometric1F1[1/2,3/2,-sconj]


Out[9]= 1.+1.99922*^-11 \[ImaginaryI]

Out[10]= 1.-1.99922*^-11 \[ImaginaryI]

--
messages: 362539
nosy: 12345NotFromHere54321
priority: normal
severity: normal
status: open
title: Bug in hypergeometric function
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue39427] python -X options are not documented in the CLI --help

2020-02-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39427] python -X options are not documented in the CLI --help

2020-02-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 333b9899fc7807575d1742b77b4633ac53bd528f by Pablo Galindo in 
branch '3.7':
[3.7] bpo-39427: Document -X opt options in the CLI --help and the man page 
(GH-18131) (#18134)
https://github.com/python/cpython/commit/333b9899fc7807575d1742b77b4633ac53bd528f


--

___
Python tracker 

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



[issue39427] python -X options are not documented in the CLI --help

2020-02-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 13951c7f25c628ea2dc0a869ebe18e7bf593fa6d by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39427: Document -X opt options in the CLI --help and the man page 
(GH-18131) (GH-18133)
https://github.com/python/cpython/commit/13951c7f25c628ea2dc0a869ebe18e7bf593fa6d


--

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2020-02-23 Thread Tal Einat


Tal Einat  added the comment:

Indeed.

--

___
Python tracker 

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



[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I found a stackoverflow question (and my then answer) about the same issue:
https://stackoverflow.com/questions/50108354/python-idle-running-code-differently-than-other-ides

Although the code posted does not run, it gives a very legitimate use case 
( is the signal) in which stream mixing is the lesser evil compared to 
the clearly wrong blocking of the output needed to decide when to give the 
signal. I now agree we should fix blocking now, if possible.

Tal, I posted my observations partly in the hope that you might be able to 
extend them.  So please take a look.

I am thinking about how to test a fix.  Test code needs to be able to 1. send 
code to be executed by run.py, 2. send a response to input() calls in the code, 
and 3. retrieve all output from the code.  New test machinery, needed not just 
for this issue, should be a separate issue.

A possibility including the minimum of transport machinery would be to replace 
the StdInputFile and StdOutputFile in run.py with test classes giving the 
needed test access.  Without knowing where the block is, it is unclear how much 
of the run machinery has to be included.

Another possibility, including all of the transport machinery except for the 
gui display, would be a test interpreter connected to an unaltered run process 
through a socket, as usual.  pyshell.PyShell (the shell window itself) 
initializespyshell.ModifiedInterpreter with itself.  A no-gui TestShell could 
do the same.  The TestShell would also need TestIn/OutputFile replacements.

--
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue39657] Bezout and Chinese Remainder Theorem in the Standard Library?

2020-02-23 Thread Tim Peters


Tim Peters  added the comment:

Ya, I'll close this, channeling that Raymond would also reject it for now 
(although he's certainly free to reopen it).

There's nothing wrong with adding such functions, but the `math` module is 
already straying too far from its original intent as a home for floating-point 
functions, nearly all of which had counterparts in `cmath`.  _If_ we had a, 
say, `imath` module, it would be a much easier sell.

These are just "too specialized".  I'd put them in the same class as, say, a 
new function to compute the Jacobi symbol.  Very handy but only for a 
vanishingly small percentage of Python users.

Probably _the_ most common use for xgcd (or egcd, either of which I suggest are 
better names than `bezout` - "extended gcd" is descriptive and commonly used) 
is for finding modular inverses, but `pow()` does that now directly.

For Chinese remainder, I'd suggest two changes:

1. Generalize to any number of bases.  The 2-base case is common in toy RSA 
implementations, but in that context a more efficient way is generally used, 
based on precomputing "helper constants" specific to the modulus's 2 factors.

2. Since the same bases are generally used over & over while only the 
remainders change, the function signature would be more usable if it accepted a 
sequence of remainders, and a sequence of corresponding bases, as two distinct 
arguments.

--
resolution:  -> rejected
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



[issue39732] plistlib should export UIDs in XML like Apple does

2020-02-23 Thread SilentGhost


Change by SilentGhost :


--
nosy: +serhiy.storchaka
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> Once PEP 585 is implemented these should be rolled back and replaced with 
> that, right?

I would say that ideally yes.

--

___
Python tracker 

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



[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Ethan Furman


Ethan Furman  added the comment:

Can this be fixed in the traceback module or is there C code behind it?

--

___
Python tracker 

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



[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Ethan Furman


Ethan Furman  added the comment:

I think the way forward is going to be a recursive walk back to the first 
exception, and if __suppress_context__ is true for any exception then only the 
previous exception is omitted.

For example, the above example had the following chain:

Exception__context____cause____suppress_context__
-----
TypeError: None   None  False
KeyError:  TypeError  None  False
KeyError:  KeyError   None  True

When walking the stack to decide which items get printed, the final KeyError is 
printed (obviously, as it's the last one), but because its __suppress_context__ 
is True then the immediately preceding exception, the first KeyError, is 
skipped; however, the first KeyError's __suppress_context__ is False, so we do 
print its __context__, which is the TypeError.  Giving us a traceback similar 
to:

-
Traceback (most recent call last):
TypeError: str expected, not type

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
KeyError: 'NEW_VARIABLE'
-

Which is entirely correct.

In cases where NewException has it's __cause__ set, we should print that as 
normal, then keep following the NewException.__context__ chain (with some kind 
of verbage or visual indicator between the __context__ and the __cause__).

--

___
Python tracker 

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



[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Once PEP 585 is implemented these should be rolled back and replaced with that, 
right?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue38597] C Extension import limit

2020-02-23 Thread Xinfa Zhu


Xinfa Zhu  added the comment:

I have a similar issue. Do we have an estimate how long it may take to fix this 
bug? Thanks. I can help but would need some mentoring.

--
nosy: +xinfazhu

___
Python tracker 

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



[issue35810] Object Initialization does not incref Heap-allocated Types

2020-02-23 Thread Ondrej Jakubcik


Ondrej Jakubcik  added the comment:

How does this change affect stable ABI? Is it necessary to change the logic in 
modules that use only the Py_LIMITED_API?

--
nosy: +Ondrej Jakubcik

___
Python tracker 

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



[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread Guido van Rossum

Guido van Rossum  added the comment:

It sounds like either an old implementation restriction or an old misguided 
attempt at keeping the IDLE console clean. I’m with Tal, let’s fix it and make 
it more like regular Python. Thanks John for taking the time to report this so 
clearly.

--

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Ethan Furman


Ethan Furman  added the comment:

Looking back at PEP3134 [1], the 

raise NewException from exc

is used as one of the examples.


[1] https://www.python.org/dev/peps/pep-3134/#id37

--

___
Python tracker 

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



[issue39712] Doc for `-X dev` option should mention PYTHONDEVMODE

2020-02-23 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

I would like to work on this issue.
Can you please suggest me specifics that I should be considering before I 
update the doc with the suggested inclusions.

--
nosy: +rahul-kumi

___
Python tracker 

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



[issue39723] io.open_code should accept PathLike objects

2020-02-23 Thread Steve Dower


Steve Dower  added the comment:

Dup of issue39691

As per PEP 578, open_code only accepts an absolute path as a str. The other 
issue will be used to update the docstring.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Allow passing Pathlike objects to io.open_code

___
Python tracker 

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



[issue39517] runpy calls open_code with Path object

2020-02-23 Thread Steve Dower


Steve Dower  added the comment:

open_code is correct according to PEP 578, so the fix here is for runpy to 
ensure the path is absolute and pass it through os.fsdecode() before calling 
io.open_code().

--
nosy: +steve.dower
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



[issue39691] Allow passing Pathlike objects to io.open_code

2020-02-23 Thread Steve Dower


Steve Dower  added the comment:

As per PEP 578 it only accepts absolute path str.

Requires a documentation update to clarify, as this is not the only report. And 
issue39517 should add a str() call and ensure that the path is absolute.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, steve.dower
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



[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2020-02-23 Thread Buzyboy


Change by Buzyboy :


Added file: https://bugs.python.org/file48904/Screenshot_20200223-214519.png

___
Python tracker 

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



[issue39729] stat.S_ISXXX can raise OverflowError for remote file modes

2020-02-23 Thread Arnon Yaari


Arnon Yaari  added the comment:

Maybe so, but IMHO it is a lesser concern - the operating systems that use 
"unsigned long" add bits on the right, and don't change the less significant 
bits that the S_ISXXX macros check (if I am not mistaken, those bits are POSIX 
standards).
This issue is a regression from Python 2.7, so I believe it should be addressed.

--

___
Python tracker 

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



[issue2771] Test issue

2020-02-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy:  -xtreak

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-02-23 Thread Vedran Čačić

Vedran Čačić  added the comment:

Oh yes, this has bugged me often. Please fix it somehow.

Yes, using "from None" is probably the wrong way to go. Often we need more info 
in tracebacks, not less. But the "During handling" message is very misleading. 
Same as Ethan, many times I interpreted it as "something went wrong in the 
handler" when in fact the handler was doing exactly what it was supposed to do.

except WhateverException as e:
raise CustomException from e

might be too much to write every time, and while I understand that we cannot 
simply redefine `raise` under `except` to do that implicitly, maybe there is 
some middle solution. On Python-ideas, recently I saw an idea

except WhateverException:
raise as CustomException

which I like a lot, but I don't know how hard it is to implement.

---

If everything above seems like too much, at least we should consider changing 
the wording of the message. If it said

+"In the handler of the above exception, another exception was raised:"
-"During handling of the above exception, another exception occurred:"

I'd be much happier. And it would more often suggest the right thing.

--
nosy: +veky

___
Python tracker 

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



[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-23 Thread Marco Sulla


Marco Sulla  added the comment:

I see that many breaking changes was done in recent releases. I get only the 
ones for `asyncio` in Python 3.8:

https://bugs.python.org/issue36921
https://bugs.python.org/issue36373
https://bugs.python.org/issue34790
https://bugs.python.org/issue32528
https://bugs.python.org/issue34687
https://bugs.python.org/issue32314

So I suppose the ship isn't sailed yet.


Passing a negative number to a function that should sleep the task for x 
seconds is a mistake. And mistakes should never pass silently.

Furthermore, coherence matters. It's really confusing that two functions in two 
builtin modules that are quite identical have a different behavior.

IMHO, deprecating and then removing support for negative argument in 
`asyncio.sleep()` is very much less breaking compared to issues #36921 and 
#36373 .

--
type:  -> behavior

___
Python tracker 

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



[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-02-23 Thread Ido Michael


Ido Michael  added the comment:

Added a new clean PR with the code changes, will let you know once the tests 
are fixed: GH-18627

--

___
Python tracker 

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



[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17991
pull_request: https://github.com/python/cpython/pull/18627

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-02-23 Thread Ido Michael


Ido Michael  added the comment:

Created a new clean PR GH-18625

--

___
Python tracker 

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



[issue39728] Instantiating enum with invalid value results in ValueError twice

2020-02-23 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
stage:  -> test needed

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17990
pull_request: https://github.com/python/cpython/pull/18625

___
Python tracker 

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



[issue35885] configparser: indentation

2020-02-23 Thread SilentGhost


SilentGhost  added the comment:

Your PRs are missing documentation and tests.

--

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-23 Thread Ido Michael


Ido Michael  added the comment:

Created new PR and removed the old one GH-18624

--

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17989
pull_request: https://github.com/python/cpython/pull/18624

___
Python tracker 

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



[issue35885] configparser: indentation

2020-02-23 Thread Ido Michael


Ido Michael  added the comment:

New PR: GH-18623

--

___
Python tracker 

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



[issue35885] configparser: indentation

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17988
pull_request: https://github.com/python/cpython/pull/18623

___
Python tracker 

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



[issue39732] plistlib should export UIDs in XML like Apple does

2020-02-23 Thread Mingye Wang


Change by Mingye Wang :


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

___
Python tracker 

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



[issue35885] configparser: indentation

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17986
pull_request: https://github.com/python/cpython/pull/18621

___
Python tracker 

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



[issue39732] plistlib should export UIDs in XML like Apple does

2020-02-23 Thread Mingye Wang


New submission from Mingye Wang :

Although there is no native UID type in Apple's XML format, Apple's 
NSKeyedArchiver still works with it because it converts the UID to a dict of 
{"CF$UID": int(some_uint64_val)}. Plistlib should do the same.

For a sample, see 
https://github.com/apple/swift-corelibs-foundation/blob/2a5bc4d8a0b073532e60410682f5eb8f00144870/Tests/Foundation/Resources/NSKeyedUnarchiver-ArrayTest.plist.

--
components: Library (Lib)
messages: 362513
nosy: Artoria2e5
priority: normal
severity: normal
status: open
title: plistlib should export UIDs in XML like Apple does
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, 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



[issue39704] Disable code coverage

2020-02-23 Thread Stefan Krah


Stefan Krah  added the comment:

For me even a mail with a single line would be too much. I can filter that in 
my mail client but not on GitHub.

Speaking about that, I also don't want to get mail from Bevedere stating that 
I, in fact, have signed a CLA any time I open a PR.

--

___
Python tracker 

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



[issue35885] configparser: indentation

2020-02-23 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +17985
pull_request: https://github.com/python/cpython/pull/18620

___
Python tracker 

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



[issue39731] ModuleNotFoundError: No module named '_ctypes'

2020-02-23 Thread Md. Al-Helal


New submission from Md. Al-Helal :

ERROR: Command errored out with exit status 1:
 command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'/tmp/pip-install-68ypuk30/django-tables2/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-68ypuk30/django-tables2/setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info 
--egg-base /tmp/pip-install-68ypuk30/django-tables2/pip-egg-info
 cwd: /tmp/pip-install-68ypuk30/django-tables2/
Complete output (11 lines):
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", 
line 20, in 
from setuptools.dist import Distribution, Feature
  File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 
35, in 
from setuptools import windows_support
  File 
"/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, 
in 
import ctypes
  File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in 
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

ERROR: Command errored out with exit status 1: python setup.py egg_info Check 
the logs for full command output.

--
components: ctypes
messages: 362511
nosy: alhelal
priority: normal
severity: normal
status: open
title: ModuleNotFoundError: No module named '_ctypes'
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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset c6ecd9c14081a787959e13df33e250102a658154 by Miss Islington (bot) 
in branch '3.8':
bpo-39576: Clarify the word size for the 32-bit build. (GH-18616) (#18618)
https://github.com/python/cpython/commit/c6ecd9c14081a787959e13df33e250102a658154


--

___
Python tracker 

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



[issue39710] "will be returned as unicode" reminiscent from Python 2

2020-02-23 Thread Andrei Daraschenka


Change by Andrei Daraschenka :


--
keywords: +patch
nosy: +dorosch
nosy_count: 2.0 -> 3.0
pull_requests: +17984
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18619

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 24c570bbb82a7cb70576c253a73390accfa7ed78 by Miss Islington (bot) 
in branch '3.7':
bpo-39576: Clarify the word size for the 32-bit build. (GH-18616) (#18617)
https://github.com/python/cpython/commit/24c570bbb82a7cb70576c253a73390accfa7ed78


--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17983
pull_request: https://github.com/python/cpython/pull/18618

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset b76518d43fb82ed9e5d27025d18c90a23d525c90 by Stefan Krah in branch 
'master':
bpo-39576: Clarify the word size for the 32-bit build. (#18616)
https://github.com/python/cpython/commit/b76518d43fb82ed9e5d27025d18c90a23d525c90


--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-02-23 Thread Stefan Krah


Change by Stefan Krah :


--
pull_requests: +17981
pull_request: https://github.com/python/cpython/pull/18616

___
Python tracker 

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



  1   2   >