[issue34915] LWPCookieJar.save() creates *.lwp file in 644 mode

2021-03-13 Thread Martin Panter


Martin Panter  added the comment:

I don't have a strong opinion, but it does seem a sensible change that matches 
the high-level nature of the "cookiejar" module, with low risk of users relying 
on the current file permissions. On the other hand, the "curl" command seems to 
use the default mode when creating a cookies file (in Netscape a.k.a. Mozilla 
format):

$ curl --cookie-jar cookies https://www.google.com/
[. . .]
$ ls -l cookies
-rw-r--r-- 1 vadmium vadmium 418 Mar 14 17:12 cookies

The MozillaCookieJar class also seems to use the default file mode. I suppose 
it should be changed as well as the LWP class.

--
components:  -SSL

___
Python tracker 

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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Ned Deily

Ned Deily  added the comment:

You’d have to check with the Pygame project. But a quick look at the PyPI entry 
for Pygame seems to indicate that they provide pip-installable binaries for all 
current versions of Python 3.

https://pypi.org/project/pygame/

--

___
Python tracker 

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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e6bf1e1001a6844a36f2f90f58ab12b9e09e3887 by Pablo Galindo in 
branch '3.9':
[3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module 
(GH-24836) (GH-24855)
https://github.com/python/cpython/commit/e6bf1e1001a6844a36f2f90f58ab12b9e09e3887


--

___
Python tracker 

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



[issue43334] venv does not install libpython

2021-03-13 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue43490] IDLE freezes at random

2021-03-13 Thread Ned Deily


Ned Deily  added the comment:

What version of Python are you running? And from where did you get it?  Based 
on your other recent issue, it sounds like you may be trying to use an old 
version of Python 2.7, which is now retired.  If possible, try using a current 
supported version, like Python 3.9.2.

--
nosy: +ned.deily

___
Python tracker 

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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

The main reason I am trying to install this is because I want to use pygame. Is 
pygame compatible with version 2.7.28?

--

___
Python tracker 

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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Ned Deily


Ned Deily  added the comment:

er, make that early 2020 :)

--

___
Python tracker 

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



[issue43477] from x import * behavior inconsistent between module types.

2021-03-13 Thread Thomas


Thomas  added the comment:

Ahh, I always forget about blame.

Though the form was different, the initial commit of `importlib` (authored by 
Brett, so the nosy list seems fine for the moment) behaved the same way, and 
had an additional comment noting that the section in question was included to 
maintain backwards compatibility. I checked with Python 2.x and can confirm 
that this was how Python 2.x behaved as well (so I assume that's what the 
comment was for.)

I've tested simply commenting out that section (as, at a glance, I don't 
believe it will have any effect on explicit imports), and for the few scripts I 
tested with the backtraces were actually pretty clear: a lot of places in the 
standard library are accidentally relying on this quirk. collections doesn't 
import abc, importlib doesn't import machinery, concurrent doesn't import 
futures, etc, etc.

The easy, temporary fix would be to just add the necessary imports, then worry 
about `importlib`'s innards when the time comes to cross that bridge. That 
said, I know of only a few of the modules which will need imports added (the 
ones above, essentially), so I can't really say what the full scale of the work 
will be.

--

___
Python tracker 

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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Ned Deily


Ned Deily  added the comment:

Python 2.7.x reached end-of-life in early 2000 so it is no longer supported in 
any way.  That said, since you say the file extension is .mpkg and based on the 
behavior you describe, it sounds like you are trying to install a very old 
version of Python 2.7.  The last release of 2.7 was 2.7.18. The installer for 
macOS there should install and run on macOS 10.13.6.

https://www.python.org/downloads/release/python-2718/

--
nosy: +ned.deily
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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 1e7a47ab86d5d6a5103e67ba71389f6daa18ea2d by Pablo Galindo in 
branch '3.8':
[3.8] bpo-43439: Wrapt the tuple in the audit events for the gc module 
(GH-24836) (GH24854)
https://github.com/python/cpython/commit/1e7a47ab86d5d6a5103e67ba71389f6daa18ea2d


