[issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton.

2021-05-21 Thread glubs9


glubs9  added the comment:

actually now that I am going through the documentation a bit more thoroughly 
this has happened again, dict_merge is placed below the sentence as well.

--

___
Python tracker 

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



[issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton.

2021-05-21 Thread glubs9


New submission from glubs9 :

in the dis library documentation where it lists all of the instructions in 
python bytecode, it includes a small sentence about half way dow "all of the 
following instructions use their arguments".

After this sentence there is an instruction specified LIST_TO_TUPLE which does 
not in fact use its argument.

It's a minor mistake but 100% on how it should be fixed so I have not yet made 
a pr. It could be fixed by removing the sentence or just moving it above the 
sentence. I'm not sure.

--
assignee: docs@python
components: Documentation
messages: 394178
nosy: docs@python, glubs9
priority: normal
severity: normal
status: open
title: LIST_TO_TUPLE placed below the sentence "all of the following use their 
opcodes" in dis library documentaiton.
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-21 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

On Thu, May 20, 2021 at 12:03:38AM +, Raymond Hettinger wrote:
> Raymond Hettinger  added the comment:
> You're right that this won't work for decimal because it takes a
> string constructor.  A fancier reduce might do the trick but it would
> involve modifying the C code (no fun) as well as the Python code.

Yes, it will be harder.  But I think - is possible.

E.g. with this trivial patch:
$ git diff
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py
index ff23322ed5..473fb86770 100644
--- a/Lib/_pydecimal.py
+++ b/Lib/_pydecimal.py
@@ -627,6 +627,9 @@ def __new__(cls, value="0", context=None):
 self._exp = value[2]
 self._is_special = True
 else:
+value = list(value)
+if isinstance(value[1], int):
+value[1] = tuple(map(int, str(value[1])))
 # process and validate the digits in value[1]
 digits = []
 for digit in value[1]:
@@ -3731,7 +3734,7 @@ def shift(self, other, context=None):

 # Support for pickling, copy, and deepcopy
 def __reduce__(self):
-return (self.__class__, (str(self),))
+return (self.__class__, ((self._sign, int(self._int), self._exp),))

 def __copy__(self):
 if type(self) is Decimal:

Simple test suggests that 2x size difference is possible:
>>> import pickle
>>> from test.support.import_helper import import_fresh_module
>>> P = import_fresh_module('decimal', blocked=['_decimal'])
>>> P.getcontext().prec = 1000
>>> d = P.Decimal('101').exp()
>>> len(pickle.dumps(d))
1045

vs
>>> len(pickle.dumps(d))
468

with the above diff.  (Some size reduction will be even if we
don't convert back and forth the self._int, due to self._exp size.
This is a less interesting case, but it's for free!  No speed penalty.)

> Also, the conversion from decimal to string and back isn't quadratic,
> so we don't have the same worries.

Yes, for a speed bonus - we need to do something more clever)

> Lastly, really large fractions happen naturally as they interoperate,
> but oversized decimals are uncommon.

For financial calculations this, probably, is true.  But perfectly
legal usage of this module - to compute mathematical functions with
arbitrary-precision (like mpmath does with mpmath.mpf).

Let me know if it's worth openning an issue with above improvement.

--

___
Python tracker 

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



[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


Change by Francisco Demartino :


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

___
Python tracker 

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



[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


Francisco Demartino  added the comment:

Looks like Roger Dahl also noted this on https://bugs.python.org/issue39765:

> Second, set_signal_handler()[sic] silently and implicitly removes 
> corresponding handlers set with signal.signal(). [...]  I think this should 
> be documented as well.

(then has a linked PR that apparently doesn't address this second part)

--

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Ideally, we should keep argparse in line with common practices.  AFAICT, 
treating '-' and '_' the same isn't a norm.  Click, for example, doesn't do 
this.

--
nosy: +rhettinger
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +paul.j3

___
Python tracker 

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



[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


New submission from Francisco Demartino :

Hello,

It looks like when asyncio sets up a signal handler, it forgets about the 
previous one (if any).

Here's a patch (was about to create a PR but the default text brought me to 
bugs.python.org)
https://github.com/franciscod/cpython/commit/bdac885b86fbb01d0d775f40c47870e48af5fa5b

Tracked this down to the initial asyncio checkout, in commit 
27b7c7ebf1039e96cac41b6330cf16b5632d9e49, a few commits before v3.4.0a4.

Not sure if this is a bug but it surprised me. I would have expected that it 
registered an "additional" signal handler, or at least that my previously 
installed signal handler would be called afterwards.

Also I'm not sure that it's a good idea to suddenly start running handlers that 
some current code might rely on not running, or have worked around this 
behaviour otherwise.

Thanks,
Francisco

--
components: asyncio
messages: 394174
nosy: Francisco Demartino, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio overrides signal handlers
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2021-05-21 Thread Dan Cecile


Change by Dan Cecile :


--
nosy: +dcecile

___
Python tracker 

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



[issue31767] Windows Installer fails with error 0x80091007 when trying to install debugging symbols

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

Any updates on this or can it be closed?

--
nosy: +ned.deily

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread Ammar Askar


Ammar Askar  added the comment:

Indeed, it's quite a tricky issue so I'm glad it was caught in the beta.

Thank you for the report Anthony. Thanks for tracing the root cause and the fix 
Victor and thank you to everyone who helped debug.

--

___
Python tracker 

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



[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-05-21 Thread Ned Deily


Change by Ned Deily :


--
components: +macOS
versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

Since 3.5 has now reached end-of-life, this issue will not be fixed there so it 
looks like it can be closed.

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

___
Python tracker 

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



[issue29788] [Security] tarfile: Add absolute_path option to tarfile, disabled by default

2021-05-21 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue20749] shutil.unpack_archive(): security concerns not documented

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

The warning from Tarfile.extractall (Doc/library/tarfile.rst -> 
https://docs.python.org/dev/library/tarfile.html#tarfile-objects) can be 
adapted for use here (Doc/library/shutil.rst -> 
https://docs.python.org/dev/library/shutil.html#archiving-operations).

--
keywords: +easy, newcomer friendly
nosy: +ned.deily
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

This looks like a duplicate of Issue43223 which has a PR in progress.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> [security] http.server: Open Redirection if the URL path starts 
with //

___
Python tracker 

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



[issue44038] In documentation Section 8.6, the definition of parameter_list need correcting

2021-05-21 Thread Webb Scales


Webb Scales  added the comment:

I concur -- it is correct as it is:  I wasn't properly interpreting the 
alternation.

Thank you for your attention; sorry for the false alarm!

--

___
Python tracker 

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



[issue40695] hashlib: OpenSSL hash detection should obey security policy

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

Is there anything more that needs to be done for this issue?

--
nosy: +ned.deily

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread William Barnhart


William Barnhart  added the comment:

I'm glad someone else thinks it's a good idea. If you have some ideas for 
tests, I'd be happy to help write them in order to spare the inconvenience 
(unless the tests are that easy to write then by all means please do). 

I can appreciate why the core developers could be polarized. One side could say 
it's safer to just take better care of our Python scripts and have them in 
wrapper functions. But people don't always do this.

In favor of the idea: This method can be used to spare developers from agony 
when a "_" is changed to a "-" when they aren't informed of the change. As a 
result, this can allow for code to remain usable since most developers are more 
interested in the letters of arguments and not so much special characters. But 
then again, a --help option could be all that's needed to fix this issue.

I think a solution that satisfies both parties would be creating some safe 
guard for adding arguments that are named identically, containing "_" or "-" in 
the middle, and raising an exception when the regexes of the arguments are 
conflicting. Such as if I wrote:
```
parser.add_argument('--please_work')
parser.add_argument('--please-work')
```
then an exception should be raised with an error for conflicting argument names.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Anthony Sottile: "that version of flake8 uses multiprocessing (even for 1 file) 
-- would the ast objects be involved in that way? (pyflakes also makes 
reference cyles to handle "parent" relationships)"

I expect flake8 to use the ast somewhere to analyze source code. But I don't 
have the bandwidth to investigate flake8 creates a reference cycle.

The Python regression is fixed, I closed the issue. Thanks for the bug report 
Anthony!

--
priority: release blocker -> 

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

The issue is fixed by:

commit 615069eb08494d089bf24e43547fbc482ed699b8
Author: Victor Stinner 
Date:   Fri May 21 19:19:54 2021 +0200

bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)

Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.

Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.

_PyMem_IsPtrFreed() argument is now constant.

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 50b0d148a68072292832eb69bdf1815b8059355f by Miss Islington (bot) 
in branch '3.10':
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) (GH-26290)
https://github.com/python/cpython/commit/50b0d148a68072292832eb69bdf1815b8059355f


--

___
Python tracker 

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



[issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

Is there anything more to be done for this issue or can it be closed?

--

___
Python tracker 

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



[issue44207] Add a version number to Python functions

2021-05-21 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue44206] Add a version number to dict keys.

2021-05-21 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread Anthony Sottile


Anthony Sottile  added the comment:

that version of flake8 uses multiprocessing (even for 1 file) -- would the ast 
objects be involved in that way? (pyflakes also makes reference cyles to handle 
"parent" relationships)

--

___
Python tracker 

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



[issue43124] [security] smtplib multiple CRLF injection

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR!  Can someone from the email team take a look at it, please?

--

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Zachery, unless someone steps with an objection, I think you can go forward 
with the PR to implement this signature:

linear_regression(x, y, /) -> LinearRegression(slope, intercept)

--

___
Python tracker 

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



[issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp'

2021-05-21 Thread Andreas Jansson


Change by Andreas Jansson :


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

___
Python tracker 

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



[issue36494] bdb.Bdb.set_trace: should set f_trace_lines = True

2021-05-21 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs a test.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue36494] bdb.Bdb.set_trace: should set f_trace_lines = True

2021-05-21 Thread Irit Katriel


Change by Irit Katriel :


--
stage: patch review -> test needed
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp'

2021-05-21 Thread Andreas Jansson


New submission from Andreas Jansson :

The mime type of .bmp was changed from image/x-ms-bmp in 
https://github.com/python/cpython/pull/4756.

https://github.com/python/cpython/pull/3062 then re-introduced image/x-ms-bmp 
while keeping the newer image/bmp mapping.

--
components: Library (Lib)
messages: 394157
nosy: andreasjansson
priority: normal
severity: normal
status: open
title: Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 
'image/x-ms-bmp'
type: behavior
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



[issue43167] Add a note to the macOS installer welcome window about customize options

2021-05-21 Thread Ned Deily


Ned Deily  added the comment:

As of the 3.9.5 and 3.10.0b1 macOS installers, the following text is displayed 
during installation near the top of the "Read Me" window:

Install Options
---

You can control some aspects of what is installed by this package. To see the 
options, click on the Customize button in the Installation Type step of the 
macOS installer app.  Click on a package name in the list shown to see more 
information about that option,

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



[issue40736] better message for re.search TypeError ("expected string or bytes-like object")

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



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

2021-05-21 Thread Irit Katriel


Irit Katriel  added the comment:

The open PR updates the docstrings in Lib/calendar.py but the corresponding 
changes in Doc/ still need to be added.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue44194] Folding ''.join() into f-strings

2021-05-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm also dubious that this would be of value in real code.  Looking at the 
implementation, it seems to throw way too much code at too small of a problem.  
I suspect is is more likely to cause maintenance problems than to produce 
noticeable benefits for users.

Historically, we've avoided folding higher level operations.  Serhiy's 
optimization of str.__mod__ went beyond those limits and shouldn't set a 
precedent that we will regret later.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44194] Folding ''.join() into f-strings

2021-05-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

> It is a pretty-targeted optimization, so I don't expect it to speed up the 
> macro benchmarks. Though that shouldn't be a blocker for small, targeted 
> optimizations.

In the past we've rejected optimizations that make the code more complex and 
don't result in any noticeable real-world speedups. I don't think that policy 
has changed.

--

___
Python tracker 

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



[issue44194] Folding ''.join() into f-strings

2021-05-21 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> We should check on a real-world benchmark instead of a micro benchmark.

It is a pretty-targeted optimization, so I don't expect it to speed up the 
macro benchmarks. Though that shouldn't be a blocker for small, targeted 
optimizations.

--

___
Python tracker 

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



[issue43556] fix attr names for ast.expr and ast.stmt

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



[issue43556] fix attr names for ast.expr and ast.stmt

2021-05-21 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 96c9961bfe1ab471a6bcd4b6e9255af25865dde2 by Zackery Spytz in 
branch '3.9':
bpo-43556: Fix the attr names for ast.expr and ast.stmt in the docs (GH-24940)
https://github.com/python/cpython/commit/96c9961bfe1ab471a6bcd4b6e9255af25865dde2


--
nosy: +iritkatriel

___
Python tracker 

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



[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-05-21 Thread Filipe Laíns

Change by Filipe Laíns :


--
components: +Library (Lib) -Installation

___
Python tracker 

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



[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-05-21 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-05-21 Thread Filipe Laíns

New submission from Filipe Laíns :

This protocol is needed to write type hints, so it should be public.

--
components: Installation
messages: 394150
nosy: FFY00, jaraco
priority: normal
severity: normal
status: open
title: Make importlib.metadata._meta.PackageMetadata public
type: enhancement
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue19821] deprecate pydoc.ispackage()

2021-05-21 Thread Irit Katriel


Change by Irit Katriel :


--
title: pydoc.ispackage() could be more accurate -> deprecate pydoc.ispackage()
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue44201] REPL requests another line despite syntax error

2021-05-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44201] REPL requests another line despite syntax error

2021-05-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yes, I was exactly working in that :)

--

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-05-21 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread Catherine Devlin


Catherine Devlin  added the comment:

Your PR doesn't include any tests... but I like the idea enough to create the 
tests for you if you prefer.

However, first I'd like to see whether the core devs like the idea.  I could 
see saying either "yes, why not make things easy" or "no, there should be only 
one way to do it".

--
nosy: +catherinedevlin

___
Python tracker 

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



[issue44199] code example index error in tutorial controlflow

2021-05-21 Thread HVoltBb


HVoltBb  added the comment:

right. I just realized that the moment I hit the submit button, and I closed 
this issue right away. Thanks for clearing it up.

--

___
Python tracker 

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



[issue44140] WeakKeyDictionary should support lookup by id instead of hash

2021-05-21 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue24929] _strptime.TimeRE should not enforce range in regex

