[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Inada Naoki


Inada Naoki  added the comment:

> (1) add a .dedent() method to str (and bytes?) - behaviors to consider 
> mirroring are textwrap.dedent() and inspect.cleandoc().  Given their utility 
> and similarities, it makes sense to offer both behaviors; behavior could be 
> selected by a kwarg passed to the method.

I don't think we need two algorithms here. I'm +1 to add str.dedent() which 
mirroring only inspect.cleandoc().

--

___
Python tracker 

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



[issue42427] Use the errno attribute of OSError instead of args[0]

2020-11-21 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-21 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
pull_requests: +22349
pull_request: https://github.com/python/cpython/pull/23293

___
Python tracker 

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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-11-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset 0aab3522b259c40abf1f070c71aa7b914c1239b5 by Miss Islington (bot) 
in branch '3.9':
bpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301) 
(GH-23455)
https://github.com/python/cpython/commit/0aab3522b259c40abf1f070c71aa7b914c1239b5


--

___
Python tracker 

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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 4f8712696924586cc12ca295899944c11b46 by Miss Islington (bot) 
in branch '3.9':
bpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)
https://github.com/python/cpython/commit/4f8712696924586cc12ca295899944c11b46


--

___
Python tracker 

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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 2528a7db1c8b7ebc3d442ff0984248ed3e325bf6 by Miss Islington (bot) 
in branch '3.8':
bpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)
https://github.com/python/cpython/commit/2528a7db1c8b7ebc3d442ff0984248ed3e325bf6


--

___
Python tracker 

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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22348
pull_request: https://github.com/python/cpython/pull/23457

___
Python tracker 

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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset bd8c22e1fa8f8f6e31ee083a8b9321a2c324f02f by Ram Rachum in branch 
'master':
bpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)
https://github.com/python/cpython/commit/bd8c22e1fa8f8f6e31ee083a8b9321a2c324f02f


--
nosy: +terry.reedy

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset dd20643b144d1c81989d235c3ec51f18fda618c2 by Miss Islington (bot) 
in branch '3.9':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/dd20643b144d1c81989d235c3ec51f18fda618c2


--

___
Python tracker 

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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

I guess this explains it:

>>> for p in os.getenv("PATH").split(os.pathsep): print(p)
... 
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\Git\cmd
C:\Program Files\nodejs\
C:\ProgramData\chocolatey\bin

C:\Program Files\Microsoft VS Code Insiders\bin
C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\Scripts\
C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\
C:\Users\gvanrossum\AppData\Local\Microsoft\WindowsApps

C:\Users\gvanrossum\AppData\Local\Programs\Microsoft VS Code Insiders\bin
C:\Users\gvanrossum\AppData\Roaming\npm
>>>

--
resolution:  -> not a bug
stage: needs patch -> 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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Oops, I think I understand why.  The py launcher actually does a search for an 
interpreter named "python" and that turns out to be python 3.10.

Now my question becomes why py chooses a different default than that.

I don't have a py.ini file in either of the two places mentioned by "py -h", 
nor do I have a PY_PYTHON env var.  Maybe it's because I installed 3.9 last?

--

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 28b40d7a349787817fe5f6ebfa753c29b96c8832 by Miss Islington (bot) 
in branch '3.8':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/28b40d7a349787817fe5f6ebfa753c29b96c8832


--

___
Python tracker 

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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


New submission from Guido van Rossum :

I have 3.9 and 3.10 installed on my Windows box.

The py launcher runs Python 3.10 when invoked on a script starting with a 
shebang line

#!/usr/bin/env python

even though the default without a script is 3.9, as shown here:

PS C:\Users\gvanrossum\peps> py -0
Installed Pythons found by C:\WINDOWS\py.exe Launcher for Windows
 -3.9-64 *
 -3.8-64
 -3.7-64
 -3.6-64
 -3.5-64
 -3.4-64
 -3.10-64

PS C:\Users\gvanrossum\peps> py   
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

PS C:\Users\gvanrossum\peps> 

This caused some confusion since I was running a script that imported a package 
that I had installed in the default interpreter but not in 3.10.

I am not using a virtual environment (yet :-).

Without the shebang line the 3.9 interpreter is used.