--

___
Python tracker 

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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23615
pull_request: https://github.com/python/cpython/pull/24855

___
Python tracker 

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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23614
pull_request: https://github.com/python/cpython/pull/24854

___
Python tracker 

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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

First, I am not asking for guesses. I am getting the installers from the 
www.python.org website, and I am running them with the MacOS installer app. The 
format is .mpkg

--
Added file: https://bugs.python.org/file49874/Screen Shot 2021-03-13 at 8.45.18 
PM.png

___
Python tracker 

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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a by Pablo Galindo in 
branch 'master':
bpo-43410: Fix crash in the parser when producing syntax errors when reading 
from stdin (GH-24763)
https://github.com/python/cpython/commit/cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a


--

___
Python tracker 

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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Please don't ask us to guess what you are doing.

Where are you getting "both installer downloads" from? What installers are they?

How are you running the installers?

What is the actual error message please, not "something to that effect". If 
necessary, take a screen shot, although copying and pasting the text might be 
better.

Also, Python 2.7 is no longer supported -- we are unlikely to fix any problems 
even if you report them in sufficient detail. Can you not use version 3.9 
instead?

You might consider asking for help on a community forum such as the Python-List 
mailing list, the Python Discuss, or Reddit's r/python. But they will ask you 
to provide better information too, and will likely also tell you to install a 
newer version.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue43245] Add keyword argument support to ChainMap.new_child()

2021-03-13 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



[issue43245] Add keyword argument support to ChainMap.new_child()

2021-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 9923df96413a0b480a34ec1d537b66ca0eeb0fdc by Kamil Turek in branch 
'master':
bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788)
https://github.com/python/cpython/commit/9923df96413a0b480a34ec1d537b66ca0eeb0fdc


--

___
Python tracker 

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



[issue43439] [security] Add audit events on GC functions giving access to all Python objects

2021-03-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8 by Pablo Galindo in 
branch 'master':
bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836)
https://github.com/python/cpython/commit/9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8


--

___
Python tracker 

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



[issue43477] from x import * behavior inconsistent between module types.

2021-03-13 Thread Eric V. Smith


Eric V. Smith  added the comment:

"git blame" will help you identify the authors. It looks there are 5 people 
involved: Brett, Antoine, Nick, Eric Snow, and Dino.

--

___
Python tracker 

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



[issue43490] IDLE freezes at random

2021-03-13 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

My processor is Intel core 2 duo.

--

___
Python tracker 

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



[issue43490] IDLE freezes at random

2021-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Are on an Intel processor or Apple Silicon?

--
nosy: +rhettinger

___
Python tracker 

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



[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 45d9c8cda3db7da9fe209bd215ec9a120265ee65 by Miss Islington (bot) 
in branch '3.9':
bpo-43427:  Separte the method overview from the static method specifics. 
(GH-24787) (GH-24849)
https://github.com/python/cpython/commit/45d9c8cda3db7da9fe209bd215ec9a120265ee65


--

___
Python tracker 

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



[issue35278] [security] directory traversal in tempfile prefix

2021-03-13 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.9

___
Python tracker 

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



[issue41200] Add pickle.loads fuzz test

2021-03-13 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue43477] from x import * behavior inconsistent between module types.

2021-03-13 Thread Thomas


Thomas  added the comment:

I've spent a bit of time building (and rebuilding) Python 3.9 with a modified 
`Lib/importlib/_bootstrap.py`/regenerated `importlib.h` to give me some extra 
logging, and believe the answer I was looking for is `_find_and_load_unlocked`. 
`_find_and_load_unlocked` appears to load the module in question, and always 
attach it to the parent regardless of the contents of `fromlist` 
(`_find_and_load_unlocked` isn't even aware of `fromlist`.) The only real 
condition seems to be "is there a parent/are we in a package?". 
`Lib/importlib/_bootstrap.py` is pretty sparsely documented so it's not 
immediately obvious whether or not some other piece of `importlib` depends on 
this behavior. If the author is known, then they may be able to give some 
insight into why the decision was made, and what the best solution would be?

--

___
Python tracker 

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



[issue42988] [security] CVE-2021-3426: Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-03-13 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FWIW, I don't think we should even have a server feature in pydoc...

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



[issue43490] IDLE freezes at random

2021-03-13 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

Only when using the turtle module does it happen.

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



[issue43490] IDLE freezes at random

2021-03-13 Thread Adrian LeDeaux


New submission from Adrian LeDeaux :

My IDLE shell keeps freezing when using the turtle module. I am using MacOS 
High Sierra 13.10.6. It says it is fine, but I can't get the window open. I 
have to restart the shell entirely. I can't type or do anything. I have to do 
the [command]+[Q] shortcut and then open the app again. Any ideas?

--
messages: 388643
nosy: aledeaux
priority: normal
severity: normal
status: open
title: IDLE freezes at random
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



[issue43489] Can't install, nothing to install

2021-03-13 Thread Adrian LeDeaux


New submission from Adrian LeDeaux :

Python 2.7 won't install. I get the error "there is nothing to install" or 
something to that effect. I am using MacOS High Sierra 10.13.6. I tried both 
installer downloads. None worked. And I got the same error every time. Anyone 
have any ideas on what is going on?

--
messages: 388642
nosy: aledeaux
priority: normal
severity: normal
status: open
title: Can't install, nothing to install

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-13 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> the ABC wouldn't have any abstract methods,

I was wrong about this since the @abstractmethod decorator adds 'f' to the 
__abstractmethods__ set of the ABC, but the rest of my comment stands.

--

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-13 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I don't think changing @wraps is what you want. Even if you manually set 
`wrapper.__isabstractmethod__ = False`, you won't reach `print('f is 
called!')`, since f() is overridden by the child. And if you do that, the ABC 
wouldn't have any abstract methods, since the name A.f points to the function 
defined at `def wrapper()`.

If I understand correctly, you want to modify the behavior of a method while 
also having it be abstract. These two goals are sort of in tension with one 
another, since defining f as abstract means your implementation won't be used, 
yet you want to specify part of the implementation. One solution would be to 
modify the subclass's methods to do what you want when the subclass is created.


from abc import ABC, abstractmethod
from functools import wraps

class A(ABC):
@abstractmethod
def f(self):
pass

def __init_subclass__(cls, **class_kwargs):
old_f = cls.f
@wraps(old_f)
def wrapper(*args, **kwargs):
print("f is called!")
old_f(*args, **kwargs)
cls.f = wrapper
super().__init_subclass__()

class B(A):
def f(self):
print('f!')

class C(A):
pass

B().f()
# f is called!
# f!

C()
# TypeError: Can't instantiate abstract class C with abstract method f

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue24260] TabError behavior doesn't match documentation

2021-03-13 Thread Facundo Batista


Facundo Batista  added the comment:

Found this after seeing (once again) somebody asking for help in Python 
Argentina after having a file mixing tabs and spaces.

This tends to catch new people.

I'm +1 to just raise an error if the file mixes tabs and spaces for 
indentation. I've never seen a real usage case where it was not an accident, 
even if the mix was in different blocks, so it actually worked "fine" (and even 
in those cases, then the user copies lines around, and the program starts to 
behave weirdly).

--
nosy: +facundobatista

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-13 Thread Larry Trammell


Larry Trammell  added the comment:

Not a bug, strictly speaking... more like user abuse.

The parsers (expat as well as SAX) must be able to return content text as a 
sequence of pieces when necessary. For example, as a text sequence interrupted 
by grouping or styling tags (like  or ).  Or, extensive text blocks 
might need to be subdivided for efficient processing.  Users would expect 
hazards like these and be wary.  But how many users would suspect that a quoted 
string of length 8 characters would be returned in multiple pieces?  Or that an 
entity notation would be split down the middle?  Virtually all existing 
tutorial examples showing content extraction are WRONG -- because the ONLY 
content that can be trusted must be filtered through some kind of aggregator 
object.  How many users will know this instinctively?  