2021-05-21 Thread Catherine Devlin


Catherine Devlin  added the comment:

Thinking about this a little more...

I suggest that slowing down execution shouldn't be a worry in this case, 
because trying to parse a garbage string into a date shouldn't be something 
code is doing zillions of times, and if it is, being slow isn't a terrible 
thing.  It should be the exception (so to speak) and not the rule, and thus not 
something we should worry about optimizing for.

That said, I can see not wanting to rely on throwing low-level errors that are 
outside Python's direct control.  (In fact, the PR I wrote didn't account for 
the OS-dependent nature of those messages, so if we decide to go ahead after 
all I'll need to make my PR account for that.)  If that is enough reason to 
reject the change, I'm content with that.

One way or the other, I would love to get this out of "Open" status - if we 
want to just close it as-is, I'll be satisfied.

--
nosy: +catherinedevlin

___
Python tracker 

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



[issue44190] Dictionary assignment shorthand

2021-05-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue44198] Add flags or function in pathlib.Path

2021-05-21 Thread Barney Gale


Barney Gale  added the comment:

My view:

I think the existing solution (that you highlight) is sufficiently idiomatic 
and easy to discover, and doesn't warrant a new argument or function.

However, that may change when `Path` is subclassable, for two reasons:

1. You will be able to subclass `Path` and add your own method, which you may 
find preferable to a helper function.
2. We _may_ add some sort of file type enum that wraps the constants in `stat`. 
In that case it might be natural to add a `file_type` argument to `iterdir()`. 
No promises!

