[issue35928] socket makefile read-write discards received data

2020-10-03 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Mark, why did this get merged with is_integer() still in the numeric tower?  I 
thought we had agreed not to do that.

--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-03 Thread Debojyoti Chakraborty


Debojyoti Chakraborty  added the comment:

Is it open Then give the process to  reproduce the issue.

--
nosy: +sparkingdark

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Eryk Sun


Eryk Sun  added the comment:

> "C:\Users\chris\code\project\myenv\Scripts\python.exe"

Have you tried different case combinations for "Users" and "Scripts"?

* C:\users\chris\code\project\myenv\scripts\python.exe
* C:\users\chris\code\project\myenv\Scripts\python.exe
* C:\Users\chris\code\project\myenv\scripts\python.exe
* C:\Users\chris\code\project\myenv\Scripts\python.exe

> fsutil.exe file queryCaseSensitiveInfo C:\

Have you checked "C:\Users\chris\code\project\myenv"?

---

Off Topic

> Open Powershell (via both native Powershell app or the new 
> Windows Terminal) 

FYI, "native PowerShell app" is not the right way to think of this. Both cases 
run the same command-line interface (CLI) shell (i.e. pwsh.exe or 
powershell.exe), which is a console application that either inherits or 
allocates a console session (i.e. an instance of conhost.exe or 
openconsole.exe). When run from a graphical desktop application (e.g. 
explorer.exe), a console application usually has to allocate a new console 
session since there's none to inherit. Currently there's no way to set a 
default terminal for console applications, so a regular console session is 
allocated, which creates its own window. When run from a terminal in Windows 10 
(e.g. Windows Terminal), a console application inherits a headless console 
session (i.e. pseudoconsole mode), and the user interface is provided by the 
terminal.

--

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg377918

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Eryk Sun


Eryk Sun  added the comment:

> "C:\Users\chris\code\project\myenv\Scripts\pip.exe"

Have you tried different case combinations for "Users" and "Scripts"?

* C:\users\chris\code\project\myenv\scripts\pip.exe
* C:\users\chris\code\project\myenv\Scripts\pip.exe
* C:\Users\chris\code\project\myenv\scripts\pip.exe
* C:\Users\chris\code\project\myenv\Scripts\pip.exe

> fsutil.exe file queryCaseSensitiveInfo C:\

Have you checked "C:\Users\chris\code\project\myenv"?

---

Off Topic

> Open Powershell (via both native Powershell app or the new 
> Windows Terminal) 

FYI, "native PowerShell app" is not the right way to think of this. Both cases 
run the same command-line interface (CLI) shell (i.e. pwsh.exe or 
powershell.exe), which is a console application that either inherits or 
allocates a console session (i.e. an instance of conhost.exe or 
openconsole.exe). When run from a graphical desktop application (e.g. 
explorer.exe), a console application usually has to allocate a new console 
session since there's none to inherit. Currently there's no way to set a 
default terminal for console applications, so a regular console session is 
allocated, which creates its own window. When run from a terminal in Windows 10 
(e.g. Windows Terminal), a console application inherits a headless console 
session (i.e. pseudoconsole mode), and the user interface is provided by the 
terminal.

--
nosy: +eryksun

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Chris Tse


Chris Tse  added the comment:

UPDATE:

After some further investigation, it seems like even on cmd and seeing the 
(myenv) indicator, it actually seems to be falling back to system pip and 
installing packages globally. Running `.\myenv\Scripts\pip.exe` actually throws 
that same error. CMD just seems to fallback to system pip and silently fails 
the desired venv pip, unlike Powershell.

--

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Chris Tse


New submission from Chris Tse :

Following up on https://bugs.python.org/issue37369 as it was advised to open a 
new issue regarding case sensitivity.

I am on Windows 10 running Version 10.0.19041 Build 19041. I am experiencing 
the same problem in that issue when using venv on Powershell. 
The path to python.exe in the pip.exe generated by venv is all lowercase, which 
is the source of this error.
After activating the venv with Activate.ps1 and attempting to use pip, I get 
the following error, while activate.bat on cmd works fine:

Fatal error in launcher: Unable to create process using 
'"c:\users\chris\code\project\myenv\scripts\python.exe"  
"C:\Users\chris\code\project\myenv\Scripts\pip.exe" ': The system cannot find 
the file specified.


