[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Nikita Sobolev


New submission from Nikita Sobolev :

After reviewing https://github.com/python/cpython/pull/30777 I had a chance to 
look through other definitions of `def __class_getitem__`. And I found that the 
only one left is: `pathlib.PurePath.__class_getitem__`

All other definitions already have this form: `__class_getitem__ = 
classmethod(GenericAlias)`.

I don't think that there's anything special about `PurePath` in this regard. 
So, I propose to make `__class_getitem__` to return `GenericAlias` as all other 
types do.

Initial PR: https://github.com/python/cpython/pull/17498

PR is on its way.

--
components: Library (Lib)
messages: 411354
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`
type: behavior
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



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46456] Add mime type "image/avif"

2022-01-23 Thread jiahua wang


Change by jiahua wang :


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

___
Python tracker 

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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Kumar Aditya


Kumar Aditya  added the comment:

Clearing co_quickened is easy, but it would requires changes to the build 
system to change the build order on Windows and bootstrap interpreter on 
Windows. I manually edited the Windows project files but it requires generating 
deepfreeze.c before hand. It cleared around ~60 memory blocks on Windows.

See branch https://github.com/kumaraditya303/cpython/commits/fix-code

--

___
Python tracker 

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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Kumar Aditya


Kumar Aditya  added the comment:

bootstrap interpreter on Windows => bootstrap interpreter on Unix

--

___
Python tracker 

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



[issue29882] Add an efficient popcount method for integers

2022-01-23 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 83a0ef2162aa379071e243f1b696aa6814edcd2a by Mark Dickinson in 
branch 'main':
bpo-29882: Fix portability bug introduced in GH-30774 (#30794)
https://github.com/python/cpython/commit/83a0ef2162aa379071e243f1b696aa6814edcd2a


--

___
Python tracker 

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



[issue46406] optimize int division

2022-01-23 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset c7f20f1cc8c20654e5d539552604362feb9b0512 by Gregory P. Smith in 
branch 'main':
bpo-46406: Faster single digit int division. (#30626)
https://github.com/python/cpython/commit/c7f20f1cc8c20654e5d539552604362feb9b0512


--

___
Python tracker 

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



[issue46406] optimize int division

2022-01-23 Thread Mark Dickinson


Change by Mark Dickinson :


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



[issue21861] io class name are hardcoded in reprs

2022-01-23 Thread AN Long


Change by AN Long :


--
nosy: +asaka
nosy_count: 11.0 -> 12.0
pull_requests: +29011
pull_request: https://github.com/python/cpython/pull/30824

___
Python tracker 

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



[issue46484] Add test for Calendar().iterweekdays()

2022-01-23 Thread jiahua wang

New submission from jiahua wang :

Apparently there is no test for Calendar().iterweekdays().

wangdeMacBook-Pro :: ~/cpython » grep -R iterweekdays Lib/test/ *
Binary file Lib/test//__pycache__/test_calendar.cpython-311.pyc matches
Doc/library/calendar.rst:   .. method:: iterweekdays()
Binary file Lib/test/__pycache__/test_calendar.cpython-311.pyc matches
Binary file Lib/__pycache__/calendar.cpython-311.pyc matches
Lib/calendar.py:def iterweekdays(self):
Lib/calendar.py:return ' '.join(self.formatweekday(i, width) for i in 
self.iterweekdays())
Lib/calendar.py:s = ''.join(self.formatweekday(i) for i in 
self.iterweekdays())

--
components: Tests
messages: 411359
nosy: wangjiahua
priority: normal
severity: normal
status: open
title: Add test for Calendar().iterweekdays()
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



[issue46484] Add test for Calendar().iterweekdays()

2022-01-23 Thread jiahua wang


Change by jiahua wang :


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

___
Python tracker 

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



[issue46485] ~ PEG operator in the grammar

2022-01-23 Thread Robert Einhorn


New submission from Robert Einhorn :

This is probably not an error and I may misinterpret the PEP 617, but I don't 
know what the ~ PEG operator means in the next rule if there is no alternative:
assignment_expression:
| NAME ':=' ~ expression


And similarly with this rule if there is no more alternative:
assignment:
| NAME ':' expression ['=' annotated_rhs ] 
| ('(' single_target ')' 
 | single_subscript_attribute_target) ':' expression ['=' annotated_rhs 
] 
| (star_targets '=' )+ (yield_expr | star_expressions) !'=' [TYPE_COMMENT] 
| single_target augassign ~ (yield_expr | star_expressions)

Related links:
https://docs.python.org/3/reference/grammar.html
https://www.python.org/dev/peps/pep-0617/#id9

--
components: Parser
messages: 411360
nosy: RobEin, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: ~ PEG operator in the grammar
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



[issue46485] ~ PEG operator in the grammar

2022-01-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

It means the same as if there is alternatives: if it fails to parse then it 
will immediately fail. We place them in rules like this in preparation for 
extension or in case there are invalid_* rules in the same set (which doesn't 
appear in the grammar definition).

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



[issue46485] ~ PEG operator in the grammar

2022-01-23 Thread Robert Einhorn


Robert Einhorn  added the comment:

Thanks

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue46376] PyMapping_Check returns 1 for list

2022-01-23 Thread Aviram


Aviram  added the comment:

I sent it to sig-capi - 
https://mail.python.org/archives/list/capi-...@python.org/thread/T6DHEKHKKZIYU2GEPGHUQJ3DHTJXZGWW/

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Ken Jin  added the comment:

Thanks @Victor for catching this and figuring it out. I had a hard time 
narrowing this down since I'm on Windows which doesn't support signals :(.

I'll handle the required patch and tests.

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +29014
pull_request: https://github.com/python/cpython/pull/30827

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +29015
pull_request: https://github.com/python/cpython/pull/30828

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +29016
pull_request: https://github.com/python/cpython/pull/30829

___
Python tracker 

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



[issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c

2022-01-23 Thread Kumar Aditya


New submission from Kumar Aditya :

Rename DesciptorClassification => DescriptorClassification in specialize.c as 
DesciptorClassification has a typo.

--
messages: 411365
nosy: Mark.Shannon, kj, kumaraditya303
priority: normal
severity: normal
status: open
title: Rename DesciptorClassification => DescriptorClassification in 
specialize.c
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



[issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c

2022-01-23 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Ken Jin  added the comment:

A short summary (thanks to Victor's findings!):

- os.kill(pid, signal.SIGINT) is specialized to CALL_NO_KW_FAST
- CALL_NO_KW_FAST doesn't check eval breaker, so the signal is ignored
- signal handler wasn't called, test fails

I'd like to add tests for some of the other CALL_X in the future, but I'm a 
little short on time at the moment, sorry! For now, I've tried to turn some of 
the tests "hot" to see if I can get those to trigger.

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Mark Shannon


Mark Shannon  added the comment:

Is this a bug?

Signal handling in Python is asynchronous. 
https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers

The example code tests whether the interpreter responds synchronously and 
immediately.

If you add `for _in range(1): pass` or a call to any Python function in between 
the `os.kill(pid, SIGNUM)` and the `if not self.called:` then the test passes.

--

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

The automated backport to Python 3.9 failed. Miro asked me to close the PR:
https://github.com/python/cpython/pull/29964

Can someone backport the fix to 3.9? (create a PR)

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

> Is this a bug?

In Python 3.10, the code works. In Python 3.11, it fails.

It's a behavior change. IMO this change is unwanted. I expect that signals are 
handled "as soon as possible", *especially* if we receive it "during" an 
os.kill() call on the current process on purpose.

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

It's also interesting to note that the implementation of os.kill() and 
signal.raise_signal() do *not* call PyErr_CheckSignal().

The following signal functions *do* call call PyErr_CheckSignal():

* signal.signal()
* signal.pause()
* signal.pthread_kill()
* signal.pthread_sigmask()

Some other signal functions call PyErr_CheckSignal() if a syscall fails with 
EINTR (PEP 475).

--

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

> Signal handling in Python is asynchronous. 
> https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers

See my previous comment: "CHECK_EVAL_BREAKER() matters for signals, but also 
multithreading (drop the GIL), asynchronous exception and pending calls."

If a thread executes a function which only uses opcodes which don't call 
CHECK_EVAL_BREAKER(), I understand that it can eat more than its slice of 5 ms, 
see sys.getswitchinterval():
https://docs.python.org/dev/library/sys.html#sys.getswitchinterval

So it's also a threads scheduling issue, no?

--

___
Python tracker 

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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

> See branch https://github.com/kumaraditya303/cpython/commits/fix-code

Oh nice, I like this new _Py_Deepfreeze_Fini() function :-) I suggest to create 
a function specific to only clear immortal code objects. In my experience, it's 
important to control exactly when objects are cleared at Python exit: 
Py_Finalize() is complex and fragile. See my notes:
https://pythondev.readthedocs.io/finalization.html

Be careful, Python must remain usable after Py_Finalize(): it's legit to call 
Py_Initialize() again and execute new Python code. Example executing the same 
code 4 times, each time Py_Initialize() and Py_Finalize() are called:

./Programs/_testembed test_repeated_init_exec 'print("Hello")'

My _PyStaticMethod_Dealloc() implementation uses Py_CLEAR() rather than 
Py_XDECREF() to set structure members to NULL.

Moreover, there are more things than just co_quickened which should be cleared. 
I suggest to add a new function to clear an "immortal" code object. For 
example, I also suggest to call PyObject_ClearWeakRefs(). I guess that co_extra 
should also be cleared.

--

___
Python tracker 

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



[issue46485] ~ PEG operator in the grammar

2022-01-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 1f715d5bd3bc9ff444e109b6bbd13011913681b1 by Nikita Sobolev in 
branch 'main':
bpo-46483: change `PurePath.__class_getitem__` to return `GenericAlias` 
(GH-30822)
https://github.com/python/cpython/commit/1f715d5bd3bc9ff444e109b6bbd13011913681b1


--
nosy: +BTaskaya

___
Python tracker 

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



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Why __class_getitem__ was added in PurePath at first place? PurePath should not 
be a generic class, unlike to os.PathLike. For os.PathLike the type parameters 
represent the returning type of os.fspath() (either str or bytes), but the 
pathlib module only supports paths as strings, so no parametrization is needed.

I think PurePath.__class_getitem__ should be removed.

--
nosy: +gvanrossum, kj, serhiy.storchaka

___
Python tracker 

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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Kumar Aditya


Kumar Aditya  added the comment:

FYI, I updated the build files and got it working on Windows and clears around 
~60 memory blocks. See the latest commit in branch.

--

___
Python tracker 

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



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Alex Waygood


Alex Waygood  added the comment:

It looks like __class_getitem__ was added to PurePath at @asvetlov's request  
in PR 17498. But, I'm also not quite sure why. The class is not generic in 
typeshed, so type-checkers will raise an error if you do PurePath[str], even if 
it is possible to do so at runtime.

Typeshed stub for PurePath: 
https://github.com/python/typeshed/blob/dff461fc6adef1ec3a4b58af5abdf0cdebf2429a/stdlib/pathlib.pyi#L20

--
nosy: +AlexWaygood, asvetlov

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset a7a4ca4f06c8c31d7f403113702ad2e80bfc326b by Jason R. Coombs in 
branch '3.10':
[3.10] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with 
importlib_metadata 4.10.1) (GH-30803) (GH-30827)
https://github.com/python/cpython/commit/a7a4ca4f06c8c31d7f403113702ad2e80bfc326b


--

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 1514d1252f96e6a83eb65c439522a6b5443f6a1a by Jason R. Coombs in 
branch '3.9':
[3.9] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with 
importlib_metadata 4.10.1) (GH-30803). (GH-30828)
https://github.com/python/cpython/commit/1514d1252f96e6a83eb65c439522a6b5443f6a1a


--

___
Python tracker 

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



[issue46474] Inefficient regular expression complexity in EntryPoint.pattern

2022-01-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue46481] Implement vectorcall protocol for weakref_call()

2022-01-23 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 76dc047a0e88d10aad0405228d56e94438cdd91c by Dong-hee Na in branch 
'main':
bpo-46481: Implement vectorcall for weakref.ref.__call__ method. (GH-30820)
https://github.com/python/cpython/commit/76dc047a0e88d10aad0405228d56e94438cdd91c


--

___
Python tracker 

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



[issue46481] Implement vectorcall protocol for weakref_call()

2022-01-23 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Kumar Aditya


Kumar Aditya  added the comment:

> Be careful, Python must remain usable after Py_Finalize(): it's legit to call 
> Py_Initialize() again and execute new Python code. Example executing the same 
> code 4 times, each time Py_Initialize() and Py_Finalize() are called:

./Programs/_testembed test_repeated_init_exec 'print("Hello")'

With the current design, it isn't possible though because the code objects are 
modified in place so if co_quickened is freed the VM still tries to execute the 
copied instructions.

See 
https://github.com/python/cpython/blob/76dc047a0e88d10aad0405228d56e94438cdd91c/Python/specialize.c#L425

--

___
Python tracker 

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



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread STINNER Victor


STINNER Victor  added the comment:

Aha. Maybe for now, the memory of immortal code objects can be deallocated in 
pymain_free(). It's the last function called before Python exit the process.

--

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` implementation.

2022-01-23 Thread Nova


New submission from Nova :

When calling `get_write_buffer_limits` on a SSL transport the following 
exception is raised:

```py
Traceback (most recent call last):
  File "/home/mooncell/works/test.py", line 26, in 
asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in 
run_until_complete
return future.result()
  File "/home/mooncell/works/test.py", line 24, in main
print(transport.get_write_buffer_limits())
  File "/usr/lib/python3.10/asyncio/transports.py", line 306, in 
get_write_buffer_limits
return (self._low_water, self._high_water)
AttributeError: '_SSLProtocolTransport' object has no attribute '_low_water'. 
Did you mean: '_high_water'?
```

We looked into the implementation and found out that `_SSLProtocolTransport` 
didn't override the `_FlowControlMixin.get_write_buffer_limits`.

--
components: asyncio
messages: 411382
nosy: asvetlov, mooncell07, yselivanov
priority: normal
severity: normal
status: open
title: `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` 
implementation.
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue46473] importlib.metadata does not honor .egg-link files