--
nosy: +barneygale

___
Python tracker 

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



[issue44209] urllib.robotparser fail on Disallow: /? from google.com

2021-05-21 Thread Karl Y. Pradene


New submission from Karl Y. Pradene :

In robotparser.py
On line 222
path = urllib.parse.urlunparse(urllib.parse.urlparse(path))
tranform the entry Disallow: /?
in the google.com/robots.txt
in : Disallow: /
making every can_fetch request return False

--
components: Library (Lib)
messages: 394144
nosy: karl.pradene
priority: normal
severity: normal
status: open
title: urllib.robotparser fail on Disallow: /? from google.com
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



[issue42109] Use hypothesis for testing the standard library, falling back to stubs

2021-05-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Having read the parts of the paper that explain shortening, things are making 
more sense now. I have also successfully contributed type annotations to 
minithesis! :-)

--

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

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



[issue44201] REPL requests another line despite syntax error

2021-05-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Could we implement something in the REPL where it refuses to read another
line when asked for a token in an error recovery rule?

--

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is the test added here:

https://github.com/python/cpython/pull/26274

import ast
import builtins
import sys
import os

tree = ast.parse("pass")
x = [tree]
x.append(x)

# Put the cycle somewhere to survive until the *last* GC collection
def callback(*args):
pass
callback.a = x
os.register_at_fork(after_in_child=callback)