It would be very useful for the parser systems to provide some kind of support 
for text aggregation function.  A guarantee that "small contiguous" text items 
will not be chopped might also be helpful.

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



[issue43199] FAQ about goto lacks answer

2021-03-13 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
nosy: +terry.reedy
nosy_count: 2.0 -> 3.0
pull_requests: +23613
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24852

___
Python tracker 

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



[issue27749] multiprocessing Manager error: send() called for a closed connection

2021-03-13 Thread Eryk Sun


Change by Eryk Sun :


--
title: multprocessing errors on Windows: WriteFile() argument 1 must be int, 
not None; OSError: handle is closed -> multiprocessing Manager error:  send() 
called for a closed connection
type: crash -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5, Python 3.7

___
Python tracker 

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



[issue43322] Inconsistent '#include' notation in extensions tutorial doc

2021-03-13 Thread Matthew Hughes


Change by Matthew Hughes :


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

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-03-13 Thread Anthony Sottile


Change by Anthony Sottile :


--
nosy: +Anthony Sottile
nosy_count: 7.0 -> 8.0
pull_requests: +23611
pull_request: https://github.com/python/cpython/pull/24850

___
Python tracker 

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



[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a by Raymond Hettinger in 
branch 'master':
bpo-43427:  Separte the method overview from the static method specifics. 
(GH-24787)
https://github.com/python/cpython/commit/f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a


--

___
Python tracker 

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



[issue43488] Added new methods to vector.py

2021-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think this should be added.  The whole point of vector.py was to be a 
simple educational demo of a Python class its special methods work.  It was not 
intended to grow more features or ever be used in production.  

Also, vector-to-vector multiplication, division, and floordiv would only make 
sense for an elementwise array class.  This class focuses on standard vector 
operations.  If anything, what is missing is a method for a dot product.

Thank you for submitting a PR, but it is going to be declined from the reasons 
listed about.

--
assignee:  -> rhettinger
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue43223] [security] http.server: Open Redirection if the URL path starts with //

2021-03-13 Thread Hamza Avvan


Change by Hamza Avvan :


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

___
Python tracker 

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



[issue33159] Implement PEP 473

2021-03-13 Thread skreft


Change by skreft :


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



[issue33159] Implement PEP 473

2021-03-13 Thread Éric Araujo

Éric Araujo  added the comment:

The PEP has been rejected, so there is no big plan to add structured data to 
all exceptions, but you can open specific tickets and/or python-ideas 
discussions to add attributes to specific exceptions.

So I think this ticket should be closed, and a new one created to add 
NameError.name.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2021-03-13 Thread Eryk Sun


Eryk Sun  added the comment:

This issue is similar to bpo-25117 in terms of the installer failing to run 
Python for post-installation tasks. The complication in this case is that a 
subsequent repair doesn't install pip.

--
versions: +Python 3.10, Python 3.8, 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



[issue43488] Added new methods to vector.py

2021-03-13 Thread Ehsonjon Gadoev


Change by Ehsonjon Gadoev :


--
title: Added new methods to vectors.py -> Added new methods to vector.py

___
Python tracker 

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



[issue29124] Freeze fails to compile on windows

2021-03-13 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-13 Thread Kamil Turek


Change by Kamil Turek :


--
nosy: +kamilturek

___
Python tracker 

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



[issue15373] copy.copy() does not properly copy os.environment

2021-03-13 Thread Kamil Turek


Change by Kamil Turek :


--
nosy: +kamilturek

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-13 Thread Kamil Turek


Change by Kamil Turek :


--
nosy: +kamilturek

___
Python tracker 

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



[issue28344] Python 3.5.2 installer hangs when run in session 0

2021-03-13 Thread Eryk Sun


Eryk Sun  added the comment:

I tested installing 3.10 in session 0 for the current user, as a user with the 
batch logon right. The installation succeeded. If you're running as SYSTEM, 
then installing for the current user doesn't see reasonable to me. I won't test 
that case. 