(Full disclosure: the script was pep2html.py, and the package was docutils.)

--
assignee: steve.dower
components: Windows
messages: 381590
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Windows py launcher default for shebang line is surprising
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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-11-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-11-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset 404a719b5127602c1a948f8e189ab61cd3f147d8 by Ronald Oussoren in 
branch 'master':
bpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301)
https://github.com/python/cpython/commit/404a719b5127602c1a948f8e189ab61cd3f147d8


--

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22345
pull_request: https://github.com/python/cpython/pull/23454

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 453bc1da2023d6cbe362637a2e0b06d0521f013c by Serhiy Storchaka in 
branch 'master':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/453bc1da2023d6cbe362637a2e0b06d0521f013c


--

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

A few things:

- There is no %-formatting for Decimal types. They're being converted to float 
first. That's why it appears that %-formatting with 'g' works the same for 
decimal and float: you're really just calling the float version.

- The difference in 'g' formatting between float and Decimal is a known 
difference. This issue pops up every now and again, but right now I can't find 
where (or if) it's actually documented.

Mark: can you point to it? I don't think 
https://docs.python.org/3/library/string.html#format-specification-mini-language
 mentions it where it talks about Decimals. And I don't see any documentation 
for Decimal.__format__.

--
nosy: +eric.smith, mark.dickinson

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The confusion about error.args is this:

BaseException.args is documented as "The tuple of arguments given to the 
exception constructor."
https://docs.python.org/3/library/exceptions.html#base-classes
args[0] is usually and I would expect it to always be the formatted message, 
which is to say, the string normally printed at the end of tracebacks.
The signature of re.error is documented as "(msg, pattern=None, pos=None)"
https://docs.python.org/3/library/re.html#re.error
and this is what inspect.signature says (as reported in IDLE calltip).
So one might expect .args to be a 3-tuple.

With the value fetching fixed, the displayed message could be changed to 
something else (in another issue), such as
  Error: bad escape \z in pattern r'a\z' at offset 1

Thanks for the patch.

--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset 442746af649cc2c20d690acfabf44ab0e06c36b4 by Ronald Oussoren in 
branch 'master':
bpo-41100: Stripping '-arch arm64' didn't work after all (GH-23280)
https://github.com/python/cpython/commit/442746af649cc2c20d690acfabf44ab0e06c36b4


--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I expect several phases here:

(1) add a .dedent() method to str (and bytes?) - behaviors to consider 
mirroring are textwrap.dedent() and inspect.cleandoc().  Given their utility 
and similarities, it makes sense to offer both behaviors; behavior could be 
selected by a kwarg passed to the method.

https://docs.python.org/3/library/textwrap.html#textwrap.dedent

https://docs.python.org/3/library/inspect.html#inspect.cleandoc

(2a) Ponder the d" prefix - but in general I expect sentiment to be against yet 
another letter prefix.  They aren't pretty.  This would need a PEP.  Someone 
would need to champion it.

(2b) Ponder making cleandoc dedenting automatic for docstrings.  This would be 
enabled on a per-file basis via a `from __future__ import docstring_dedent` or 
similar as Serhiy suggested.  No prefix letter required.  Several releases 
later we could consider making it the default.  This will also need needs a PEP.

(3) Optimizations when .dedent() is called on a constant?  Nice to have, But I 
suggest we land (1) first as its own base implementation PR. Then consider the 
follow-ons in parallel.

I believe the current patch contains (1)+(3) right now.  If so we should 
simplify it to (1) and make (3) am immediate followup as saving the runtime 
cost and data space is worthwhile.

Ultimate end state: probably 1+2b+3, but even 1+3 or 1+2b is a nice win.

--

___
Python tracker 

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



[issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 690a5fa3ddc675a434730b057ddb5c33f44fd0b7 by Ronald Oussoren in 
branch 'master':
bpo-42361: Use Tcl/Tk 8.6.10 when building the installer on recent macOS 
(GH-23293)
https://github.com/python/cpython/commit/690a5fa3ddc675a434730b057ddb5c33f44fd0b7


--
nosy: +miss-islington

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 6e665424d6e7abf6d6de010609a398a7407df83c by Miss Islington (bot) 
in branch '3.8':
bpo-38443: Check that the specified universal architectures work (GH-22910)
https://github.com/python/cpython/commit/6e665424d6e7abf6d6de010609a398a7407df83c


--

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 748d38bf529d71d87cc7ef6d63e9df7d7d771ac9 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-38443: Check that the specified universal architectures work 
(GH-22910) (GH-23451)
https://github.com/python/cpython/commit/748d38bf529d71d87cc7ef6d63e9df7d7d771ac9


--

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22343
pull_request: https://github.com/python/cpython/pull/23452

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22342
pull_request: https://github.com/python/cpython/pull/23451

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 0f20bd9042c9b7fce20c3b9511cd0820b30094c3 by Ronald Oussoren in 
branch 'master':
bpo-38443: Check that the specified universal architectures work (GH-22910)
https://github.com/python/cpython/commit/0f20bd9042c9b7fce20c3b9511cd0820b30094c3


--
nosy: +miss-islington

___
Python tracker 

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



[issue33167] RFC Documentation Updates to urllib.parse.rst

2020-11-21 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue33167] RFC Documentation Updates to urllib.parse.rst

2020-11-21 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

+1 for the closed

--
nosy: +eamanu

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-21 Thread Chris Warrick


New submission from Chris Warrick :

When formatting decimal.Decimal using old-style formatting (%g), the output is 
as short as possible, as expected. When using new-style formatting (str.format 
or f-strings), the output uses the input precision. Floats behave correctly 
with new-style formatting. 

Python 3.9.0 (default, Oct 27 2020, 14:15:17)
[Clang 12.0.0 (clang-1200.0.32.21)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal
>>> d1 = decimal.Decimal("1.000")
>>> d2 = decimal.Decimal("1.500")
>>> f1 = 1.0
>>> f2 = 1.5
>>> f"{d1:g} {f1:g}"
'1.000 1'
>>> f"{d2:g} {f2:g}"
'1.500 1.5'
>>> "%g %g" % (d1, f1)
'1 1'
>>> "%g %g" % (d2, f2)
'1.5 1.5'

--
components: Library (Lib)
messages: 381578
nosy: Kwpolska
priority: normal
severity: normal
status: open
title: Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue14527] How to link with a non-system libffi?

2020-11-21 Thread Raphael Krut-Landau


Raphael Krut-Landau  added the comment:

To install Python 3.9 locally, with ctypes, this worked for me.

# I created a temp directory
cd ~
mkdir tmp
cd tmp

# I downloaded and installed the latest libffi source from Github
wget "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz;
tar xvf libffi-3.3.tar.gz
cd libffi-3.3
./configure --prefix=$HOME && make && make install

# I now had some libffi files in ~/lib/pkgconfig and ~/lib64.
# I added these to LD_LIBRARY_PATH, along with ~/lib.

export 
LD_LIBRARY_PATH="$HOME/lib/pkgconfig:$HOME/lib:$HOME/lib64:$LD_LIBRARY_PATH"

# I downloaded and installed the latest Python from python.org
cd ~/tmp
wget "https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz;
cd ~/tmp/Python-3.9.0
./configure --prefix=$HOME --with-system-ffi LDFLAGS="-L $HOME/lib64/" 
CPPFLAGS="-I $HOME/tmp/libffi-3.3/include/"
make
make test
make install

# I was then able to run an installer that had shown me the error, "No module 
named '_ctypes'
pip3 install mycli

I hope this can be useful to you.

Raffi

--
nosy: +raphael.kl
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue8733] list type and UserList do not call super in __init__ and therefore, they cannot be parents in a multiple inheritence scheme

2020-11-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

There will always be classes that don't call super() init, sometimes for 
efficiency and sometimes to preserve their internal invariants.

Also, __init__() isn't the only method affected.  For a perfectly cooperative 
class, all of the methods would need to call super().

See how to handle this in the "How to Incorporate a Non-cooperative Class" 
section of: https://rhettinger.wordpress.com/2011/05/26/super-considered-super/

--
nosy: +rhettinger
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