If this doesn't work maybe Erlend may help you reproducing this.

--

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Mark Shannon


Mark Shannon  added the comment:

What's the test case, exactly?

ref.py for the other issue doesn't crash if I change "func.py" to "ref.py"
otherwise it just complains that "func.py" doesn't exist.

--

___
Python tracker 

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



[issue40736] better message for re.search TypeError ("expected string or bytes-like object")

2021-05-21 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-21 Thread miss-islington


miss-islington  added the comment:


New changeset ae1732d4611ee859c754e7a867b2a4cbb47d0637 by Miss Islington (bot) 
in branch '3.10':
bpo-44180: Fix edge cases in invalid assigment rules in the parser (GH-26283)
https://github.com/python/cpython/commit/ae1732d4611ee859c754e7a867b2a4cbb47d0637


--

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread miss-islington


miss-islington  added the comment:


New changeset e10bd76d47dbb4ac296017b963c308d287a9d2f2 by Miss Islington (bot) 
in branch '3.9':
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
https://github.com/python/cpython/commit/e10bd76d47dbb4ac296017b963c308d287a9d2f2


--

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread miss-islington


miss-islington  added the comment:


New changeset 150bc1f4aa67226fb05fb29032375c203252a538 by Miss Islington (bot) 
in branch '3.10':
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
https://github.com/python/cpython/commit/150bc1f4aa67226fb05fb29032375c203252a538


