[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-12-15 Thread hongweipeng


Change by hongweipeng :


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

___
Python tracker 

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



[issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"

2021-12-15 Thread Alex Waygood


Change by Alex Waygood :


--
title: Broken URL in tutorial -> [doc] Broken URL in "Brief Tour of the 
Standard Library"
type:  -> behavior
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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Ram Rachum


New submission from Ram Rachum :

The `msg` argument to the `assertRaises` function isn't documented. The 
documentation should say what this argument does.

--
assignee: docs@python
components: Documentation
messages: 408587
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: Document the msg argument for assertRaises
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



[issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified crashes

2021-12-15 Thread Irit Katriel


Irit Katriel  added the comment:

Changing type. Crash is typically segfault or hang in c code rather than an 
exception.

--
nosy: +iritkatriel
type: crash -> behavior

___
Python tracker 

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



[issue46077] Include sha256 hashes of release downloads in announcement communications

2021-12-15 Thread Yann Droneaud


Change by Yann Droneaud :


--
nosy: +ydroneaud

___
Python tracker 

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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Alex Waygood


Change by Alex Waygood :


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



[issue45292] Implement PEP 654: Exception Groups

2021-12-15 Thread Irit Katriel


Irit Katriel  added the comment:

The second opcode that the PR adds is PREP_RERAISE_STAR.

This opcode takes a list that contains:
1. all the exceptions that were raised in the executed except* clauses
2. the unmatched part of the exception group

It constructs the exception group that needs to be raised at the end.  This is 
done through a fairly complex operation on the BaseExceptionGroup, which merges 
the re-raised exceptions into the same nesting structure they had in the 
original exception group, so that

try:
   raise eg
except* ValueError:
   raise
except* TypeError:
   raise

is equivalent to just 'raise eg'.


Is there any overlap with existing opcodes?

--

___
Python tracker 

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



[issue45292] Implement PEP 654: Exception Groups

2021-12-15 Thread Irit Katriel


Irit Katriel  added the comment:

The way these two opcodes are combined by the compiler to implement except* is 
described in the pseudo code here: 

https://github.com/python/cpython/pull/29581#issuecomment-975660029

except* uses JUMP_IF_NOT_EG_MATCH. The excepts (not-*) that collect exceptions 
raised in the except* clauses are virtual.

The do_reraise_star at the end is PREP_RERAISE_STAR followed by 
POP_EXCEPT_AND_RERAISE.

--

___
Python tracker 

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



[issue42209] Incorrect line reported in syntax error

2021-12-15 Thread arian-f


arian-f  added the comment:

There are still variations of this issue in python 3.10 - the line nr is 
correct - in script attached it's line 2 (the attached script is otherwise the 
same): 

f'{ 1_a }'

resulting in:

  File "test.py", line 1
( 1_a )
   ^
SyntaxError: invalid decimal literal

or is this a different but similar bug? Can this bug be reopened or should I 
file a new bug?

> python -VV
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64 bit 
(AMD64)]

--
nosy: +arian-f
versions: +Python 3.10 -Python 3.8
Added file: https://bugs.python.org/file50491/test.py

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28336
pull_request: https://github.com/python/cpython/pull/30114

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 Thread Irit Katriel

Irit Katriel  added the comment:


New changeset 86de99588db3beff964137f4fe27dd1077a09b35 by Irit Katriel in 
branch 'main':
bpo-26952: [argparse] clearer error when formatting an empty mutually… 
(GH-30099)
https://github.com/python/cpython/commit/86de99588db3beff964137f4fe27dd1077a09b35


--

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28337
pull_request: https://github.com/python/cpython/pull/30115

___
Python tracker 

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



[issue46039] Break up the YIELD_FROM instruction.

2021-12-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 0b50a4f0cdee41a18fb4ba6e75569f9cfaceb39e by Mark Shannon in 
branch 'main':
bpo-46039: Split yield from in two (GH-30035)
https://github.com/python/cpython/commit/0b50a4f0cdee41a18fb4ba6e75569f9cfaceb39e


--

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2021-12-15 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-12-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28339
pull_request: https://github.com/python/cpython/pull/30117

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

Either reopen the issue or open a new issue. Only people subscribed to this bug 
are aware of the recent comments. Closed issues are hidden from the bugs home 
page and from the default search.

If you consider that Python must again support thread-less platforms, IMO it's 
a new feature and a new issue must be opened.

--

___
Python tracker 

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



[issue46082] type casting of bool

2021-12-15 Thread aziz


New submission from aziz :

>>> st = "True"
>>> bool(st)
True
>>> st = "False"
>>> bool(st)
True
>>> 
>>> stk = "False"
>>> bool(stk)
True
>>> eval(stk)
False

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 408595
nosy: aziz
priority: normal
severity: normal
status: open
title: type casting of bool
type: enhancement

___
Python tracker 

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



[issue45981] Get raw file name in bytes from ZipFile

2021-12-15 Thread Devourer Station


Devourer Station  added the comment:

I do think providing a rawfile field in the ZipInfo struct helps.
As a library, ZipFile should let users know what they are dealing with.
Users can get data from zip files, and ZipFile shouldn't corrupt them.
I don't mean that we should provide everything in raw bytes.
What I mean is that DATA could be CONVERTED, but couldn't be CORRUPTED.

--

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 Thread Irit Katriel

Irit Katriel  added the comment:


New changeset 8e4c96295bd78ae5f70b908e5dbac0da7c4c21bd by Miss Islington (bot) 
in branch '3.10':
bpo-26952: [argparse] clearer error when formatting an empty mutually… 
(GH-30099) (GH-30114)
https://github.com/python/cpython/commit/8e4c96295bd78ae5f70b908e5dbac0da7c4c21bd


--

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 Thread Irit Katriel

Irit Katriel  added the comment:


New changeset f0b274d2e21e6c7c1c0f56464070108f9bd00d20 by Miss Islington (bot) 
in branch '3.9':
bpo-26952: [argparse] clearer error when formatting an empty mutually… 
(GH-30099) (GH-30115)
https://github.com/python/cpython/commit/f0b274d2e21e6c7c1c0f56464070108f9bd00d20


--

___
Python tracker 

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



[issue26952] argparse help formatter raises IndexError

2021-12-15 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



[issue46082] type casting of bool

2021-12-15 Thread Alex Waygood


Alex Waygood  added the comment:

Hi! Your message here is a little unclear. Are you proposing a new feature (an 
enhancement), or filing a bug report?

In either case, I'm afraid this behavior is very unlikely to change. In 
general, strings in Python are always considered truthy unless they are empty, 
even if they are the literal string "False" or "0". This is a very important 
principle in Python, and changing it would raise serious 
backwards-compatibility concerns.

You can read more about truth-value testing here: 
https://docs.python.org/3/library/stdtypes.html#truth-value-testing

--
components:  -2to3 (2.x to 3.x conversion tool)
nosy: +AlexWaygood
status: open -> pending
type: enhancement -> 

___
Python tracker 

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



[issue17975] altinstall should not install libpython3.so (conflict between multiple $VERSIONs)

2021-12-15 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

The documentation at https://docs.python.org/3/library/unittest.html says "All 
the assert methods accept a msg argument that, if specified, is used as the 
error message on failure (see also longMessage). Note that the msg keyword 
argument can be passed to assertRaises(), assertRaisesRegex(), assertWarns(), 
assertWarnsRegex() only when they are used as a context manager."

--
nosy: +eric.smith

___
Python tracker 

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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Ram Rachum


Ram Rachum  added the comment:

Thanks, but people looking at a specific function might not guess that the 
documentation for one of its arguments is hiding somewhere on the long page. 
This is especially relevant with a confusing argument like `msg`, since it's 
tempting to think that this would be the message of the expected exception.

--

___
Python tracker 

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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Suggestions to improve it are welcomed. I can't think of a way to do it without 
cluttering things up.

--

___
Python tracker 

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



[issue41354] filecmp.cmp documentation does not match actual code

2021-12-15 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +28340
pull_request: https://github.com/python/cpython/pull/30120

___
Python tracker 

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



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Ram Rachum


Ram Rachum  added the comment:

I'd include that same message you quoted, minus the list of functions, on each 
and every one of the functions that have this argument.

--

___
Python tracker 

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



[issue46083] PyUnicode_FSConverter() has confusing reference semantics

2021-12-15 Thread Thomas Wouters


New submission from Thomas Wouters :

The PyUnicode_FSConverter function has confusing reference semantics, and 
confusing documentation.

https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_FSConverter says the 
output argument "must be a PyBytesObject* which must be released when it is no 
longer used." That seems to suggest one must pass a PyBytesObject to it, and 
indeed one of the error paths assumes an object was passed 
(https://github.com/python/cpython/blob/main/Objects/unicodeobject.c#L4116-- 
'addr' is called 'result' in the docs). Not passing a valid object would result 
in trying to DECREF NULL, or garbage. However, the function doesn't actually 
use the object, and later in the function overwrites the value *without* 
DECREFing it, so passing a valid object would in fact cause a leak.

I understand the function signature is the way it is so it can be used with 
PyArg_ParseTuple's O& format, but there are reasons to call it directly (e.g. 
with METH_O functions), and it would be nice if the semantics were more clear.