I tested installing 3.10 in session 0 as SYSTEM, with the option 
InstallAllUsers=1. The installation succeeded. There's a caveat (bpo-25166) 
that the installer registers the uninstall record only for the current user. 
The SYSTEM account uses the default profile, so the uninstall record is stored 
under "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Uninstall". In 
this case, to uninstall you have to run the installer as SYSTEM with the 
/uninstall option.

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

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2021-03-13 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem)

2021-03-13 Thread mattip


mattip  added the comment:

@crazycasta could you turn your patches into a PR? I am not sure how to get 
some eyes on this, but certainly the test is useful to prove the problem still 
exits

--

___
Python tracker 

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



[issue43488] Added new methods to vectors.py

2021-03-13 Thread Ehsonjon Gadoev


New submission from Ehsonjon Gadoev :

What's new in Vector (vector.py)

1) Added multiplay (Vector and Vector)
2) Added division (Vector and Vector) and (Vector and scalar)
3) Added FloorDiv (Vector and Vector) and (Vector and scalar)
4) Added __mod__ (Vector and Vector) and (Vector and scalar)

This new methods is very useful!
[It is beta version! By the way we will fix bugs]

--
components: Demos and Tools
hgrepos: 402
messages: 388631
nosy: Ehsonjon Gadoev
priority: normal
pull_requests: 23608
severity: normal
status: open
title: Added new methods to vectors.py
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



[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2021-03-13 Thread Eryk Sun


Eryk Sun  added the comment:

Maybe it's worth adding a recommendation in the docs to reboot and try to 
repair an installation that fails in the final stage due to ucrt not being 
fully installed yet, i.e. missing api-ms-win-crt-*.dll. Or maybe this case can 
be detected and display a message box to that end.

--
type:  -> behavior
versions: +Python 3.10, Python 3.8, 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



[issue43428] Sync importlib_metadata enhancements through 3.7.

2021-03-13 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset f917efccf8d5aa2b8315d2a832a520339e668187 by Jason R. Coombs in 
branch 'master':
bpo-43428: Sync with importlib_metadata 3.7. (GH-24782)
https://github.com/python/cpython/commit/f917efccf8d5aa2b8315d2a832a520339e668187


--

___
Python tracker 

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



[issue43267] [sqlite3] Redundant type checks in pysqlite_statement_bind_parameter()

2021-03-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I would not add such "optimization", but it is up to Berker to keep or remove 
it. Please create a PR for review.

--

___
Python tracker 

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



[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-13 Thread Bart Broere


Change by Bart Broere :


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

___
Python tracker 

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



[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-13 Thread Bart Broere


New submission from Bart Broere :

While porting a (Django) code base recently, using 2to3, I missed the 
conversion from __unicode__ to __str__. I have created my own 2to3 fixer, which 
might be useful for other people.

If it's not useful enough to be included in lib2to3, or has side effects that I 
did not foresee, please let me know :-)

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 388627
nosy: bartbroere
priority: normal
severity: normal
status: open
title: Rename __unicode__ methods to __str__ in 2to3 conversion
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



[issue26362] Approved API for creating a temporary file path

2021-03-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This function would increase security risks. Even if it will be documented as 
"This function is only purposed to generate file paths which looks similar to 
paths of temporary files generated by other functions in this module, but 
should not be used for any access to filesystem", it would be used to generate 
file paths and opening files with these paths by users which do not read 
documentation and do not know the right way (because they do not read 
documentation).

It has flaws which require to deprecate it from start.

If you want to shoot in your foot, just use private generator function 
tempfile._get_candidate_names(). But it should not be encouraged.

I am for closing this issue by rejecting the proposition.

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2021-03-13 Thread Guido van Rossum

Guido van Rossum  added the comment:

Serhiy, that’s brilliant! Let’s do it.

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue43444] [sqlite3] Move MODULE_NAME def from setup.py to module.h

2021-03-13 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 2256a2876b5214a5a7492bf78bd86cf8beb690bf by Erlend Egeberg 
Aasland in branch 'master':
bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801)
https://github.com/python/cpython/commit/2256a2876b5214a5a7492bf78bd86cf8beb690bf