Full steps to reproduce:
  1. Install Python 3.8.6 from python.org (ticking add to PATH option in 
installer)
  2. Open Powershell (via both native Powershell app or the new Windows 
Terminal) and verify that `python` is bound to the correct Version
  3. Run `python -m venv myenv`
  4. Run `.\myenv\Scripts\Activate.ps1`
  5. Run `pip`

Expected behavior: Get the pip usage commands list

Actual behavior: Get the above Fatal error

Notes:
I did not explicitly set case sensitivity on my machine. All my drives are 
formatted as NTFS, but should not be case sensitive, which can be confirmed by 
fsutils:

> fsutil.exe file queryCaseSensitiveInfo C:\
Case sensitive attribute on directory C:\ is disabled.

Attempting to actually call that python.exe using the full lowercase path 
throws a similar error. 

Someone I know who has been helping with debugging this ran the 
Scripts\activate script successfully on the same version of Powershell as mine 
(5.1.19041.1) which should be meant for use on bash. I however was not able to 
do so.

--
components: Windows
messages: 377916
nosy: chris-tse, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Lowercase path to python.exe in pip.exe from venv is throwing 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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-03 Thread Chris Tse


Change by Chris Tse :


--
type:  -> behavior

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yes, we could override ABCMeta.__setattr__ to do that. Though it seems this
class is considered performance sensitive (else why have Modules/_abc.c) we
would probably have to write it in C.--
--Guido (mobile)

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> you're effectively proposing to compute (or update)
> __abstractmethods__ lazily.

Would it be possible to do the update whenever the class dictionary is 
modified, in PyType_Modified() perhaps (using logic similar to __mro__ 
updates__)?  

I not pushing for this; am just asking whether it is possible to make sure that 
__abstractmethods__ is always in sync with reality.

--

___
Python tracker 

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