--

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread William Barnhart


Change by William Barnhart :


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

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24898
pull_request: https://github.com/python/cpython/pull/26294

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-21 Thread William Barnhart


New submission from William Barnhart :

An issue I encountered recently with argparse was when I tried running a script 
with its argument changed from something like:
```
parser.add_argument('--please_work')
```
and was replaced with:
```
parser.add_argument('--please-work')
```

I have not ever seen anyone add an argument where a function has two arguments 
existing in a function, such as please_work and please-work. I think this is a 
pretty safe feature to implement, plus it enforces good practices. So if I 
wrote something such as:

```
parser = argparse.ArgumentParser(description="check this out")
parser.add_argument('--please-work')
```

Then I could call the program using:
```
python3 test.py --please_work True
```
or:
```
python3 test.py --please-work True
```

--
components: Library (Lib)
messages: 394135
nosy: wbarnha
priority: normal
severity: normal
status: open
title: argparse: Accept option without needing to distinguish "-" from "_" in 
arg_string
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +24897
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26293

___
Python tracker 

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



[issue43643] importlib.readers.MultiplexedPath.name is not a property

2021-05-21 Thread miss-islington


miss-islington  added the comment:


New changeset fdb65e399ea4e2d13dd41d65662ba25cafe15f1d by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-43643: Sync with python/importlib_resources@c17a610aad. (GH-26284) 
(GH-26286)
https://github.com/python/cpython/commit/fdb65e399ea4e2d13dd41d65662ba25cafe15f1d


--

___
Python tracker 

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