2022-01-23 Thread Ben


Ben  added the comment:

https://github.com/python/importlib_metadata/issues/364

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

___
Python tracker 

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



[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Barry Schwartz


New submission from Barry Schwartz :

The Objects/listsort.txt incorrectly implies that it is not possible to compute 
leading zero bits in O(1) time, using only standard C. For a fixed integer size 
it can be done, for instance, using de Bruijn sequences. See 
https://www.chessprogramming.org/BitScan

(The existence of such methods is not as widely known as it ought to be.)

--
assignee: docs@python
components: Documentation
messages: 411384
nosy: chemoelectric, docs@python
priority: normal
severity: normal
status: open
title: listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) 
time.
type: performance
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



[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +tim.peters

___
Python tracker 

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



[issue46440] ArgumentParser.parse_args exits on missing required argument with exit_on_error=False

2022-01-23 Thread Jacob Walls


Change by Jacob Walls :


--
keywords: +patch
nosy: +jacobtylerwalls
nosy_count: 1.0 -> 2.0
pull_requests: +29018
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30832

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-23 Thread Nova


Change by Nova :


--
title: `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` 
implementation. -> `_SSLProtocolTransport` doesn't have the 
`get_write_buffer_limits` implementation.

___
Python tracker 

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



[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Thank you for clarifying. I can reproduce this on 3.11.

--
resolution: out of date -> 
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

___
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

2022-01-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm wondering if the test is faulty. It seems to call EventLoop.sendfile() with 
a file that is 8K + 1 byte long,
and the protocol is instructed to close after 1K bytes have been written, but 
it seems to try to send as much of the file as it can.
Could it be that on Win22 the primitive used (TransmitFile) has an internal 
minimum buffer size that exceeds this file size, so the first call sends the 
whole file and there's no error?

@Andrew Svetlov, do you know enough of the internals of this code to validate 
my theory?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue46376] PyMapping_Check returns 1 for list

2022-01-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is difficult to distinguish Mapping from Sequence because they have the same 
set of dunder methods. The difference is only in semantic -- __iter__ yields 
items for Sequence and keys for Mapping, __getitem__ gets an item by index (or 
a sequence by slice) for Sequence and value by key for Mapping. But semantic 
cannot be tested here.

In these cases when both Sequence and Mapping are accepted but handled 
differently (like in the dict constructor) we test for existence of the "keys" 
method. It is not good, because it is not a dunder method, and therefore should 
be looked up at instance, not only at a type.

--

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-23 Thread Alex Grund


Alex Grund  added the comment:

Yes this is still an issue.

I'm trying to compile Python on an HPC system which uses modules (see e.g. 
LMod).