[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-21 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue42428] Inconsistent squaring behavior

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Operator precedence and unary operator binding is explained in the language 
reference documentation, 
https://docs.python.org/3/reference/expressions.html#the-power-operator

--
nosy: +christian.heimes
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



[issue42428] Inconsistent squaring behavior

2020-11-21 Thread Mark Dickinson


Mark Dickinson  added the comment:

-3 ** 2 is parsed by Python as -(3 **2), not as (-3) ** 2.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue42428] Inconsistent squaring behavior

2020-11-21 Thread JohnSmith11132


New submission from JohnSmith11132 :

Basically when squaring as a negative number, if it's a variable it acts like 
-3*-3 otherwise it acts like 3*-3.
For example:
>>> x = -3
>>> x ** 2
9
>>> -3 ** 2
-9

pow(-3, 2) seems to act like -3 * -3?
** 3 seems fine and both seems to act like -3*-3*-3.
>>> x = -3
>>> x ** 3
27
>>> -3 ** 3
-27

Will it be safe to use the ** 2 in Python? If I use a variable will it return 
the same value?

I only found this for the bug:
https://devforum.roblox.com/t/inconsistent-squaring-behavior/820028/

It looks like the exact same issue I'm having, but I still don't get it and 
it's not for Python.

--
components: Interpreter Core
messages: 381573
nosy: JohnSmith11132
priority: normal
severity: normal
status: open
title: Inconsistent squaring behavior
type: behavior
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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ea97ebab3578a6e0bb505da96819ac44d422a6cb by Christian Heimes in 
branch 'master':
bpo-1635741: Port select module to multiphase init (GH-23409)
https://github.com/python/cpython/commit/ea97ebab3578a6e0bb505da96819ac44d422a6cb


--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 035deee265c7fb227ddc87222fa48761231d8bd7 by Christian Heimes in 
branch 'master':
bpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406)
https://github.com/python/cpython/commit/035deee265c7fb227ddc87222fa48761231d8bd7


--

___
Python tracker 

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



[issue8733] list type and UserList do not call super in __init__ and therefore, they cannot be parents in a multiple inheritence scheme

2020-11-21 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue42427] Use the errno attribute of OSError instead of args[0]

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42427] Use the errno attribute of OSError instead of args[0]

2020-11-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Some code in the stdlib still uses e.args[0] to access errno of OSError instead 
of e.errno. The latter is more readable, and also it always success (although 
can return None), but args can be an empty tuple.

--
components: Library (Lib)
messages: 381570
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use the errno attribute of OSError instead of args[0]
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



[issue42425] Possible leak in initialization of errmap for OSError

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ed1007c0d74e658d1e6c9b51b12ce7501eb8cbf9 by Serhiy Storchaka in 
branch 'master':
bpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446)
https://github.com/python/cpython/commit/ed1007c0d74e658d1e6c9b51b12ce7501eb8cbf9


--

___
Python tracker 

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



[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-21 Thread Sofian Brabez


Change by Sofian Brabez :


--
pull_requests: +22340
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23448

___
Python tracker 

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



[issue7460] extended slicing not sufficiently covered in docs

2020-11-21 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.1, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a good idea. Writing IsADirectoryError(errno.EISDIR, 
os.strerror(errno.EISDIR), filename) is boring.

--

___
Python tracker 

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



[issue42424] add constructor that support multiple context managers to contextlib.ExitStack and contextlib.AsyncExitStack

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, this design has an incorrigible flaw.

--
nosy: +serhiy.storchaka
resolution:  -> rejected
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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type:  -> behavior

___
Python tracker 

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



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

In Lib/idlelib/searchengine.py there is a code which decomposes re.error and 
reports error message, pattern, and position of error.

The problem is that that code does not match the structure of re.error. It 
takes args[0] as error message, and args[1] (if specified) as position in the 
pattern. But actually re.error always sets args[0] to formatted error message, 
and args has only one item. So some code in IDLE is dead.

Currently reported:

   Error: bad escape \z at position 1
   Pattern: a\z

Expected:

   Error: bad escape \z
   Pattern: a\z
   Offset: 1

--
assignee: terry.reedy
components: IDLE
messages: 381566
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Fix reporting RE error in searchengine
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



[issue42425] Possible leak in initialization of errmap for OSError

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42425] Possible leak in initialization of errmap for OSError