[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan


ThePokestarFan  added the comment:

You're most likely right, so I'll close it. The lesson is most likely to not 
use weird arguments, but modules such as datetime warn against it, so I was 
surprised.

--

___
Python tracker 

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



[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan


Change by ThePokestarFan :


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



[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

It's not textwrap that's doing it, which is why the error is so unhelpful; the 
input is assumed to be a str, and the translate method is called on it with a 
dict argument, which is valid for str.translate, but not for bytes.translate.

You'll get other "unhelpful" error messages for other arguments (e.g. most 
other built-in types die because they lack an expandtabs method). Is it 
necessary to provide specific error messages when an API is given a type it 
never claimed to support? I could see issues with a "check for str" check if 
someone is implementing their own str-like type that matches the API but gets 
rejected for not being str.

--
nosy: +josh.r

___
Python tracker 

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



[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan


Change by ThePokestarFan :


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

___
Python tracker 

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



[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread Guido van Rossum

Guido van Rossum  added the comment:

Closing. Let’s not backport.

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



[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread ThePokestarFan


New submission from ThePokestarFan :

The wrap() method of the TextWrapper class (and the module-level wrap method) 
throws an unhelpful TypeError upon getting a bytes object.

--
components: Library (Lib)
files: traceback.txt
messages: 377910
nosy: ThePokestarFan
priority: normal
severity: normal
status: open
title: TextWrap's wrap method throws unhelpful error on bytes object
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49489/traceback.txt

___
Python tracker 

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



[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset e799aa8b92c195735f379940acd9925961ad04ec by Batuhan Taskaya in 
branch 'master':
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
https://github.com/python/cpython/commit/e799aa8b92c195735f379940acd9925961ad04ec


--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, you're effectively proposing to compute (or update) __abstractmethods__ 
lazily. There are a number of subtleties with that, e.g. __abstractmethods__ is 
currently a frozenset, and a base class's __abstractmethods__ is used when 
computing the __abstractmethods__ of new subclasses.

Moreover, the instantiation check is in object_new(), in typeobject.c.

The good news is that when you assign an empty iterable to 
cls.__abstractmethod__ the bit that object_new() checks is cleared, so other 
approaches are still open.

I think adding the API currently proposed is a reasonable compromise.

--

___
Python tracker 

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



[issue40348] Programming FAQ about "What is delegation?": Fix typos

2020-10-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Guido, can the method update be made automatic?  When instantiation fails, 
recheck to see the missing abstract methods had been defined?

>>> from abc import *
>>> class P(ABC):
@abstractmethod
def m(self):
pass

>>> class C(P):
pass

>>> C.m = lambda self: None
>>> C()
Traceback (most recent call last):
  File "", line 1, in 
C()
TypeError: Can't instantiate abstract class C with abstract method m

The latter message doesn't make sense that it should occur at all.

Roughly, the existing instantiation logic is:

 if cls.__abstractmethods__:
 raise TypeError(f"TypeError: Can't instantiate abstract class
 {cls.__name} with abstract method {methname}")

Could that be changed to something like this:

 if cls.__abstractmethods__:
 for methname is cls.__abstractmethods__.copy():
 if getattr(cls, methname).__isabstractmethod__:
 raise TypeError(f"TypeError: Can't instantiate abstract class
  {cls.__name} with abstract method {methname}")
 cls.__abstractmethods__.remove(methname)

I haven't thought this through.  Was just thinking that it would nice to have 
automatic updates rather than transferring the responsibility outside of the 
core ABC logic.

--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Leonard,

Any number which has only fixed precision will experience similar 
issues. It might affect different calculations.

In Python, float, complex and Decimal have fixed precision, so they can 
experience this issue.

But for simple calculations, Decimal may be better for you, as it uses 
base-10 floats, not base-2, so many numbers which are rounded off in 
binary floats are not rounded in Decimal:

py> from decimal import Decimal
py> 0. + 0.  # binary floats
0.4
py> Decimal('0.') + Decimal('0.')  # decimal floats
Decimal('0.')

But with Decimal, you have other numbers which are rounded off and so 
are not exact:

py> one_third = 1/Decimal(3)
py> 3*one_third  # should be exactly 1
Decimal('0.')

py> (1/Decimal(6)) * 3
Decimal('0.5001')

ints are always exact, but you can only do whole numbers with ints. 
Fractions are also exact:

py> from fractions import Fraction
py> Fraction(, 1) + Fraction(, 1)
Fraction(, 1)

Using Fraction is a good way to see what number a binary float really 
is:

py> Fraction(0.)
Fraction(4002799348806897, 36028797018963968)

--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

I don't think I remember what's so special about abstract_get_bases() to 
disable the recursion check. Maybe this macro is always just a 
micro-optimization? Then again it's hard to be sure, the behavior may depend on 
the platform.

Pulling in Antoine, who showed up in the  email 
https://mail.python.org/pipermail/python-dev/2008-August/082106.html is 
mentioned in a long comment in ceval.h about the recursion protection.

Possibly the Py_ALLOW_RECURSION macro is intended to ensure that some handler 
code for first-order recursion errors doesn't get interrupted by second-order 
recursion errors? There's a limit of 50 stack frames which feels a bit dodgy.

--
nosy: +pitrou

___
Python tracker 

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



[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-03 Thread Mikhail Golubev


Change by Mikhail Golubev :


--
keywords: +patch
nosy: +east825
nosy_count: 3.0 -> 4.0
pull_requests: +21535
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22532

___
Python tracker 

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

2020-10-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset fd22823991380de2a309221748fc41cf0ba6ed40 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-41840: Report module-level globals as both local and global in the 
symtable module (GH-22391). (GH-22529)
https://github.com/python/cpython/commit/fd22823991380de2a309221748fc41cf0ba6ed40


--

___
Python tracker 

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

2020-10-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7b7aa94e51a396365df41f86b7b64a3b74481a6c by Pablo Galindo in 
branch '3.9':
[3.9] bpo-41840: Report module-level globals as both local and global in the 
symtable module (GH-22391). (GH-22528)
https://github.com/python/cpython/commit/7b7aa94e51a396365df41f86b7b64a3b74481a6c


--

___
Python tracker 

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



[issue40348] Programming FAQ about "What is delegation?": Fix typos

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

This issue can be closed.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

2020-10-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21534
pull_request: https://github.com/python/cpython/pull/22529

___
Python tracker 

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

2020-10-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21533
pull_request: https://github.com/python/cpython/pull/22528

___
Python tracker 

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



[issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols

2020-10-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset fb0a4651f1be4ad936f8277478f73f262d8eeb72 by Pablo Galindo in 
branch 'master':
bpo-41840: Report module-level globals as both local and global in the symtable 
module (GH-22391)
https://github.com/python/cpython/commit/fb0a4651f1be4ad936f8277478f73f262d8eeb72


--

___
Python tracker 

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



[issue40202] Misleading grammatically of ValueError Message?

2020-10-03 Thread Ammar Askar


Change by Ammar Askar :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> More descriptive error message than "too many values to unpack"

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21532
pull_request: https://github.com/python/cpython/pull/22527

___
Python tracker 

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



[issue40202] Misleading grammatically of ValueError Message?

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

I think this can be closed as a duplicate of 39816.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sure go right ahead.

--

___
Python tracker 

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



[issue29986] Documentation recommends raising TypeError from tp_richcompare

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

Looks like this issue can be closed.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue33235] Better help text for dict.setdefault

2020-10-03 Thread Inada Naoki


Change by Inada Naoki :


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



[issue36568] Typo in socket.CAN_RAW_FD_FRAMES library documentation

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

This issue can be closed.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue33235] Better help text for dict.setdefault

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

The help message is now:

  Help on method_descriptor:
  setdefault(self, key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.

This issue should be closed as out of date.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-03 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Dong-hee Na  added the comment:

Thank you Victor!

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

___
Python tracker 

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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset d646e91f5c4f4b76f96494103d440ed0b6257425 by Dong-hee Na in branch 
'master':
bpo-41922: Use PEP 590 vectorcall to speed up reversed() (GH-22523)
https://github.com/python/cpython/commit/d646e91f5c4f4b76f96494103d440ed0b6257425


--

___
Python tracker 

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



[issue32192] Provide importlib.util.lazy_import helper function

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

This seems complete. Can is be closed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue18228] AIX locale parsing failure

2020-10-03 Thread STINNER Victor


STINNER Victor  added the comment:

Sorry, I forgot to close it 7 years ago. Done ;-)

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

___
Python tracker 

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



[issue41919] Modify test_codecs to use the new codecs.unregister() function

2020-10-03 Thread STINNER Victor


Change by STINNER Victor :


--
title: Move the codecs.register operation to testcases -> Modify test_codecs to 
use the new codecs.unregister() function

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-03 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue41916] cxx pthread check is not overrideable

2020-10-03 Thread Dustin Spicuzza


Change by Dustin Spicuzza :


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

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2020-10-03 Thread Emmanuel Arias

Emmanuel Arias  added the comment:

Hi, I've on my Debian (testing) the reported warning:

In function ‘assemble_lnotab’,
inlined from ‘assemble_emit’ at Python/compile.c:5706:25,
inlined from ‘assemble’ at Python/compile.c:6048:18:
Python/compile.c:5660:19: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5660 | *lnotab++ = k;
  |  


gcc --version  
gcc (Debian 10.2.0-5) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--
nosy: +eamanu

___
Python tracker 

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



[issue41921] REDoS in parseentities

2020-10-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-03 Thread Mikhail Golubev


New submission from Mikhail Golubev :

TypeAlias is already included in typing_extensions package, making it available 
for pre-3.10 versions of Python. I'd like port this implementation to the 
upstream version of typing.

--
components: Library (Lib)
messages: 377890
nosy: mikhail.golubev
priority: normal
severity: normal
status: open
title: Add PEP 613 typing.TypeAlias to the standard library
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


Change by Dong-hee Na :


--
assignee:  -> corona10

___
Python tracker 

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



[issue41922] Use PEP 590 vectorcall to speed up calls to reversed()

2020-10-03 Thread Dong-hee Na


New submission from Dong-hee Na :

reversed is also a very well-used type.
if shows 10+ percent performance improvement from baseline and this metric.
And this improvement looks acceptable from viewing builtin types which are 
applied PEP 590 (frozenset, list, set, dict)  

reversed creation + for loop
Mean +- std dev: [reversed_master] 157 ns +- 4 ns -> [reversed_opt] 139 ns +- 2 
ns: 1.13x faster (-11%)

reversed creation
Mean +- std dev: [reversed2_master] 118 ns +- 2 ns -> [reversed2_opt] 101 ns +- 
2 ns: 1.18x faster (-15%)

--
components: Interpreter Core
files: bench_reversed.py
messages: 377889
nosy: corona10, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Use PEP 590 vectorcall to speed up calls to reversed()
type: performance
versions: Python 3.10
Added file: https://bugs.python.org/file49488/bench_reversed.py

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Ah, okay. I wasn't familiar with @total_ordering so I assumed differently.  
Sorry for the continued misunderstanding.

Perhaps we should just leave it alone completely then, since ISTM that any 
change to its implementation may cause subtle bugs in currently working code.

The problem you see only occurs when there are abstract ordering methods 
present. The cure is simple, just implement all four comparison functions (and 
do away with @total_ordering). This is not a great burden. Instead we should 
probably add a line or two to the docs explaining how it interacts with ABCs 
defining abstract ordering methods.

@dataclass uses a different approach ("is it defined in the current class?"). 
That is perfectly ready for a call to abc.update_abstractmethods(). (I checked, 
and dataclasses already depends on abc, indirectly via functools, so the extra 
import is free.)

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Ben Avrahami


Ben Avrahami  added the comment:

> Maybe you misunderstand what I tried to say?

Possibly, right now, total_ordering avoids overriding any method that is 
declared, either in the class or its superclasses (except for object), 
regardless of whether or not it is abstract. For it to be ABC-aware, it would 
need the ability to override abstract methods defined in superclasses, so we 
need to check whether an exisitng method is abstract.

Additionally we want to not override abstract methods defined in the subject 
class, so we also need to check whether the method is defined in the class 
__dict__ (that's the extra logic I was referring to).

An argument could be made that total_ordering should override any method not 
defined in the subject class, abstract or no (implementing this logic would 
also speed up total_ordering, but that's beside the point).

Is this what you meant?

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum

Guido van Rossum  added the comment:

Why would that require more code? That’s already how it worked. Maybe you 
misunderstand what I tried to say?

--

___
Python tracker 

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



[issue41921] REDoS in parseentities

2020-10-03 Thread yeting li

New submission from yeting li :

Hi,

I find this regex '' 
may be stucked by input.
The vulnerable regex is located in
https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Tools/scripts/parseentities.py#L18

The ReDOS vulnerability of the regex is mainly due to the sub-pattern ' 
+((?:.|\n)+?) *'
and can be exploited with the following string
'

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> fixed

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Fix merged into master. Please use zipp 3.2.0 on Python 3.9 and earlier for the 
improved behavior or report back here if a backport is needed (and why).

--
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset ebbe8033b1c61854c4b623aaf9c3e170d179f875 by Jason R. Coombs in 
branch 'master':
bpo-40564: Avoid copying state from extant ZipFile. (GH-22371)
https://github.com/python/cpython/commit/ebbe8033b1c61854c4b623aaf9c3e170d179f875


--

___
Python tracker 

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



[issue41826] test_peg_generator compilation warnings

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



[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I dunno, but it's been doing this since 1992, so I think it would be fragile 
> to change. The best thing therefore is to make ast.literal_eval() match it 
> exactly.

+1 We had considerable finicky behaviour in the parser related to new lines and 
whitespace so I would recommend to strive for stability.

--

___
Python tracker 

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



[issue41826] test_peg_generator compilation warnings

2020-10-03 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset c111355480ff51b50a671679c5099f534cb01cae by Pablo Galindo in 
branch 'master':
bpo-41826: Fix compiler warnings in test_peg_generator (GH-22455)
https://github.com/python/cpython/commit/c111355480ff51b50a671679c5099f534cb01cae


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2020-10-03 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy:  -adelfino

___
Python tracker 

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



[issue6721] Locks in the standard library should be sanitized on fork

2020-10-03 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy:  -adelfino

___
Python tracker 

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



[issue33802] Regression in logging configuration

2020-10-03 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy:  -adelfino

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-03 Thread Irit Katriel


Irit Katriel  added the comment:

You didn't specify the logger in the assertLogs() call. 

The documentation says that "The default is the root logger, which will catch 
all messages."

https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertLogs

This is behaving as expected.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-03 Thread Pradyun Gedam


Pradyun Gedam  added the comment:

+1 for bumping to 20.2.3, in case an upstream voice is helpful. :)

On Fri, Oct 2, 2020 at 8:12 PM Pablo Galindo Salgado 
wrote:

>
> Pablo Galindo Salgado  added the comment:
>
> I think that the backport to 3.8 may have some unintended consequences in
> the last patch release as venv created with 3.8 now exhibit the pip
> regression (https://github.com/pypa/pip/issues/8695.).
>
> Steve, would you be ok if we bump all branches (master, 3.9 and 3.8) to
> 20.2.3?
>
> --
> nosy: +pablogsal
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Leonard Schwennesen


Leonard Schwennesen  added the comment:

But this "bug" only affects floating numbers?

--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Leonard Schwennesen


Leonard Schwennesen  added the comment:

Ok thank you for these resources. I didn't know that before. (;

--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Some further resources:

https://stackoverflow.com/questions/8215437/floating-point-accuracy-in-python

https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate

https://stackoverflow.com/questions/1089018/why-cant-decimal-numbers-be-represented-exactly-in-binary?noredirect=1=1

https://randomascii.wordpress.com/category/floating-point/page/1/


If you google a bit you will find many other places that discuss this.

--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Please forgive me if my answer is a little bit brusque, but we get essentially 
this same bug report regularly, only the numbers are different.

This is not a bug in Python, it is an unavoidable consequence of how floating 
point arithmetic works in every single programming language that does floating 
point arithmetic.

There's a FAQ about it:

https://docs.python.org/3/faq/design.html#why-am-i-getting-strange-results-with-simple-arithmetic-operations

it's discussed in the tutorial:

https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues

there's probably a million websites, blog posts, Stackoverflow questions etc 
about it, and computer scientists write papers about it:

https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Leonard Schwennesen


Leonard Schwennesen  added the comment:

Same problem with 0.-0. python returns 0.22218 and not 
0.

--

___
Python tracker 

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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:

Thanks for this, Ram!

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset 8ca08310a882b7db6469fe732465610b92f4665e by Miss Skeleton (bot) 
in branch '3.9':
[3.9] bpo-41867: List options for timespec in docstrings of isoformat methods 
(GH-22418)
https://github.com/python/cpython/commit/8ca08310a882b7db6469fe732465610b92f4665e


--

___
Python tracker 

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



[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Leonard Schwennesen


New submission from Leonard Schwennesen :

If I add 0. + 0. in the python cli I get the value 0.4 
and not 0.. Also the other way around.
But if I enter for example 0.2+0.1 I get 0.3 so that's right.
Here are a few examples I tested that working properly:

>>> 0.22+0.11
0.33
>>> 0.222+0.111
0.333
>>> 0.2+0.1
0.3
>>> 0.+0.
1.111
>>> 0.+0.
0.
>>> 0.+0.
0.
>>> 0.+0.
0.
>>> 0.+0.
0.

Python 3.8.5
[GCC 10.2.0] on linux

I also tested that in a newly setup VM, same issue

--
messages: 377871
nosy: ungedummt
priority: normal
severity: normal
status: open
title: Weird add operation of "0. + 0."
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread miss-islington


miss-islington  added the comment:


New changeset 9aa34f1bbbe1ca6376539f9ba436ff75d2141888 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41867: List options for timespec in docstrings of isoformat methods 
(GH-22418)
https://github.com/python/cpython/commit/9aa34f1bbbe1ca6376539f9ba436ff75d2141888


--

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:

Thanks, Ram!

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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21528
pull_request: https://github.com/python/cpython/pull/22519

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset ef7b937b8fe94f4c59dfcbe7567c3ca76097a41d by Miss Skeleton (bot) 
in branch '3.9':
[3.9] bpo-40833: Clarify Path.rename doc-string regarding relative paths 
(GH-20554)
https://github.com/python/cpython/commit/ef7b937b8fe94f4c59dfcbe7567c3ca76097a41d


--

___
Python tracker 

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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +21527
pull_request: https://github.com/python/cpython/pull/22518

___
Python tracker 

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



[issue41867] Include options for timespec in docstrings of isoformat

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset 52301312bb9de2299b0c42468fd1936d869e651c by Ram Rachum in branch 
'master':
bpo-41867: List options for timespec in docstrings of isoformat methods 
(GH-22418)
https://github.com/python/cpython/commit/52301312bb9de2299b0c42468fd1936d869e651c


--
nosy: +taleinat

___
Python tracker 

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



[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-10-03 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 4.0 -> 5.0
pull_requests: +21526
pull_request: https://github.com/python/cpython/pull/22517

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21525
pull_request: https://github.com/python/cpython/pull/22516

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread miss-islington


miss-islington  added the comment:


New changeset 4b982e0dd7354c9103a0cae8e6e78b5e57794e77 by Miss Skeleton (bot) 
in branch '3.8':
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)
https://github.com/python/cpython/commit/4b982e0dd7354c9103a0cae8e6e78b5e57794e77


--

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2020-10-03 Thread David Beazley


David Beazley  added the comment:

About nine years ago, I stood in front of a room of Python developers, 
including many core developers, and gave a talk about the problem described in 
this issue.  It included some live demos and discussion of a possible fix. 

https://www.youtube.com/watch?v=fwzPF2JLoeU

Based on subsequent interest, I think it's safe to say that this issue will 
never be fixed.  Probably best to close this issue.

--

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21524
pull_request: https://github.com/python/cpython/pull/22515

___
Python tracker 

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



[issue40833] Clarify docstring of Path.rename

2020-10-03 Thread Tal Einat


Tal Einat  added the comment:


New changeset f97e42ef4d97dee64f45ed65170a6e77c8e46fdf by Ram Rachum in branch 
'master':
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)
https://github.com/python/cpython/commit/f97e42ef4d97dee64f45ed65170a6e77c8e46fdf


--
nosy: +taleinat

___
Python tracker 

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



[issue41919] Move the codecs.register operation to testcases

2020-10-03 Thread hai shi


Change by hai shi :


--
title: Move the codecs' register operation to testcases -> Move the 
codecs.register operation to testcases

___
Python tracker 

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



[issue41919] Move the codecs' register operation to testcases

2020-10-03 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue41919] Move the codecs' register operation to testcases

2020-10-03 Thread hai shi


New submission from hai shi :

After PR22360 merged, we can move the codecs' register operation to testcases.

--
components: Tests
messages: 377863
nosy: shihai1991, vstinner
priority: normal
severity: normal
status: open
title: Move the codecs' register operation to testcases
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41918] exec fails to take locals into account when running list comprehensions

2020-10-03 Thread Quentin Peter


New submission from Quentin Peter :

The exec function fails to take locals into account when executing a list 
comprehension:
```
Python 3.7.7 (default, Mar 10 2020, 15:43:33) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exec(compile('[my_var for i in range(1)]\n', '', 'single'), 
>>> {**globals(), "my_var": 0}, None)
[0]
>>> exec(compile('[my_var for i in range(1)]\n', '', 'single'), 
>>> globals(), {"my_var": 0})
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
  File "", line 1, in 
NameError: name 'my_var' is not defined
>>> 
```
This is the cause of https://bugs.python.org/issue21161

--
messages: 377862
nosy: qpeter
priority: normal
severity: normal
status: open
title: exec fails to take locals into account when running list comprehensions
type: enhancement
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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Ben Avrahami


Ben Avrahami  added the comment:

> I would prefer the isinstance(cls, ABCMeta) check to be inside that helper

I had a little debate about this in my mind, I'll change it.

> it's totally clear to me what @total_ordering should do -- it should define 
> __le__, __gt__ and __ge__ in terms of __lt__, and leave __lt__ alone, for 
> some subclass to implement.

Implementing this logic would require more than two lines. I will add it to the 
PR.

--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Interesting, when lookup any attribute you will get a RecursionError, but this 
is one of only two places where the recursion check is disabled (the other one 
is in interning strings).

You get a crash also when call isinstance(1, instance) or issubclass(int, 
instance). This is the same bug.

The implementation of issubclass() calls PyObject_IsSubclass() which calls 
object_issubclass() which calls recursive_issubclass() which calls 
check_class() which calls abstract_get_bases() which looks up attribute 
"__bases__" which leads to infinite recursion in __getattr__().

#125278 0x5576116d in abstract_get_bases (cls=cls@entry=0x7fffeabcee10) 
at Objects/abstract.c:2340
#125279 0x557611f1 in check_class (cls=cls@entry=0x7fffeabcee10, 
error=error@entry=0x5585c828 "issubclass() arg 1 must be a class") at 
Objects/abstract.c:2396
#125280 0x557619bf in recursive_issubclass 
(derived=derived@entry=0x7fffeabcee10, cls=cls@entry=0x55946220 
) at Objects/abstract.c:2524
#125281 0x55761daf in object_issubclass (tstate=, 
derived=0x7fffeabcee10, cls=0x55946220 ) at 
Objects/abstract.c:2550
#125282 0x55765ea1 in PyObject_IsSubclass (derived=, 
cls=) at Objects/abstract.c:2600
#125283 0x557b78f3 in builtin_issubclass_impl 
(module=module@entry=0x7fffeae21d70, cls=, 
class_or_tuple=) at Python/bltinmodule.c:2511
#125284 0x557b794d in builtin_issubclass (module=0x7fffeae21d70, 
args=0x7fffead0e388, nargs=) at Python/clinic/bltinmodule.c.h:828

The problem is that in abstract_get_bases() the recursion check is disabled by 
using macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (added in 
5b222135f8d2492713994f2cb003980e87ce6a72). I do not know why it was necessary. 
Currently tests are passed if enable recursion check, and this fixes this issue.

It is worth to mention that attribute __bases__ is looked up to support 
non-types in issubclass() and isinstance(). Originally it was added in 
issue464992 to support Zope extension ExtensionClass. I tested that the current 
code of ExtensionClass does not need it. So we could simplify the code and 
avoid recursion by just using tp_bases. But this needs wider discussion.

--
nosy: +gvanrossum, loewis, nascheme, serhiy.storchaka
versions: +Python 3.10, 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



[issue41917] Python 3.9rc2 fails to install matplotlib

2020-10-03 Thread ullix


New submission from ullix :

Installing matplotlib via: python3 -m pip install -U matplotlib
fails because kiwisolver cannot be installed. Among a lot of error output is: 
WARNING: The wheel package is not available.

Not having matplotlib is a MAJOR hurdle for many!


Sstem: Ubuntu 16.04 with Python 3.9rc2 installed from deadsnakes repository 
(http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/)

--
components: Installation
messages: 377859
nosy: ullix
priority: normal
severity: normal
status: open
title: Python 3.9rc2 fails to install matplotlib
type: resource usage
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



[issue41916] cxx pthread check is not overrideable

2020-10-03 Thread Dustin Spicuzza


New submission from Dustin Spicuzza :

I'm cross-compiling python to ARM, following instructions from the crossenv 
project @ 
https://crossenv.readthedocs.io/en/latest/quickstart.html#build-or-obtain-host-python

I was getting pthread related errors when using cross-built extension modules. 
I realized the issue was that distutils wasn't passing -pthread to gcc.

On my native python (Fedora 32 Python 3.8):

>>> import pprint, distutils.sysconfig
>>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 
>>> 'CXX', 'LDSHARED')})
{'CC': 'gcc -pthread',
 'CXX': 'g++ -pthread',
 'LDSHARED': 'gcc -pthread -shared -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now  '
 '-g  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now  -g'}