Yes with LC_ALL=C it does write "gcc version 9.1.0 ..."

--
status: pending -> open

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 6.0 -> 7.0
pull_requests: +29019
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30833

___
Python tracker 

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



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2022-01-23 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 691506f4e9408a1205166f99640946ad7822e302 by Weipeng Hong in 
branch 'main':
bpo-46103: Fix inspect.getmembers to only get __bases__ from class (GH-30147)
https://github.com/python/cpython/commit/691506f4e9408a1205166f99640946ad7822e302


--

___
Python tracker 

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



[issue46471] use global singletons for single byte bytes objects in deepfreeze

2022-01-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset ca78130d7eb5265759697639e42487ec6d0a4caf by Kumar Aditya in 
branch 'main':
bpo-46471: Use single byte singletons (GH-30781)
https://github.com/python/cpython/commit/ca78130d7eb5265759697639e42487ec6d0a4caf


--

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution: out of date -> 
versions:  -Python 2.7, Python 3.5, 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



[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2022-01-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 94d6434ba7ec3e4b154e515c5583b0b665ab0b09 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash 
(GH-30283) (GH-30738)
https://github.com/python/cpython/commit/94d6434ba7ec3e4b154e515c5583b0b665ab0b09


--

___
Python tracker 

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



[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2022-01-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue46285] protocol_version in http.server.test can be ignored

2022-01-23 Thread Géry

Géry  added the comment:

Thanks Hugo for opening this issue and Éric for inviting me.

As you guys pointed out, function test in module http.server expects a real 
handler class argument (SimpleHTTPRequestHandler or CGIHTTPRequestHandler), not 
a partial object partial(SimpleHTTPRequestHandler, directory=args.directory) or 
partial(CGIHTTPRequestHandler, directory=args.directory), so that the 
assignment of protocol_version class attribute in test is not ignored.

The partial object in the if __name__ == '__main__' branch of module 
http.server was introduced in the first place to pass the directory argument to 
the handler class’s __init__ method called in method BaseServer.finish_request:

def finish_request(self, request, client_address):
"""Finish one request by instantiating RequestHandlerClass."""
self.RequestHandlerClass(request, client_address, self)

But finish_request is a factory method of BaseServer (the abstract creator) so 
it is DESIGNED to be overridden in subclasses to customize the instantiation of 
the handler class BaseRequestHandler (the abstract product). So the proper way 
to instantiate SimpleHTTPRequestHandler and CGIHTTPRequestHandler with the 
directory argument is to override BaseServer.finish_request.

That is what I have just did by updating my PR here: 
https://github.com/python/cpython/pull/30701/commits/fc7f95f9d270a8a83cb2fd6d51eb0f904b85e0d9

It fixes both #46285 and #46436.

--

___
Python tracker 

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



[issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler

2022-01-23 Thread Géry

Géry  added the comment:

Thanks for mentioning this issue @merwok.

As you pointed out, function `test` in module 
[`http.server`](https://github.com/python/cpython/blob/main/Lib/http/server.py) 
expects a real request handler class argument (`SimpleHTTPRequestHandler` or 
`CGIHTTPRequestHandler`), not a partial object 
`partial(SimpleHTTPRequestHandler, directory=args.directory)` or 
`partial(CGIHTTPRequestHandler, directory=args.directory)`, so that the 
assignment of `protocol_version` class attribute in test is not ignored.

The partial object in the `if __name__ == '__main__'` branch of module 
`http.server` was introduced in the first place to pass the directory argument 
to the request handler class’s `__init__` method called in method 
`BaseServer.finish_request` of module 
[`socketserver`](https://github.com/python/cpython/blob/main/Lib/socketserver.py):

def finish_request(self, request, client_address):
"""Finish one request by instantiating RequestHandlerClass."""
self.RequestHandlerClass(request, client_address, self)

But `BaseServer.finish_request` is a factory method of `BaseServer` (the 
abstract creator) so it is *designed* to be overridden in subclasses to 
customize the instantiation of the request handler class `BaseRequestHandler` 
(the abstract product). So the proper way to instantiate 
`SimpleHTTPRequestHandler` and `CGIHTTPRequestHandler` with the `directory` 
argument is to override `BaseServer.finish_request`.

I have just updated my PR to implement this. It fixes both 
[#46285](https://bugs.python.org/issue46285) and 
[#46436](https://bugs.python.org/issue46436).

--

___
Python tracker 

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



[issue30510] c_bool type not supported for BigEndianStructure on little-endian machine

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11:

>>> from ctypes import *
>>> class r( BigEndianStructure ):
... _fields_ = [( "d0", c_uint32),
... ( "d1", c_bool )
...  ]
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 31, in 
__setattr__
fields.append((name, _other_endian(typ)) + rest)
 ^^
  File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 21, in 
_other_endian
raise TypeError("This type does not support other endian: %s" % typ)

TypeError: This type does not support other endian: 

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7

___
Python tracker 

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



[issue24046] Incomplete build on AIX

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

2.7 is no longer maintained. Please create new issues for build problems on 
current versions (>= 3.9).

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



[issue46489] webbrowser crashes Ubuntu kernel

2022-01-23 Thread Danylo


New submission from Danylo :

I've been hunting this problem for half a year already. With other hypotheses 
rejected - Linux issue, old PC, PyCharm bug, bad luck, - the webbrowser Python 
lib supposedly makes the Ubuntu kernel panic.

Either from a terminal or within PyCharm (happens on both), I run

```
controller = webbrowser.get('google-chrome')
for link in links_list:  # up to 10 items
controller.open(link)
time.sleep(1)
```

and the system crashes (hangs until a hard or soft reset) after several web 
pages are opened in my Chrome browser as the result of running the program.

All the details you'll find at 
https://askubuntu.com/questions/1370213/ubuntu-hangs-and-becomes-unresponsive-until-reset.
 I first thought it's something wrong with Ubuntu, and I opened a question on 
the forum.

The only detail I've not added there is that after each crash I can move the 
mouse on the screen but cannot interact with anything. That thing always 
puzzled me.

I can neither say the website I'm running the webbrowser nor test it on other 
domains - the issue happens sporadically, once in several hours of me opening 
and closing a Chrome browser controlled by the webbrowser lib.

Python 3.9.7, installed with Anaconda. I've tried older versions of Python.

Ubuntu 20.04 LTS.

--
components: Library (Lib)
messages: 411396
nosy: dizcza
priority: normal
severity: normal
status: open
title: webbrowser crashes Ubuntu kernel
type: crash
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



[issue27954] makesetup does not take into account subdirectories

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

David, is this still an issue on current versions? Can you spell out the 
precise steps to reproduce the problem?

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

___
Python tracker 

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



[issue46471] use global singletons for single byte bytes objects in deepfreeze

2022-01-23 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Can we close this, or are you expecting more changes?

--
nosy: +erlendaasland
status: open -> pending

___
Python tracker 

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



[issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows

2022-01-23 Thread Delgan


New submission from Delgan :

Hi.

Currently, trying to use "os.utime(path, timestamps, follow_symlinks=False)" 
raises a exception on Windows: "NotImplementedError: utime: follow_symlinks 
unavailable on this platform".

Looking at the Win32 API it seems possible to open a symbolic link by 
specifying the "FILE_FLAG_OPEN_REPARSE_POINT" flag: 
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#symbolic-link-behavior

Do you think it would be possible to update "os.utime()" implementation and 
optionally pass the flag here: 
https://github.com/python/cpython/blob/ca78130d7eb5265759697639e42487ec6d0a4caf/Modules/posixmodule.c#L5516
 ?

--
components: Library (Lib)
messages: 411399
nosy: Delgan
priority: normal
severity: normal
status: open
title: Add "follow_symlinks=False" support for "os.utime()" on Windows
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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418 by Irit Katriel in 
branch 'main':
bpo-41403: Improve error message for invalid mock target (GH-30833)
https://github.com/python/cpython/commit/f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418


--

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +29020
pull_request: https://github.com/python/cpython/pull/30834

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +29021
pull_request: https://github.com/python/cpython/pull/30835

___
Python tracker 

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



[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-23 Thread Christian Heimes


Christian Heimes  added the comment:

If you modify the freeze_modules script to generate code like 
https://github.com/python/cpython/compare/main...tiran:split_frozen?expand=1 , 
then I can add a build option to compile Python with only required frozen 
modules.

--

___
Python tracker 

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



[issue37886] PyStructSequence_UnnamedField not exported

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> PyStructSequence_UnnamedField unavailable on Windows

___
Python tracker 

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



[issue39731] ModuleNotFoundError: No module named '_ctypes'

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> third party
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



[issue39708] final link stage in compile fails for 3.8.1 with missing CFLAGS

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Version 3.8 is no longer maintained. Please create a new issue if you are 
having this problem on a current version (>= 3.9).

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



[issue41603] Compilation issue 3.8.5 with Redhat 7.8 and gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Please create a new issue if you are seeing this problem on a supported version 
(>= 3.9).

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



[issue46491] typing: allow Annotated in outermost scope

2022-01-23 Thread Gregory Beauregard


New submission from Gregory Beauregard :

Currently, `typing.Annotated` (PEP 593) cannot be used at runtime with 
`typing.Final` and `typing.ClassVar` with `Annotated` on the outside:

```
from typing import Annotated, Final
# TypeError: typing.Final[int] is not valid as type argument
var: Annotated[Final[int], "foo"] = 4
```

The only tenuously related mention of this I can find in a PEP is in PEP 593 
(Annotated) which states "The first argument to Annotated must be a valid type".

I believe the runtime behavior should be changed to allow any ordering for 
`Annotated` with `ClassVar` and `Final`. This was discussed in the typing-sig 
PEP 655 thread (TypedDict `Required` and `NotRequired`) where the current plan 
is to allow `Required`/`NotRequired` in any nesting order with `Annotated` 
while suggesting the `ClassVar`/`Final` ordering restriction be lifted: 
https://mail.python.org/archives/list/typing-...@python.org/message/22CJ5TJGIJ563D6ZKB7R3VUZXTZQND5X/

The argument for doing so is on the mailing list: 
https://mail.python.org/archives/list/typing-...@python.org/message/MPMOIBX3XFXCD4ZNDC6AV4CLSI5LN544/

To summarize: adopting an overly strict view of what constitutes a valid type 
for `Annotated` creates difficulties for people who use runtime introspection 
of `Annotated` annotations by requiring them to parse additional typing or 
field annotations (https://bugs.python.org/msg411067). This needlessly 
exacerbates tension between typing and non-typing uses of annotation space. In 
order to be a good citizen to other annotation users, the `Annotated` runtime 
ordering restriction should be lifted.

--
messages: 411404
nosy: GBeauregard
priority: normal
severity: normal
status: open
title: typing: allow Annotated in outermost scope
type: behavior
versions: Python 3.10, 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



[issue46491] typing: allow Annotated in outermost scope

2022-01-23 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I support making this change. It looks like the simplest implementation is 
simply to remove the mention of ClassVar and Final in typing._type_check.

--
components: +Library (Lib)
nosy: +Jelle Zijlstra, gvanrossum, kj

___
Python tracker 

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



[issue37080] Cannot compile Python3.7.3 on Alt-F (ARM)

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

3.7 is no longer maintained. Please create a new issue if you are having this 
problem with a current version (>= 3.9).

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



[issue30053] Problems building with --enable-profiling on macOS using homebrew GCC

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

3.7 is no longer maintained. Please create a new issue if you are having this 
problem with a current version (>= 3.9).

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



[issue40250] unable to comment out r'\u' string with triple quote marks

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


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



[issue32343] Leak Sanitizer reports memory leaks while building using ASAN

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.7 is not longer maintained, so it is unlikely that anyone will look at 
these. Please create a new issue if you are seeing this problem on a current 
version.

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



[issue22211] Remove VMS specific code in expat.h & xmlrole.h

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> third party
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



[issue46435] MessageID parser raises IndexError: string index out of range

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
title: MessageID parser can crash with IndexError: string index out of range -> 
MessageID parser raises IndexError: string index out of range
type: crash -> behavior
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



[issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c

2022-01-23 Thread Christian Heimes


Christian Heimes  added the comment:

Yes, it's fixed.

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

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset e3ade66ec575e0cb4882cfdff155ef962e67c837 by Irit Katriel in 
branch '3.10':
bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30834)
https://github.com/python/cpython/commit/e3ade66ec575e0cb4882cfdff155ef962e67c837


--

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 1398dca838529e682c06b496cc1911d91334ff3a by Irit Katriel in 
branch '3.9':
bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30835)
https://github.com/python/cpython/commit/1398dca838529e682c06b496cc1911d91334ff3a


--

___
Python tracker 

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



[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 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



[issue45298] SIGSEGV when access a fork Event in a spawn Process

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

Which python version and system are you seeing this on?

On 3.11 on a Mac I don't get a segfault but rather 

Process SpawnProcess-1:
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 
315, in _bootstrap
self.run()
^^
  File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 
108, in run
self._target(*self._args, **self._kwargs)
^
  File "/Users/iritkatriel/src/cpython/tt.py", line 6, in wait_for_event
while not event.is_set():
  ^^
  File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", 
line 328, in is_set
with self._cond:

  File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", 
line 230, in __enter__
return self._lock.__enter__()
   ^^
  File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", 
line 95, in __enter__
return self._semlock.__enter__()
   ^
OSError: [Errno 9] Bad file descriptor


--
nosy: +iritkatriel

___
Python tracker 

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



[issue38039] Segfault when pickling dictionary with large pandas dataframes

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> third party
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



[issue46492] BrokenPipeError when piping to head (linux)

2022-01-23 Thread Roy Assis


New submission from Roy Assis :

problem:
---
Python raises exception when piping to head. Exception is not caught by try 
except.

code:

#sample.py
import sys
from time import sleep

try:
for line in sys.stdin:
print(line, flush=True)
sleep(2)
except:
print("a")

Environment:
--
# Python 3.8.12 (default, Oct 12 2021, 13:49:34)
# [GCC 7.5.0] :: Anaconda, Inc. on linux
# (scanpyEnv3.8) aaa@IP111-11-1-111:~/scripts/short-python-scripts$ uname -srm
# Linux 5.4.0-1063-aws x86_64

code execution
--
# (scanpyEnv3.8) aaa@IP111-11-1-111:~/scripts/short-python-scripts$ echo "a a a 
a" | sed s'/ /\n/g' | python ./sample.py | head -3
# a
#
# a
# Exception ignored in: <_io.TextIOWrapper name='' mode='w' 
encoding='utf-8'>
# BrokenPipeError: [Errno 32] Broken pipe

--
components: IO
messages: 411413
nosy: royroy
priority: normal
severity: normal
status: open
title: BrokenPipeError when piping to head (linux)
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue42543] case sensitivity in open() arguments

2022-01-23 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



[issue34697] ctypes: Crash if manually-created CField instance is used

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, 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



[issue45868] xattr support missing in os module under cygwin

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

This is listed in the docs as a linux-only feature:

https://docs.python.org/3/library/os.html#linux-extended-attributes

--
nosy: +iritkatriel
resolution:  -> not a bug
status: open -> pending
type: crash -> behavior

___
Python tracker 

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



[issue37773] ValueError: I/O operation on closed file. in ZipFile destructor

2022-01-23 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue45868] xattr support missing in os module under cygwin

2022-01-23 Thread Oskar Enoksson


Oskar Enoksson  added the comment:

Perhaps it could be supported under cygwin though without too much effort? Most 
likely just a configuration fix?

After all, cygwin is a sort of linux ...

--
status: pending -> open

___
Python tracker 

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



[issue46492] BrokenPipeError when piping to head (linux)

2022-01-23 Thread Roy Assis


Roy Assis  added the comment:

Resolution in this post:
https://stackoverflow.com/questions/26692284/how-to-prevent-brokenpipeerror-when-doing-a-flush-in-python/26738736

code was changed to:

#sample.py
import sys
from time import sleep

try:
for line in sys.stdin:
print(line, flush=True)
sleep(2)
except:
sys.stderr.close()
pass

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



[issue45868] xattr support missing in os module under cygwin

2022-01-23 Thread Irit Katriel


Irit Katriel  added the comment:

There isn't currently a maintainer for cpython on cygwin. If someone volunteers 
for this, they can go through the issues listed at the bottom of issue45537.

--
resolution: not a bug -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Cygwin is unsupported - close all open issues and list them 
here.

___
Python tracker 

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



[issue46491] typing: allow Annotated in outermost scope

2022-01-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

+1--
--Guido (mobile)

--

___
Python tracker 

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



[issue46457] test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500)

2022-01-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
assignee:  -> asvetlov

___
Python tracker 

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



[issue46479] Implement typing.reveal_locals

2022-01-23 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Kumar do you want to tackle this?

--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46471] use global singletons for single byte bytes objects in deepfreeze

2022-01-23 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> 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



  1   2   >