2020-11-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There is a potential leak when adding item to errmap (errno to OSError subclass 
mapping) fails.

--
components: Interpreter Core
messages: 381565
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Possible leak in initialization of errmap for OSError
type: resource usage
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



[issue42419] Typo in "what's new in Python 3.9"

2020-11-21 Thread Irit Katriel


Change by Irit Katriel :


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



[issue42424] add constructor that support multiple context managers to contextlib.ExitStack and contextlib.AsyncExitStack

2020-11-21 Thread Irit Katriel


Irit Katriel  added the comment:

There used to be a contextlib.nested function which did this, and it was 
deprecated because there were problems with it. See here: 
https://docs.python.org/2/library/contextlib.html#contextlib.nested

--
nosy: +iritkatriel

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-21 Thread Yaroslav Pankovych


Yaroslav Pankovych  added the comment:

That makes sense, but should we have this behaviour only for negative indices? 

We'll end up with something lie:

path.parents[len(path.parents) - 1] != path.parents[-1]

I think that is should be consistent regardless of negative/positive indices.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

There is another option: The subclasses of OSError could set a correct errno 
automatically.

--

___
Python tracker 

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



[issue42424] add constructor that support multiple context managers to contextlib.ExitStack and contextlib.AsyncExitStack

2020-11-21 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +22337
pull_request: https://github.com/python/cpython/pull/23445

___
Python tracker 

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



[issue42424] add constructor that support multiple context managers to contextlib.ExitStack and contextlib.AsyncExitStack

2020-11-21 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +22336
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23444

___
Python tracker 

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



[issue42424] add constructor that support multiple context managers to contextlib.ExitStack and contextlib.AsyncExitStack

2020-11-21 Thread Vito De Tullio


New submission from Vito De Tullio :

The enhancement is to add a __init__ method to both contextlib.ExitStack and 
contextlib.AsyncExitStack, so that you can pass (async)context managers 
directly in the costructor.

additionally, a new "context_managers" / "async_context_managers" field is 
added to retrieve the values passed


This will ease the usage with lists of context managers

instead of:

with ExitStack() as stack:
files = [stack.enter_context(open(fname)) for fname in filenames]

you can have

with ExitStack(*(open(fname) for fname in filenames)) as stack:
files = stack.context_managers

In my use case I have a fixed + variable number of (async)context managers, and 
I don't even need the "as" part

   ...
   in_send, in_receive = trio.open_memory_channel(0)
   out_sends, out_receives = [], []
   for _ in range(n): # n is dynamic
   out_send, out_receive = trio.open_memory_channel(0)
   out_sends.append(out_send)
   out_receives.append(out_receive)
   
   # syntax error
   async with in_send, in_receive, *out_sends, *out_receives:
   ...

   # with current AsyncExitStack
   async with AsyncExitStack() as stack:
   await stack.async_context_managers(in_send)
   await stack.async_context_managers(in_receive)
   for out_send in out_sends:
   await stack.async_context_managers(out_send)
   for out_receive in out_receives:
   await stack.async_context_managers(out_receives)
   ...

   # with the change
   async with AsyncExitStack(in_send, in_receive, *out_sends, *out_receives):
   ...

--
components: Library (Lib)
messages: 381561
nosy: ZeD
priority: normal
severity: normal
status: open
title: add constructor that support multiple context managers to 
contextlib.ExitStack and contextlib.AsyncExitStack
type: enhancement

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thus using bare TimeoutError in asyncio is safe, isn't it?
This is good news!

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I fixed many instantiations of OSError subclasses, but many are still left in 
Python code.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I know that I just create OSError() with errno set to None.

My question is: has the standard library such code examples already?
In other words, how many third-party code will be broken by catching OSError 
with errno=None?

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

They have an errno attribute, it's just to None by default. You have to call 
OSError with multiple arguments to set errno to a non-None value.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, I think this is a problem. It is expected that an instance of OSError has 
valid errno. OSError is a merge of several old exception types, some of them 
did have errno, and others did not.

Maybe add BaseTimeoutError and make TimeoutError a subclass of BaseTimeoutError 
and OSError?