[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-21 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
stage: resolved -> 
type:  -> enhancement
versions: +Python 3.11

___
Python tracker 

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



[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> it seems too obscure and special-purpose to me to even
> qualify as a reasonable candidate for an itertools doc "recipe"

My thoughts are the same.

@latot Thank you for the suggestion but it doesn't make sense for the standard 
library.  We respectfully decline.

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



[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24896
pull_request: https://github.com/python/cpython/pull/26292

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Mark, can you check the failure? Otherwise is going to start failing on the 
buildbots when we add the test case for the issue Erlend mentions.

--

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24895
pull_request: https://github.com/python/cpython/pull/26291

___
Python tracker 

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



[issue44038] In documentation Section 8.6, the definition of parameter_list need correcting

2021-05-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After mentally reparsing and translating to English, I think you are right.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Anthony Sottile: I'm surprised that AST nodes survive until the last GC 
collection. It seems like somehow a reference cycle prevent to delete these 
nodes, and this reference cycle is kept alive somehow until the last GC 
collection at Python exit.

It would be interesting to follow references. You may start from 
PyInterpreterState which keeps objects alive until the last GC collection:

* os.register_at_fork() callbacks
* codecs.register() callback
* Python audit hooks
* sys.modules objects
* sys.__dict__

Callbacks keep global variables of a module alive through its __globals__ 
attribute (namespace of the module where it's defined).

--

___
Python tracker 

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



[issue44038] In documentation Section 8.6, the definition of parameter_list need correcting

2021-05-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think is correct:

parameter_list ::= defparameter ("," defparameter)* "," "/" ["," 
[parameter_list_no_posonly]] | parameter_list_no_posonly

Says "a parameter_list" is either:

defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] 

or

parameter_list_no_posonly

If you don't use the "/" then is the second option.

Feel free to reopen if I am missing something.

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



[issue44184] crash on windows invoking flake8

2021-05-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +24894
pull_request: https://github.com/python/cpython/pull/26290

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IOError is a back-compatibility synonym for OSError.  I will eliminate the last 
use from all 3 versions.  The change to the previous example was done by 2 
people who did not backport to 3.9 and I will not bother with that.  Future 
versions are already fixed.

--
stage: patch review -> 
versions: +Python 3.11

___
Python tracker 

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



[issue43927] Remove IOError references from the tutorial

2021-05-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-05-21 Thread Matthew Barnett


Matthew Barnett  added the comment:

I've only just realised that the test cases don't cover all eventualities: none 
of them test what happens with multiple spaces _between_ the letters, such as:

'  a  b c '.split(maxsplit=1) == ['a', 'b c ']

Comparing that with:

'  a  b c '.split(' ', maxsplit=1)

you see that passing None as the split character does not mean "any whitespace 
character". There's clearly a little more to it than that.

--

___
Python tracker 

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



[issue43643] importlib.readers.MultiplexedPath.name is not a property

2021-05-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44162] importlib.resources.path no longer supports directories

2021-05-21 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-21 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks for tracking this down, Filipe. Agreed it sounds like it's fixed in 
Python 3.10. It's unlikely the fix will be backported to Python 3.9. Instead, 
if this behavior affects your usage, consider using the `importlib_resources` 
backport, which also includes the fix. And please follow-up if there are issues 
not addressed by this approach.

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



[issue44038] In documentation Section 8.6, the definition of parameter_list need correcting

2021-05-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I *think* that another bracket pair is needed, changing
"," "/"
to
["," "/"]

--
nosy: +pablogsal, terry.reedy
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue44069] pathlib.Path.glob's generator is not a real generator

2021-05-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree that from the outside is seems slightly bizarre to make an internal 
list to implement a function documented as returning an iterator.  However, 
list(scandir) was added by Serhiy in #26032 with the comment that it made 
globbing 1.5-4 times faster.  This is, of course, if one runs the iterator to 
completion, as is the normal use.

For your presented use case, I suggest something like the following:

next(f for f in scandir(path) if os.path.splitext(f)[1] == '.txt')

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

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +24891
pull_request: https://github.com/python/cpython/pull/26285

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-05-21 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue43643] importlib.readers.MultiplexedPath.name is not a property

2021-05-21 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue44207] Add a version number to Python functions

2021-05-21 Thread Mark Shannon


New submission from Mark Shannon :

In order to specialize calls to Python functions, or to inline them, we need to 
know that the code object has not changed. It is also useful to know that the 
globals, builtins and various defaults haven't changed either. Rather than 
attempting to check these individually it is much simpler and faster to check a 
version number.

--
assignee: Mark.Shannon
messages: 394124
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Add a version number to Python functions
type: performance

___
Python tracker 

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



[issue43956] C-API: Incorrect default value for Py_SetProgramName

2021-05-21 Thread Jouke Witteveen


Jouke Witteveen  added the comment:

It is unclear to me what is holding back the proposed pull request. Is it 
simply waiting for someone from docs@python to take a look, or did it fall off 
the radar of vstinner in his related activities to deprecate the legacy API?