--

___
Python tracker 

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



[issue43444] [sqlite3] Move MODULE_NAME def from setup.py to module.h

2021-03-13 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you!

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



[issue43411] wm_manage fails with ttk.Frame

2021-03-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Minor correction: Tk does not generate names as digit sequences. Its syntax 
requires a name to be always specified. Past versions of Tkinter generated 
names as digit sequences, now it generates more readable and informative names.

If we ever add documentation for wm_manage it would be nice to mention 
explicitly that it does not work with corresponding ttk widgets.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
priority: normal -> low
type: behavior -> enhancement

___
Python tracker 

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



[issue43486] Python 3.9 installer not updating ARP table

2021-03-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2021-03-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The most common error is missing keyword "await" in function call. "f()" 
instead of "await f()".

There is a way to detect this error at runtime with minimal false positive and 
with minimal overhead. We can add a new opcode which checks if the value on the 
top of the stack is awaitable and raise warning/error in that case, and add it 
after every functional call whose result is ignored in asynchronous functions. 
It could even be merged with POP_TOP to reduce overhead.

CALL_FUNCTION ...
WARN_IF_AWAITABLE_AND_POP_TOP

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43486] Python 3.9 installer not updating ARP table

2021-03-13 Thread Adam


Adam  added the comment:

The 64 installer doesn't even show up in the ARP table, only Python Launcher.

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2021-03-13 Thread Nicholas Smith


Change by Nicholas Smith :


--
nosy: +nzsmith

___
Python tracker 

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



[issue43441] [Subinterpreters]: global variable next_version_tag cause method cache bug

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


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



[issue43441] [Subinterpreters]: global variable next_version_tag cause method cache bug

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 75048c8a38005845f10f8cb1dd33a31e0052cae0 by junyixie in branch 
'master':
bpo-43441: Fix _PyType_ClearCache() for subinterpreters (GH-24822)
https://github.com/python/cpython/commit/75048c8a38005845f10f8cb1dd33a31e0052cae0


--
nosy: +vstinner

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I'm confused. This issue is about the threading module, whereas bpo-37193 
is unrelated: it's about the socketserver module.

--

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5bd1059184b154d339f1bd53d23c98b5bcf14c8c by junyixie in branch 
'master':
bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)
https://github.com/python/cpython/commit/5bd1059184b154d339f1bd53d23c98b5bcf14c8c


--

___
Python tracker 

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



[issue23835] configparser does not convert defaults to strings

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -23600

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Right, enabling explicitly the Python UTF-8 Mode works around the issue

When the Python UTF-8 Mode is used, on macOS or on Android, Python uses its own 
UTF-8 decoder which respects the RFC 3629: it rejects characters outside 
[U+; U+10].

Otherwise, Python relies on the libc mbstowcs() decoder which may or may not 
create characters outside the [U+; U+10] range. I understand that this 
issue is mostly about the UTF-8 encoding, I don't think that other encodings 
can produce characters greater than U+10 code point.

--

___
Python tracker 

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



[issue43486] Python 3.9 installer not updating ARP table

2021-03-13 Thread Adam


New submission from Adam :

1. Install 3.9.0 using the following command line options: 

python-3.9.0.exe /quiet InstallAllUsers=1

2. Install 3.9.2 using the following command line options: 

python-3.9.2.exe /quiet InstallAllUsers=1

3. Observe that 3.9.2 successfully installed, however the ARP table does not 
reflect the latest version (see first screenshot in the attachment) it still 
shows 3.9.0 as installed.

4. Uninstall 3.9.2 using the following command line options:

python-3.9.2.exe /uninstall /silent

5. Observe that Python 3.9.0 is still listed as installed in the ARP table. 
Looking in the registry, all Python installed products are removed except for 
Python Launcher. Maybe it is by design to leave Python Launcher on the system, 
maybe not, but I think keeping the ARP table tidy would reduce confusion for 
users. See second screenshot in the attachment.