There as also several CancelledError, and exceptions with similar names and 
purpose, like asyncio.IncompleteReadError and http.client.IncompleteRead.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Perhaps it is a good compromise.
OSError-derived class without errno looks getter to me that different 
incompatible TimeoutError classes.

How many exceptions inherited from OSError have no errno set? Do we have a 
precedent in stdlib at all already?

--

___
Python tracker 

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



[issue42327] Add PyModule_Add()

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22335
pull_request: https://github.com/python/cpython/pull/23443

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

PyErr_SetString(PyErr_TimeoutError, "msg") and raise TimeoutError("msg") do not 
set any additional exception attributes. errno, strerror, filename, and 
filename2 are None:

>>> try:
... raise TimeoutError("msg")
... except Exception as e:
... err = e
... 
>>> err
TimeoutError('msg')
>>> (err.errno, err.filename, err.filename2, err.strerror)
(None, None, None, None)

Is that a problem?

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

In futures and asyncio TimeoutError has no errno.

I'm not sure should we care but I consider it as a show stopper.

On another hand, two distinct timeout classes confuse people. I had many 
conversions about this during the aiohttp support.  asyncio can raise both 
TimeoutError and asyncio.TimeoutError which is... unexpected at least.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Serhiy!

Andrew, Antoine, Yury, do you want to replace the custom Timeout exceptions in 
asyncio, multiprocessing, and concurrent with global TimeoutError, too?

--
nosy: +asvetlov, bquinlan, davin, pitrou, yselivanov
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue42232] mmap module add Darwin specific madvise options

2020-11-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Thanks for the PR.

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



[issue42232] mmap module add Darwin specific madvise options

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 0e62efc51e31c741b61604787aeab4936e6e50e4 by David CARLIER in 
branch 'master':
bpo-42232: mmap module add Darwin specific madvise options. (GH-23076)
https://github.com/python/cpython/commit/0e62efc51e31c741b61604787aeab4936e6e50e4


--
nosy: +miss-islington

___
Python tracker 

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



[issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec

2020-11-21 Thread Christian Heimes


Christian Heimes  added the comment:

Excellent idea

--

___
Python tracker 

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



[issue17695] _sysconfigdata broken with universal builds on OSX

2020-11-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This only affects universal builds where the CPU architectures are sufficiently 
different. In particular binaries with both 32-bit and 64-bit alternatives.

The current installers and the upcoming Universal2 installers only contain 
64-bit code. That's likely to be the case going forward.


I'm closing this as "won't fix", this is a low priority issue that I'll never 
work on.

--
resolution:  -> wont fix
stage: needs patch -> 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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset d153eb8a1e47123ecdb3fb47995a2c39ce7713ea by Miss Islington (bot) 
in branch '3.9':
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() 
(GH-23410)
https://github.com/python/cpython/commit/d153eb8a1e47123ecdb3fb47995a2c39ce7713ea


--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

A string prefix would be a large language change that would need to go through 
Python-Ideas, a PEP and Steering Council approval. Let's not go there :-)

A new string method is a comparatively small new feature that probably won't 
need a PEP or Steering Council approval.

A compile-time optimization is an implementation feature, not a language 
feature. Whether devs want to follow up with more string optimizations like 
'spam'.upper() is entirely up to them.

Backwards compatibility implies that textwrap.dedent is not going away any time 
soon, but it should probably become a thin wrapper around str.dedent at some 
point.

--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I read to the end of the patch and found astfold_dedent.

A small point in favor of textwrap.dedent is immediately announcing that the 
string will be dedented.

--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am opposed to more prefix characters.

Are any string literal optimizations done now at compile time, like for 
'abc'.upper?  It does not exactly make sense to me to do just .dedent.  But 
without the optimization, adding str.dedent without removing textwrap.dedent 
does not add a whole lot.  (But it does add something, so I am mildly positive 
on the idea.)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 648a32b12ec676036ae4115747d458fb6f379d74 by Miss Islington (bot) 
in branch '3.8':
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() 
(GH-23410)
https://github.com/python/cpython/commit/648a32b12ec676036ae4115747d458fb6f379d74


--

___
Python tracker 

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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22334
pull_request: https://github.com/python/cpython/pull/23442

___
Python tracker 

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



[issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec

2020-11-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

It is common that class have a single base class. PyType_FromModuleAndSpec() is 
only called with NULL as bases (that means inheriting object) in the stdlib, 
and PyType_FromSpecWithBases() is called with a 1-tuple as bases all three 
times (not counting tests).

Since it is a common case, PyErr_NewException() accept both a tuple and a 
single class as the base argument. I propose to accept a single class also in 
PyType_FromSpecWithBases() and PyType_FromModuleAndSpec().

--
components: C API
messages: 381542
nosy: christian.heimes, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Support passing single class to PyType_FromSpecWithBases and 
PyType_FromModuleAndSpec
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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +22332
pull_request: https://github.com/python/cpython/pull/23440

___
Python tracker 

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



[issue42412] Fix bases issues in PyType_FromModuleAndSpec()

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1db76394ea79030aa4ed5349c950f6c6da51450f by Serhiy Storchaka in 
branch 'master':
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() 
(GH-23410)
https://github.com/python/cpython/commit/1db76394ea79030aa4ed5349c950f6c6da51450f


--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

(assigning to me as I want to help remi.lapeyre's .dedent() method PR move 
forward)

--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are also other distinct exceptions:

   multiprocessing.TimeoutError
   concurrent.futures.TimeoutError
   asyncio.TimeoutError

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 713b4bbd97392acc492a4fefb2d07ae61fb7b75d by Miss Islington (bot) 
in branch '3.9':
bpo-40550: Fix time-of-check/time-of-action issue in 
subprocess.Popen.send_signal. (GH-20010)
https://github.com/python/cpython/commit/713b4bbd97392acc492a4fefb2d07ae61fb7b75d


--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-11-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks for the patch!

PRs are in or on their way in for 3.10 and 3.9.

The 3.8 auto-backport failed, if anyone wants it on a future 3.8.x please 
follow up with a manual cherry pick to make a PR for the 3.8 branch.

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed
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



[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-21 Thread Sofian Brabez


Sofian Brabez  added the comment:

Thanks Dennis for pointing me the crashers, I was not aware of them.

I have added a new crash test to cover multiple crashes in different 
interpreter versions. Current bogus does not crash where it could be possible 
to crash in older and newer interpreter versions.

Do you think it's worth to add it? I joined the patch against master and if yes 
I could submit a new PR.

--
keywords: +patch
Added file: 
https://bugs.python.org/file49612/add-new-crasher-to-cover-multiple-versions.diff

___
Python tracker 

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



[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-11-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-11-21 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 01a202ab6b0ded546e47073db6498262086c52e9 by Filipe LaĆ­ns in 
branch 'master':
bpo-40550: Fix time-of-check/time-of-action issue in 
subprocess.Popen.send_signal. (GH-20010)
https://github.com/python/cpython/commit/01a202ab6b0ded546e47073db6498262086c52e9


--

___
Python tracker 

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



[issue41655] New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by

2020-11-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> wont fix
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



[issue41655] New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by

2020-11-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I expect your overall logic is sound in the PR. But this is a public API 
change, and while we've typically exempted lib2to3 from needing to concern 
itself about deprecations and API changes by leaving it undocumented and 
explicitly promising not to care about this module in that sense... Enough 
things use it today that we should probably not do that anymore.

Especially given that we're considering it a deprecated library these days. It 
isn't likely to stand up well to 3.10+'s new grammar.

Various projects have forked lib2to3 into their own maintained thing either 
directly on PyPI or as an internalized third_party fork within their own 
project (as I believe Black has done?). It is probably best to do that for 
changes of this nature rather than push for them to be included in a future 
stdlib lib2to3.

See https://bugs.python.org/issue40360 for context.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset c1bbca5b004b3f74d240ef8a76ff445cc1a27efb by Miss Islington (bot) 
in branch '3.9':
bpo-40791: Make compare_digest more constant-time. (GH-20444)
https://github.com/python/cpython/commit/c1bbca5b004b3f74d240ef8a76ff445cc1a27efb


--

___
Python tracker 

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



  1   2   >