In my cross-compiled python environment:

>>> import pprint, distutils.sysconfig
>>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 
>>> 'CXX', 'LDSHARED')})
{'CC': 'arm-frc2020-linux-gnueabi-gcc',
 'CXX': 'arm-frc2020-linux-gnueabi-c++',
 'LDSHARED': 'arm-frc2020-linux-gnueabi-gcc -shared'}

As you can see, no -pthread flag. I went digging in the configure script and 
found this comment in configure.ac:2110:

# Some compilers won't report that they do not support -pthread,
# so we need to run a program to see whether it really made the
# function available.

... well, that doesn't work when cross-compiling. I looked at some other 
variables set to override things for cross compiling, and tried adding 
"ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes" to my 
cross-compile ./configure, and it's closer:

>>> import pprint, distutils.sysconfig
>>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 
>>> 'CXX', 'LDSHARED')})
{'CC': 'arm-frc2020-linux-gnueabi-gcc -pthread',
 'CXX': 'arm-frc2020-linux-gnueabi-c++',
 'LDSHARED': 'arm-frc2020-linux-gnueabi-gcc -pthread -shared'}

Closer, but not there yet! It appears that the $ac_cv_cxx_thread is not 
externally settable (unlike ac_cv_pthread), which I guess is because it's not 
wrapped in a AC_CACHE_VAL macro?

It seems that the right fix would be for someone to use AC_CACHE_VAL to allow 
$ac_cv_cxx_thread to be set externally? I'm happy to cargo cult some code from 
other parts of configure.ac and make a PR for it, but it's not immediately 
clear (a) what bad side effects this could cause and (b) what the best 
mechanism to use to regenerate configure et al is?

--
components: Cross-Build
messages: 377858
nosy: Alex.Willmer, virtuald
priority: normal
severity: normal
status: open
title: cxx pthread check is not overrideable
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



  1   2   >