--
components: C API
messages: 408604
nosy: twouters
priority: normal
severity: normal
status: open
title: PyUnicode_FSConverter() has confusing reference semantics
versions: Python 3.10, Python 3.11, 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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-15 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28341
pull_request: https://github.com/python/cpython/pull/30122

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

I created PR 30123 to fix _PyUnicode_EqualToASCIIId() and type update_slot() 
functions. I added comments explaining why we can no longer optimize the 
comparison of two interned string objects.

--

___
Python tracker 

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



[issue40533] [subinterpreters] Don't share Python objects between interpreters

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

Until all Python stdlib C extensions and all third-party C extensions will be 
modified to no longer use and define static types and will stop shared Python 
objects between two interpreters, we can no longer micro-optimize the 
comparison of two interned strings by only comparing their memory addresse. See 
bpo-46006.

--

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


New submission from Jim Schwartz :

Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not. 
 I've enclosed sample scripts that compare the two and have returned the 
results.  the windows 10 registry entry to extend the path names fixes this 
issue 
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled
 set to 1).  I've enclosed a scripts that proved this occurs and can be used 
for testing. I have a script that does the same thing using os_walk, but I 
can't attach two scripts to this Issue.

--
components: IO, Tests, Windows
files: test_dir_scan_dir.py
messages: 408607
nosy: jschwar313, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk 
does not
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50492/test_dir_scan_dir.py