--
components: Installation
files: 1.jpg
messages: 388615
nosy: codaamok
priority: normal
severity: normal
status: open
title: Python 3.9 installer not updating ARP table
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49873/1.jpg

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
stage:  -> resolved

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
stage: resolved -> 

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> This shouldn't be an issue in 3.7, at least not with the default UTF-8 mode 
> configuration. With this mode, Py_DecodeLocale calls _Py_DecodeUTF8Ex using 
> the surrogateescape error handler [1].

Right, enabling explicitly the Python UTF-8 Mode works around the issue:
https://docs.python.org/dev/library/os.html#python-utf-8-mode


$ python3.10 -c 'import sys; print(ascii(sys.argv))' $'\U7fffbeba'
Fatal Python error: init_interp_main: failed to update the Python config
Python runtime state: core initialized
ValueError: character U+7fffbeba is not in range [U+; U+10]

Current thread 0x7effa1891740 (most recent call first):



$ python3.10 -X utf8 -c 'import sys; print(ascii(sys.argv))' $'\U7fffbeba'
['-c', '\udcfd\udcbf\udcbf\udcbb\udcba\udcba']

--

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
title: Change invalid unicode characters to replacement characters in argv -> 
Python startup fails with a fatal error if a command line argument contains an 
invalid Unicode character

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> https://bugs.python.org/issue25631 "Segmentation fault with invalid Unicode 
> command-line arguments in embedded Python" (actually 'fixed' since it now 
> abort()s)

This issue is different: it is about the Py_Main() function called explicitly 
when Python is embedded in an application. Python fails if the command line 
contains a *wide character* outside the [U+; U+10] range.

This issue is about Python on Linux in which case Py_BytesMain() is used to 
decode *bytes* from the command line.

--

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread Senthil Kumaran


Change by Senthil Kumaran :


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



[issue35883] Change invalid unicode characters to replacement characters in argv

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 24843 to fix this issue. With this fix, os.fsencode(sys.argv[1]) 
returns the original byte sequence as expected.

--

I dislike the replace error handler since it loses information. The PEP 383 
surrogateescape error handler exists to prevent losing information.

The root issue is that Py_DecodeLocale() creates wide characters outside Python 
Unicode valid range: [U+; U+10].

On Linux, Py_DecodeLocale() usually calls mbstowcs() of the C library. The 
problem is that the the glibc UTF-8 decoder doesn't respect the RFC 3629, it 
doesn't reject characters outside [U+; U+10] range. The following issue 
requests to change the glibc UTF-8 codec to respect the RFC 3629, but it's open 
since 2006:
https://sourceware.org/bugzilla/show_bug.cgi?id=2373

Even if the glibc changes, Python should behave the same on old glibc version.

My PEP modifies Py_DecodeLocale() to check if there are characters outside 
[U+; U+10] range and use the surrogateescape error handler in that case.

--

___
Python tracker 

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



[issue35883] Change invalid unicode characters to replacement characters in argv

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23605
pull_request: https://github.com/python/cpython/pull/24840

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +23604
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24839

___
Python tracker 

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



[issue43479] Remove a duplicate comment and assignment in http.client

2021-03-13 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

Re-opening; I believe this issue is still valid.

Here's output on a debug build on current master (commit 
7591d9455eb37525c832da3d65e1a7b3e6dbf613) on my machine:

lovelace:cpython mdickinson$ ./python.exe
Python 3.10.0a6+ (remotes/upstream/master:7591d9455e, Mar 13 2021, 12:04:31) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, threading, time
>>> for _ in range(10):
... threading.Thread().start()
... time.sleep(0.1)
... print(sys.gettotalrefcount())
... 
109901
109905
109907
109909
109911
109913
109915
109917
109919
109921

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



[issue43285] ftplib should not use the host from the PASV response

2021-03-13 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: ftplib use host from PASV response -> ftplib should not use the host 
from the PASV response

___
Python tracker 

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



[issue43285] ftplib use host from PASV response