--

___
Python tracker 

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



[issue43643] importlib.readers.MultiplexedPath.name is not a property

2021-05-21 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I'd intended for the changes in 5.1 to make it into CPython, but I've missed 
the deadline, so I've backported the referenced commits to importlib_resources 
5.0.5 in order to sync into CPython.

--
versions: +Python 3.11

___
Python tracker 

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



[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24889
pull_request: https://github.com/python/cpython/pull/26283

___
Python tracker 

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



[issue44206] Add a version number to dict keys.

2021-05-21 Thread Mark Shannon


Mark Shannon  added the comment:

The memory saving comes from converting:

Py_ssize_t dk_size;
dict_lookup_func dk_lookup;

to:

   uint8_t dk_log2_size;
   uint8_t dk_loopup_kind; /* Only 3 possible values */
   uint32_t dk_version;

which saves 8 bytes on a 64 bit machine (no saving on a 32 bit machine).

--

___
Python tracker 

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



[issue44206] Add a version number to dict keys.

2021-05-21 Thread Mark Shannon


New submission from Mark Shannon :

Add a version number to dict keys.

PEP 509 added a version number to dicts. Unfortunately this is no use for 
optimizing attribute loads and store on instances.
We need to know whether the keys are as expected, not the dict as that is 
likely to be different each time.

We can add a 32 bit version number and actually reduce memory use by taking 
advantage of the redundancy in the rest of the keys object.

--
assignee: Mark.Shannon
messages: 394120
nosy: Mark.Shannon, methane, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a version number to dict keys.
type: performance

___
Python tracker 

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



[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 07dba474c582e61ca455846da7597d4346324e04 by Miss Islington (bot) 
in branch '3.10':
bpo-44180: Report generic syntax errors in the furthest position reached in the 
first parser pass (GH-26253) (GH-26281)
https://github.com/python/cpython/commit/07dba474c582e61ca455846da7597d4346324e04


--

___
Python tracker 

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



[issue44205] shutil.copystat can fail when copying to a file system with a smaller limit

2021-05-21 Thread Chris Burr


Change by Chris Burr :


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

___
Python tracker 

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



[issue44205] shutil.copystat can fail when copying to a file system with a smaller limit

2021-05-21 Thread Chris Burr


New submission from Chris Burr :

When copying files between systems with different limits on the size of the 
extended attributes that can be added to a file shutil.copystat can fail with:

/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/2064/stable/linux-64/lib/python3.8/shutil.py
 in copystat(src, dst, follow_symlinks)
377 # We must copy extended attributes before the file is (potentially)
378 # chmod()'ed read-only, otherwise setxattr() will error with 
-EACCES.
--> 379 _copyxattr(src, dst, follow_symlinks=follow)
380 try:
381 lookup("chmod")(dst, mode, follow_symlinks=follow)

/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/2064/stable/linux-64/lib/python3.8/shutil.py
 in _copyxattr(src, dst, follow_symlinks)
327 try:
328 value = os.getxattr(src, name, 
follow_symlinks=follow_symlinks)
--> 329 os.setxattr(dst, name, value, 
follow_symlinks=follow_symlinks)
330 except OSError as e:
331 if e.errno not in (errno.EPERM, errno.ENOTSUP, 
errno.ENODATA,

OSError: [Errno 28] No space left on device: '/tmp/lhcb'

This is caused by the destination filesystem having a smaller limit on the size 
of the extended attributes. I think this behaviour is unexpected as other 
failures are silently ignored (e.g. the destination doesn't support extended 
attributes).

--
components: Library (Lib)
messages: 394118
nosy: chrisburr
priority: normal
severity: normal
status: open
title: shutil.copystat can fail when copying to a file system with a smaller 
limit
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales

2021-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Backport to 3.8 may be more complicated. It's up to you to decide if you want 
to backport it or not. I merged your 3.9 backport, it looks very close to the 
change made in the main branch.

--

___
Python tracker 

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



[issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales

2021-05-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d3cc68900dc99966007112f884779895daefc7db by Jakub Kulík in branch 
'3.9':
[3.9] bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris 
(GH-25096) (GH-25847)
https://github.com/python/cpython/commit/d3cc68900dc99966007112f884779895daefc7db


--

___
Python tracker 

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



  1   2   >