___
Python tracker 

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



[issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception

2021-12-15 Thread Irit Katriel


Change by Irit Katriel :


--
title: argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help 
specified crashes -> argparse.BooleanOptionalAction with 
default=argparse.SUPPRESS and help specified raises exception

___
Python tracker 

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



[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-12-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 3a60bfef49b3324660a615a8e6d10710e5f669d9 by Mark Shannon in 
branch 'main':
bpo-44525: Specialize for calls to type and other builtin classes with 1 
argument. (GH-29942)
https://github.com/python/cpython/commit/3a60bfef49b3324660a615a8e6d10710e5f669d9


--

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

Here's the second file that works just fine under python 3.9 (by the way, I am 
using Windows 64-bit).  I didn't test this on later python versions, however, 
nor did I test it on 32-bit versions.  I see that many people on the internet 
have said to change the working directory as a work around.  Could this 
possibly be why?

--
Added file: https://bugs.python.org/file50493/test_os_walk.py

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

These bug prevent the Fedora infra team from upgrading the Koji builders to 
Fedora 35. Koji runs on mod_wsgi which is affected by the bug:
https://bugzilla.redhat.com/show_bug.cgi?id=2030621#c1

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-46070: I don't know if it's related.

--

___
Python tracker 

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



[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-12-15 Thread Ken Jin


Ken Jin  added the comment:

Happened to a PR I was reviewing today:
https://github.com/python/cpython/runs/4535247255?check_suite_focus=true

--
keywords:  -patch
nosy: +kj
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



[issue46072] Unify handling of stats in the CPython VM

2021-12-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 342b93f9f28746abb7b221a61d5a9b26ccbb395a by Mark Shannon in 
branch 'main':
bpo-46072: Add --with-pystats configure option to simplify gathering of VM 
stats (GH-30116)
https://github.com/python/cpython/commit/342b93f9f28746abb7b221a61d5a9b26ccbb395a


--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread Mark Shannon


Mark Shannon  added the comment:

The problem here is that different sub-interpreters have different strings for 
the same Python string.

Unless sub-interpreters are fully independent, and they cannot be due to 
limitations imposed by the stable API, then all sub-interpreters must share the 
same poll of strings.

Since the only object reachable from a string is the `str` object (which is a 
static global object `PyUnicode_Type`), then the invariant that no object that 
is unique to one sub-interpreter can be reached from another sub-interpreter 
remains valid if strings are shared. I.e. there is no reason not to share 
strings.

As Victor points out, there is no bug in 3.9 because interned strings are 
common across all interpreter. We should revert that behavior.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Daniel McDonald


Daniel McDonald  added the comment:

I'd like to politely request this issue be reopened. 

We recently observed a similar, if not the same, OverflowError during 
continuous integration using Github Actions on ubuntu-latest (20.04). We can 
produce the error using pure Python without pytz.

We have been unable to replicate the error using Github Actions on 
macos-latest, Centos 7.9, Ubuntu 18.04 or OSX 11.6.1.

Specifically, the following code, which I believe is pure python, will trigger 
the overflow. We've observed this using Python 3.7 and 3.9. 

import time
print(time.mktime((2017,5,26,15,30,16,4,146,1)))

Exact error output from CI can be found at the link below: 

https://github.com/biocore/microsetta-private-api/runs/4536611219?check_suite_focus=true#step:4:117

On a passing system, we receive "1495837816.0" as output. On a failing system, 
we observe "OverflowError: mktime argument out of range". 

More detail can be found on our issue with pytz and stub42 who helped guide a 
more definitive example of the bug showing it could be pure Python. That issue 
can be found here:

https://github.com/stub42/pytz/issues/66

Last, I apologize in advance if any detail is missing here or if this is not 
formatted as well as it should be. This is my first bug report with Python and 
am unfamiliar with the norms. Please let me know if further information may be 
helpful.

--
nosy: +wasade
versions: +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



[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Kevin Shweh


New submission from Kevin Shweh :

The OrderedDict iterator caches a di_result tuple for use with 
iter(od.items()). It's *supposed* to only do that for the items() case, but the 
code does

if (kind & (_odict_ITER_KEYS | _odict_ITER_VALUES))

to test for this case. This is the wrong test. It should be

if ((kind & _odict_ITER_KEYS) && (kind &_odict_ITER_VALUES))

The current test allocates di_result for key and value iterators as well as 
items iterators.

--
components: Library (Lib)
messages: 408616
nosy: Kevin Shweh
priority: normal
severity: normal
status: open
title: OrderedDict iterator allocates di_result unnecessarily
type: resource usage
versions: Python 3.10, Python 3.11, 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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Eryk Sun


Eryk Sun  added the comment:

> Python 3.9.6 scan_dir returns filenotfound on long paths, 
> but os_walk does not.

This would be surprising. os.walk() has been implemented via os.scandir() since 
Python 3.5. Do you have a concrete example of the directory structure to test? 

> I see that many people on the internet have said to 
> change the working directory as a work around.  

Changing the working directory is a workaround in Unix, not Windows. Without 
long-path support, the working directory in Windows is limited to 258 (MAX_PATH 
- 2) characters.

Without long-path support, the workaround in Windows is to use an extended 
path, i.e. a Unicode path that's fully-qualified and normalized -- as returned 
by os.path.abspath() -- and prefixed by "?\\" or "?\\UNC\\" (e.g. 
r"\\?\C:\spam" or r"\\?\UNC\server\share\spam"). This allows the native path 
length limit of about 32760 characters. Some API functions and applications do 
not support extended paths. In particular setting an extended path as the 
working directory is unsupported and buggy, even if long-path support is 
enabled. But extended paths work fine with most file functions in the os and 
shutil modules, such as os.scandir(), os.stat(), os.open(), shutil.copytree(), 
and shutil.rmtree().

--
nosy: +eryksun

___
Python tracker 

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



[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +rhettinger
versions:  -Python 3.8

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2021-12-15 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please add the new option to Doc/using/configure.rst ?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

yes, I do.  
C:\Users\Jim\Documents\jschw_uiowtv3_old\AppData\Local\Google\Chrome\User 
Data\Default\Extensions\nenlahapcbofgnanklpelkaejcehkggg\0.1.823.675_0\notifications\pages\Cashback\components\CashBackResolve\components\RewardsActivation\components\CashbackSectionSimple

it's over the 260 character limit that's the default for windows 10.

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread STINNER Victor


STINNER Victor  added the comment:

Mark: "As Victor points out, there is no bug in 3.9 because interned strings 
are common across all interpreter. We should revert that behavior."

The rationale for having per-interpreter interned strings and per-interpreter 
_Py_IDENTIFIER() string objects can be found in bpo-39465 and bpo-40521.

--

___
Python tracker 

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



[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-12-15 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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
pull_requests: +28343
pull_request: https://github.com/python/cpython/pull/30124

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Eryk Sun


Eryk Sun  added the comment:

It works as expected for me:

>>> len(p)
261
>>> print(p)
C:\Temp\Jim\Documents\jschw_uiowtv3_old\AppData\Local\Google\Chrome\User 
Data\Default\Extensions\nenlahapcbofgnanklpelkaejcehkggg\0.1.823.675_0\notifications\pages\Cashback\components\CashBackResolve\components\RewardsActivation\components\CashbackSectionSimple

os.walk() can list the files in directory `p` if the \\?\ prefix is prepended:

>>> next(os.walk('?\\' + p))[-1]
['spam.txt']

Without the prefix, the internal os.scandir() call fails, but by default the 
error is ignored:

>>> next(os.walk(p))[-1]
Traceback (most recent call last):
  File "", line 1, in 
StopIteration

We can print the exception to see that it's the expected ERROR_PATH_NOT_FOUND 
(3) error for a path that's too long:

>>> next(os.walk(p, onerror=print))[-1]
[WinError 3] The system cannot find the path specified: 
'C:\\Temp\\Jim\\Documents\\jschw_uiowtv3_old\\AppData\\Local\\Google\\Chrome\\User
 
Data\\Default\\Extensions\\nenlahapcbofgnanklpelkaejcehkggg\\0.1.823.675_0\\notifications\\pages\\Cashback\\components\\CashBackResolve\\components\\RewardsActivation\\components\\CashbackSectionSimple'
Traceback (most recent call last):
  File "", line 1, in 
StopIteration

--

___
Python tracker 

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



[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Giacomo


New submission from Giacomo :

Here I propose a new function, namely .ratio_min(self,m). 

.ratio_min(self,m) is an extension of the difflib's function .ratio(self). 
Equivalently to .ratio(self), .ratio_min(self,m) returns a measure of two 
sequences' similarity (float in [0,1]). In addition to .ratio(), it can ignore 
matched substrings if these substrings have length less than a given threshold 
m. m is the second variable of the function. 

It is very useful to avoid spurious high similarity scores. 

# NEW FUNCTION: 

def ratio_min(self,m):
"""Return a measure of the sequences' similarity (float in [0,1]).
Where T is the total number of elements in both sequences, and
M_min is the number of matches with every single match has length at 
least m, this is 2.0*M_min / T.
Note that this is 1 if the sequences are identical, and 0 if
they have no substring of length m or more in common.
.ratio_min() is similar to .ratio(). 
.ratio_min(1) is equivalent to .ratio().

>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio_min(1)
0.75
>>> s.ratio_min(2)
0.75
>>> s.ratio_min(3)
0.75
>>> s.ratio_min(4)
0.0
"""

matches = sum(triple[-1] for triple in self.get_matching_blocks() if 
triple[-1] >=m)
return _calculate_ratio(matches, len(self.a) + len(self.b))

--
components: Library (Lib)
messages: 408622
nosy: gibu
priority: normal
severity: normal
status: open
title: Add ratio_min() function to the difflib library
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



[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

do you have this registry entry set to 1: 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled 
set to 1.  It works if you do.  What version of windows do you have?  I have 
version 21H2 (OS Build 19044.1387).  I don't have windows 11 yet.

--

___
Python tracker 

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



[issue46087] Zip library documentation error

2021-12-15 Thread Arthur Milchior


New submission from Arthur Milchior :

I don't have permission to assign the issue, but I intend to post the change in 
a few minutes as a PR

Copied from Richard Hyde's email to doc mailing list.

One of the examples of string formatting doesn't work. This applies to prior 
versions of Python as well.

The last set of the examples headed: 'Nesting arguments and more complex 
examples:' starts with the following code:

>>> for align, text in zip('<^>', ['left', 'center', 'right']):
... '{0:{fill}{align}16}'.format(text, fill=align, align=align)
...

This omits print()
The correct code would be:

>>> for align, text in zip('<^>', ['left', 'center', 'right']):
... print('{0:{fill}{align}16}'.format(text, fill=align, align=align))
...



---

I agree with Richard here that there is a problem. Most example don't use 
print, but since there is no returned expression, that's the most relevant way 
to express the meaning of the example. Adding an expression would just make 
things more complex.

Bug introducde in 28fbea412819f90698527c1997ece5aeddf8e9a7 in 2010.

--
assignee: docs@python
components: Documentation
messages: 408624
nosy: Arthur-Milchior, docs@python
priority: normal
severity: normal
status: open
title: Zip library documentation error
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



[issue46087] Zip library documentation error

2021-12-15 Thread Arthur Milchior


Change by Arthur Milchior :


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

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Eryk Sun


Eryk Sun  added the comment:

If I had long paths enabled, then next(os.walk(p, onerror=print)) would not 
have printed the error that I showed in the example and would not have 
immediately raised StopIteration. Instead it would have returned a (dirpath, 
dirnames, filenames) result for directory `p`. Did you repeat the simple 
examples that I showed, exactly as shown, and get a different result?

--

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

os.walk() has been implemented via os.scandir(), but by default it ignores 
OSErrors raised by os.scandir(), DirEntry.is_dir() and DirEntry.is_symlink(). 
You can get errors raised by os.scandir() if specify the onerror argument, but 
errors in DirEntry.is_dir() and DirEntry.is_symlink() are always ignored, so 
too deep directories or links to directories can be treated as files.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Confirmed on Ubuntu buildbot:

https://github.com/python/cpython/runs/4537544103?check_suite_focus=true

--

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
resolution: works for me -> 
stage: resolved -> needs patch
status: closed -> open
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



[issue46087] Zip library documentation error

2021-12-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since it is a REPL example, no print() is needed. In REPL any expression 
statement prints the repr of its result. For example:

>>> for x in range(1, 5):
... f'{x}**2 = {x**2}'
... 
'1**2 = 1'
'2**2 = 4'
'3**2 = 9'
'4**2 = 16'

There are many such examples in the documentation, and I do not think that this 
particular example needs a change.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46087] Zip library documentation error

2021-12-15 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Alex Waygood


Alex Waygood  added the comment:

I am removing 3.10 from the "versions" field, since additions to the standard 
library are only considered for unreleased versions of Python.

--
nosy: +AlexWaygood, tim.peters
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



[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Alex Waygood


Change by Alex Waygood :


--
nosy:  -AlexWaygood

___
Python tracker 

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



[issue46087] Zip library documentation error

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Good point, Serhiy. I also don't see how the proposed change is related to any 
zip documentation (which is in the title of this issue).

I suggest closing this.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46087] format library documentation error

2021-12-15 Thread Arthur Milchior


Arthur Milchior  added the comment:

ipypthon3 does not print the loop content. python3 does. I only tested with 
ipython. I beg your pardon. I didn't know about this difference in behavior

--
nosy:  -eric.smith
title: Zip library documentation error -> format library documentation error

___
Python tracker 

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



[issue46087] format library documentation error

2021-12-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +eric.smith
resolution:  -> not a bug
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



[issue46070] broken subinterpreters

2021-12-15 Thread Nathan Jensen


Change by Nathan Jensen :


--
nosy: +ndjensen

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Eryk Sun


Eryk Sun  added the comment:

> but errors in DirEntry.is_dir() and DirEntry.is_symlink() 
> are always ignored

In Windows, is_symlink() won't fail due to a long path, since that information 
comes from the directory listing, but is_dir() might fail for a long path if 
it's a symlink to a directory. Windows requires that a symlink to a directory 
is also a directory (i.e. the symlink reparse point is set on an empty 
directory), but it's not enough to check that it's a directory symlink. 
is_dir() requires checking that the target exists, which may fail if the path 
of the link is too long to open and resolve the link target.

--

___
Python tracker 

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



[issue46070] broken subinterpreters

2021-12-15 Thread Ben Steffensmeier


Ben Steffensmeier  added the comment:

We have been seeing intermittent crashes on jep that we tracked down to the 
same change (d0d29655ff).

I have created a sample program using _testcapi that crashes about 50% of the 
time when run on Windows with Python 3.9.9. We have not been able to reproduce 
problems on any other OS.

See also: https://github.com/ninia/jep/issues/366

--
nosy: +bsteffensmeier
Added file: https://bugs.python.org/file50494/win_py399_crash_reproducer.py

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

the issue is with the scandir script, not the os_walk script.  I tried to 
upload the scandir python script before, but I guess it didn't upload.  When I 
was running the two scripts, I used an input of C:\\ as the input parameter.  
Hope that helps.

--
Added file: https://bugs.python.org/file50495/test_dir_scan_dir.py

___
Python tracker 

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-15 Thread Guido van Rossum


New submission from Guido van Rossum :

I am trying to build under Visual Studio (the 2019 release) and I'm 
encountering the following weird issue. In the project file 
PCbuild\_freeze_module.vcxproj there's a command that runs the 
Tools\scripts\deepfreeze.py script to generate some code.

The invocation is as follows:



Apparently the PythonForBuild variable is unset, because this steps is trying 
to *open* the deepfreeze.py script using the default app for opening .py files, 
which in my case is VS Code.

It seems that when using PCbuild\build.bat, PythonForBuild is set (on line 121) 
to %PYTHON%, which presumably points to some Python interpreter. But apparently 
when the build is driven by VS, this is not executed and now we're stuck.

Is there someone with enough MSBUILD skills to help me fix this?

--
components: Build, Windows
messages: 408635
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Build hangs under Visual Studio in deepfreeze stage
type: compile error
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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py" 
"C:\\"

I get this output:

...
Traceback (most recent call last):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 54, in 
main(sys.argv[0:])
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 30, in main
for file in get_files_in_dir(source):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  [Previous line repeated 19 more times]
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 9, in get_files_in_dir
for entry in os.scandir(source):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 
'C:\\Users\\Jim\\Documents\\jschw_uiowtv3_old\\AppData\\Local\\Google\\Chrome\\User
 
Data\\Default\\Extensions\\nenlahapcbofgnanklpelkaejcehkggg\\0.1.823.675_0\\notifications\\pages\\Cashback\\components\\CashBackResolve\\components\\RewardsActivation\\components\\CashbackSectionSimple'

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_os_walk.py" "C:\\"

I get this:

...
file is  C:\winutils\bin\winutils.exe
End time is  2021-12-15.13:11:54
Duration is  0:06:05

I don't think this should happen, right?

--

___
Python tracker 

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



[issue22047] Deprecate unsupported nesting of argparse groups

2021-12-15 Thread Irit Katriel


Irit Katriel  added the comment:

Another issue due to nesting: issue38590.

--

___
Python tracker 

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



[issue46089] Problems with AF_PACKET sockets

2021-12-15 Thread G. Allard


New submission from G. Allard :

For educational purposes, I'm developing my own IP stack in Python. It's going 
well but I'm stuck at a low level.
I need to implement the following (simple) task:
- open an AF_PACKET socket (socket.socket)
- bind it to a specific interface (socket.bind)
Python code would look like this:
- sock = socket.socket( socket.AF_PACKET, socket.SOCK_RAW, socket.htons( 
ETH_P_ALL))
- sock.setblocking( False)
- sock.bind(( 'eth0', socket.htons( ETH_P_ALL)))
It does not work. bind always return "TypeError: AF_PACKET address must be a 
tuple of two to five elements"
I spent many days on that problem. No success.

Desperate, I tried to verify it wasn't a kernel problem. I wrote the C version 
of the above snippet. 
- sock = socket( AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons( 3));
- struct sockaddr_ll addr = {0};
  addr.sll_family = AF_PACKET;
  addr.sll_ifindex = 2;  /* index of 'eth0' */
  addr.sll_protocol = htons( ETH_P_ALL);
- bind( sock, (struct sockaddr*) &addr, sizeof( addr));
I'm not an expert in C programming but it worked on first try.

First problem is that AF_PACKET sockets are broken in Python.

Second problem is inadequate documentation.
Following issue ID 25041, some documentation has been added but there is still 
lot of room for improvements.
For example:
- recvfrom return 2 values. The first is the binary packet and the second one 
is a 5 member structure. The first member of the structure is the interface 
name. The 5th member if the MAC address (assuming the interface is an Ethernet 
NIC). The 3rd one is a protocol number (the data-link protocol) whose data is 
in front of the returnet packet (for WiFi packets, we will see Radiotap 
protocol at that level).
That's a whole new world for documentors.

- socket.bind() parameter is documented to be an address. For AF_PACKET, the 
address is documented in "Socket Families" section. Definition is vague. The 
'proto' description would be easier to understand with "An integer (in 
network-byte-order) representing the low level protocol (enumerated in 
linux/if_ether.h) or ETH_P_ALL for all protocols. This parameter is only used 
for filtering inbound packets."
IMO 'pkttype', 'hatype', 'addr' are there to document the information returned 
by recvfrom(). It's written they are "optional" but I think it's not correct.

- Working examples of AF_PACKET must be provided, possibly in a HOWTO.

When it's easier to program in C, it should tell you there is a problem on 
Python side.

--
assignee: docs@python
components: Documentation
messages: 408638
nosy: docs@python, gallard
priority: normal
severity: normal
status: open
title: Problems with AF_PACKET sockets
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue44999] Argparse missing translates

2021-12-15 Thread Irit Katriel


Change by Irit Katriel :


--
nosy:  -lys.nikolaou
type: performance -> behavior
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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread Eric Snow


Eric Snow  added the comment:

It sounds like this bug is another case where we have made some objects
per-interpreter but others are still global and this is causing problems.
_PyUnicode_EqualToASCIIId() wouldn't have any problems if interpreters
weren't sharing any objects (or were only sharing immutable "immortal"
objects).

For now can we just move the relevant per-interpreter strings from
PyInterpreterState.unicode_state ("interned" and "ids") up to
_PyRuntimeState.  They will then be global, which should restore 
the correct behavior.

Personally, I'd rather we not revert the original change.  Moving the data
to _PyRuntimeState would save me some effort with related work I'm doing
right now.

Of course, the potential bug would still exist in _PyUnicode_EqualToASCIIId().
Could we add a test as part of this fix to verify the failure case described
here actually works?

--

___
Python tracker 

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2021-12-15 Thread jdogzz-g5


Change by jdogzz-g5 :


--
nosy: +jdogzz-g5

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-15 Thread Eric Snow


Eric Snow  added the comment:

FWIW, it makes sense to me for the interned strings to be per-interpreter 
eventually.
Otherwise strings interned by an interpreter would persist after that 
interpreter
is finalized, potentially leaking memory until the runtime is finalized.

However, if we end up with immortal objects then I think all the strings created
through _Py_IDENTIFIER() should be global (_PyRuntimeState).  Otherwise they 
must
be per-interpreter (if we have a per-interpreter GIL).

--

___
Python tracker 

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



[issue32867] argparse assertion failure with multiline metavars

2021-12-15 Thread Irit Katriel


Irit Katriel  added the comment:

It works for me on 3.11:

% ./python.exe b.py -h
usage: 11 [-h] [-v] 123456
12345
12345
123 [123456
12345
12345
123 ...]

positional arguments:
  123456
12345
12345
123
installation targets

options:
  -h, --helpshow this help message and exit
  -v, --verbose verbose mode

--
nosy: +iritkatriel
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you both.  Status: Failures on Open Suse TW (Vyacheslav) and Ubuntu 20-04 
(Daniel McDonald, Github Actions, and Azure Pipelines).
Success on Windows (me), macOS (Catalina-me and 11.6.1-DM), Centos 7.9 and 
Ubuntu 18-04 (both DM) 

I verified that the sample tuple is consistent and round-trips with 
time.localtime.

>>> import time
>>> time.mktime((2017,5,26,15,30,16,4,146,1))
1495827016.0
>>> time.localtime(time.mktime((2017,5,26,15,30,16,4,146,1)))
time.struct_time(tm_year=2017, tm_mon=5, tm_mday=26, tm_hour=15, tm_min=30, 
tm_sec=16, tm_wday=4, tm_yday=146, tm_isdst=1)

While OverflowError is documented as a legitimate response, it is not for a 
contemporary valid datetime such as the above.  Someone with a failure machine 
could try to determine what tuple vales do and don't result in the error.  
Someone with both failure and success machines could add debug prints to mktime 
(or use C debugger) to see where the behavior of the C code diverges on the two 
machines.  If no one active on the issue can do either, a request could be made 
for help on python-list.

--

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

my c drive and h drive are both internal drives and I run the python script 
from my user directory on my c drive.  Not sure if that makes any difference.  
Just trying to think of things that might help you reproduce and fix this.

--

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Daniel McDonald


Daniel McDonald  added the comment:

Thank you, Terry. I'm currently exploring modifications to the test Andrei made 
within a fork of CPython using Github Actions (ubuntu-latest). These 
modifications include debug prints in the CPython mktime call, and some 
parameter exploration. I expect to have a summary of the observations this 
afternoon.

--

___
Python tracker 

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



[issue46089] Problems with AF_PACKET sockets

2021-12-15 Thread Ethan Furman


Ethan Furman  added the comment:

Thank you for the thorough report.  Do you feel comfortable writing that 
missing documentation?

--
nosy: +ethan.furman

___
Python tracker 

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



[issue35844] Calling `Multiprocessing.Queue.close()` too quickly causes intermittent failure (BrokenPipeError)

2021-12-15 Thread jdogzz-g5


Change by jdogzz-g5 :


--
nosy: +jdogzz-g5

___
Python tracker 

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



[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> tim.peters

___
Python tracker 

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



[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +eric.snow

___
Python tracker 

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



[issue46090] C extensions can't swap out live frames anymore

2021-12-15 Thread Brandt Bucher


New submission from Brandt Bucher :

I'm specifically concerned about Greenlet here (since it's a dependency of 
pyperformance), but this discussion is equally relevant to any library like it 
that dynamically swaps out the currently executing frame.

CPython 3.11 makes several major changes to how frame objects are used and 
represented internally:

- bpo-44032: Move data stack to thread from FrameObject. 
(https://github.com/python/cpython/pull/26076)
- bpo-44590: Lazily allocate frame objects 
(https://github.com/python/cpython/pull/27077)
- bpo-45637: Store the frame pointer in the cframe 
(https://github.com/python/cpython/pull/29267)

These changes break Greenlet's hot-swapping of frame objects 
(https://github.com/python-greenlet/greenlet/blob/be41e1a24925326b72a02ef5cb6d1ed9643eb062/src/greenlet/greenlet_greenlet.hpp#L768-L811)
 in a pretty serious way, and it's not immediately clear what the best fix is. 
A fairly high-level overview of the new design:

When a frame is executing, the current thread state points to the current 
CFrame, which itself points to a C-level InterpreterFrame. This interpreter 
frame is located within a "data stack" that is managed by the thread state. If 
a PyFrameObject for the currently executing frame is requested (using 
PyThreadState_GetFrame), the new PyFrameObject points into the 
InterpreterFrame, where all of the important data is still stored. So far so 
good.

The issue is what happens next. If the InterpreterFrame is replaced, or exits 
in any way, its memory may be reused, or even freed entirely. The PyFrameObject 
is smart enough to copy the data elsewhere (into itself) when this happens, but 
the new design means that there is no obvious way for a third-party library to 
"reactivate" a frame in a way analogous to assigning to the old tstate->frame 
member.

While I'm pretty sure that we don't officially support this "feature", it's 
probably used often enough that we should at least brainstorm a workaround (if 
not an unstable C-API function) for affected projects. I suspect that a 
potential solution likely involves creating an entirely new InterpreterFrame 
the normal way, and copying the PyFrameObject's InterpreterFrame data into it? 
Not sure what would happen if the old InterpreterFrame was still alive on the 
data stack, though...

In any case, it probably makes sense to discuss here with affected library 
maintainers.

--
assignee: brandtbucher
components: Interpreter Core
messages: 408646
nosy: Mark.Shannon, brandtbucher, gvanrossum, pablogsal
priority: normal
severity: normal
status: open
title: C extensions can't swap out live frames anymore
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



[issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"

2021-12-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This seems to be a temporary outage, expected to be restored in the first half 
of 2022.  Source:  https://www.usno.navy.mil/USNO/time/master-clock

I'll look for an alternative time source that is currently online.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue45959] Teach pprint about dict views

2021-12-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

More accurate to say that it aspires to print in a single line ONLY if the 
content fits in the specified width.  Otherwise, it prints vertically with 
appropriate indentation.  Indeed, that is the entire purpose of the module; 
otherwise, we would just use print() which always writes one line.

--

___
Python tracker 

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



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

Please let me know if you are able to reproduce this issue.

--

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Christian Heimes


Christian Heimes  added the comment:

time.mktime() is a thin wrapper around the libc function mktime(3). I can 
confirm that glibc's mktime() on Debian 11 with glibc 2.31 is failing and 
returning error code -1. Fedora 35 with glibc 2.34, Alpine with musl libc 
1.2.2, and RHEL 8 with glibc 2.28 are working fine.

This suggests that it is not a bug in Python, but Debian-specific platform 
issue. Could you please open a bug with Debian and Ubuntu?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-15 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue46091] IndendationError from multi-line indented statements

2021-12-15 Thread Jeremy


New submission from Jeremy :

At some point in 3.9 Python appears to have stopped accepting source that 
starts with an indent, then a '\', then the indented statement. From the 
lexical analysis [1] "Indentation cannot be split over multiple physical lines 
using backslashes; the whitespace up to the first backslash determines the 
indentation."

Running the attached program under 3.8.12 I get:
```
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
```

But running under 3.10.0 I get:
```
  File "/Users/jeremyp/tmp/nodent.py", line 3
"""Print a Fibonacci series up to n."""
^
IndentationError: expected an indented block after function definition on line 1
```

Running under 3.9.9 also gives an IndentationError, both with and without -X 
oldparser. So this doesn't seem directly related to the new parser, but seems 
likely it is fall out from the general grammar restructuring.

IMHO it isn't a particularly nice feature for the language to have. Especially 
since not all lines like '\' behave the same. But it was there and 
documented for many years, so should probably be put back. Does a core 
developer agree? That the implementation is not following the spec?

[1]: https://docs.python.org/3/reference/lexical_analysis.html#indentation

--
components: Parser
files: nodent.py
messages: 408651
nosy: lys.nikolaou, pablogsal, ucodery
priority: normal
severity: normal
status: open
title: IndendationError from multi-line indented statements
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50496/nodent.py

___
Python tracker 

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



[issue46089] Problems with AF_PACKET sockets

2021-12-15 Thread G. Allard


G. Allard  added the comment:

Next 3 steps must be (in decreasing priorities):
- fix the code
- write a mini-howto. It will be used for test purposes
- write documentation (a Howto/tutorial)

For the 3rd step, I would accept to join a team.

--

___
Python tracker 

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



[issue46092] Fix/update missing parameters in function signatures for Built-in Functions documentation.

2021-12-15 Thread Vivek Vashist


New submission from Vivek Vashist :

Previous issue:

https://github.com/python/cpython/pull/30113#issuecomment-994642493

As noted/pointed by Alex - I went through all the Built-in Functions and 
updated/fixed the missing parameters.

I'll raise a PR shortly.

--
assignee: docs@python
components: Documentation
messages: 408653
nosy: docs@python, vivekvashist
priority: normal
severity: normal
status: open
title: Fix/update missing parameters in function signatures for Built-in 
Functions documentation.
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



[issue46091] IndendationError from multi-line indented statements

2021-12-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is a side effect on the fix in:

https://bugs.python.org/issue40847

--

___
Python tracker 

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



[issue46092] Fix/update missing parameters in function signatures for Built-in Functions documentation.

2021-12-15 Thread Vivek Vashist


Change by Vivek Vashist :


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

___
Python tracker 

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



[issue46092] Fix/update missing parameters in function signatures for Built-in Functions documentation.

2021-12-15 Thread Vivek Vashist


Vivek Vashist  added the comment:

PR: https://github.com/python/cpython/pull/30128

--

___
Python tracker 

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



  1   2   >