2021-03-13 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'm not interested in chasing down a CVE for this myself.  If anyone wants to 
jump through the hoops to obtain one, the text used for curl in the hackerone 
link is likely a good guide.

My PR includes a way for people to opt-out of the secure behavior (why would 
anyone ever want that?) by setting the use_untrusted_server_pasv_ipv4_addr 
attribute to True on their ftplib.FTP instance.  Setting that attribute on a 
server lacking this fix is a no-op, making it safe to add to code running on 
any version.

This is an embarrassingly old widespread common issue in a large number of ftp 
clients.  Even the 1998 IPv6 RFC https://tools.ietf.org/html/rfc2428 indirectly 
acknowledges its existence by disallowing the new EPSV command that replaces 
PASV from returning anything other than the port number while leaving fields 
for the other values present but empty...

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Victor: How does the fix for #37193 solve this issue? I think I'm missing 
something.

--

___
Python tracker 

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



[issue43285] ftplib use host from PASV response

2021-03-13 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Cong Ma: Yes, I'm not worried about performance for the change you're 
proposing (though as you say, we should benchmark anyway). The performance 
thoughts were motivated by the idea of making NaN a singleton: adding a check 
to PyFloat_FromDouble would mean that almost every operation that produced a 
float would have to pass through that check.

--

___
Python tracker 

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



[issue27827] pathlib is_reserved fails for some reserved paths on Windows

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue43412] object.h -Wcast-qual warning

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> object.h contains an inline function that causes a -Wcast-qual warning from 
> gcc.

Which function? Can you please provide the warning?

Do you want to propose a fix?

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-37193 has been fixed.

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Cong Ma


Cong Ma  added the comment:

> Idea:  We could make this problem go away by making NaN a singleton.

Apart from the fact that NaN is not a specific value/object (as pointed out in 
the previous message by @mark.dickinson), currently each builtin singleton 
(None, True, False, etc.) in Python satisfies the following predicate:

`if s is a singleton, then s == s`

This is also satisfied by "flyweight" objects such as small ints.

It feels natural and unsurprising to have this, if not officially promised. 
Requiring NaN to be a singleton would violate this implicit understanding about 
singletons, and cause another surprise on top of the other surprises with NaNs 
(or with rich comparison in general).

Performance-wise, I think the current behaviour (returning _PyHASH_NAN == 0) is 
already nested inside two layers of conditionals in `_Py_HashDouble()` in 
Python/pyhash.c:

```
if (!Py_IS_FINITE(v)) {
if (Py_IS_INFINITY(v))
return v > 0 ? _PyHASH_INF : -_PyHASH_INF;
else
return _PyHASH_NAN;
}
```
(v is the underlying C `double`, field `ob_fval` of `PyFloatObject`).

I don't feel performance would be hurt by rewriting `float_hash()` in 
Objects/floatobject.c to the effect of

```
if (!Py_IS_NAN(v->ob_fval)) {
return _Py_HashDouble(v->ob_fval)
}
else {
return _Py_HashPointer(v);
}
```
and simplify the conditionals in `_Py_HashDouble()`. But of course, only real 
benchmarking could tell. (Also, other float-like types would have to be 
adjusted, too).

--

___
Python tracker 

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



[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

> signalling NaNs are quietly silenced on my machine

I just tested this assertion, and it appears that I was lying: this doesn't 
seem to be true. I'm almost *sure* it used to be true, and I'm not sure what 
changed, and when. (FWIW: Python 3.9.2 from macPorts on macOS 10.14.6 + Intel 
hardware. Earlier versions of Python on the same machine give similar results 
to those below, so it's not a core Python change.)

Here's an attempt to create an snan Python float:

Python 3.9.2 (default, Feb 28 2021, 13:47:30) 
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> snan_bits = 0x7ff000123456
>>> snan = struct.unpack(">> snan
nan

Converting back shows that the attempt was successful: the payload, including 
the signalling bit (bit 51, counting with the lsb as bit 0), was preserved:

>>> hex(struct.unpack(">> hex(struct.unpack("

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



  1   2   >