[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

x does not change.
sorry. I also haven't figured out the implementation in my head yet.

I want to provide some functionality to provide consistent indentation while 
using formatting .

For example

"""
test
{multi_line_text}
""".format(multi_line_text, consistent_indent=True)

It's just a suggestion.

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith

Eric V. Smith  added the comment:

I’m sorry, I don’t understand your proposal. Please answer my question about 
what “x” would be equal to under your proposed change.

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

Sorry, Can't edit comments
Please see the code example below

```
Class A:
def get_something_string():
return textwrap.dedent("""\
test text2
test text3
test text4""")


textwrap.dedent(f"""\
test text1
{A.get_something_string()}
test text5
test text6""")
```

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

No, I know `textwrap.dedent` as a convenience function used for code 
readability. But to have the result I want, I currently need to do something 
like this:
If it's a method inside a class, it's even more ugly.

Class A:
 def get_something_string():
 return textwrap.dedent("""\
 test text2
 test text3
 test text4""")

x = f"""\
  test text1
  {A.get_something_string()}
  test text5
  test text6"""

The duplicate use of dedent is to show an example.

Thought I needed a consistent dedent for every line while using the string 
formatting feature.

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would x be equal to here:

def get_something_string():
 return textwrap.dedent("""\
 test text2
 test text3
 test text4""")

x = f"""\
 test text1
 {get_something_string()}
 test text5
 test text6"""

?

With 3.10 it is: ' test text1\n test text2\ntest text3\ntest text4\n
 test text5\n test text6'

Are you proposing to change that?

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

"<<" This marks that line. ignore it

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would the presence of "<<" do? You haven't described your proposal.

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

If it's only for version 3.11, what do you think of the default behavior of the 
dedent method being changed?
The method description says:

> Remove any common leading whitespace from every line in `text`.

```
def get_something_string():
 return textwrap.dedent("""\
 test text2
 test text3
 test text4""")

textwrap.dedent(f"""\
 test text1
 {get_something_string()} <<
 test text5
 test text6""")
```
I think it should work assuming that the indentation of 
{get_something_string()} and the indentation of test text2 are on the same line.

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What is the flag you mention? What would it do?

This sounds like a new feature, which can only go in to 3.11.

--
nosy: +eric.smith

___
Python tracker 

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



[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree it's not worth fixing in 3.9 and 3.10.

--

___
Python tracker 

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



[issue31975] Add a default filter for DeprecationWarning in __main__

2022-03-11 Thread Kevin Locke


Change by Kevin Locke :


--
nosy: +kevinoid
nosy_count: 7.0 -> 8.0
pull_requests: +29931
pull_request: https://github.com/python/cpython/pull/23172

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

김준환  added the comment:

Sorry, it's an indent , not an intent .

--

___
Python tracker 

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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환

New submission from 김준환 :

If use textwrap.dedent with string formatting, may get unintended sentences.

For example, a sentence like this:

```
import textwrap

def get_something_string():
return textwrap.dedent("""\
test text2
test text3
test text4""")

textwrap.dedent(f"""\
test text1
{get_something_string()}
test text5
test text6""")
```

I look forward to the following results.

```
test text1
test text2
test text3
test text4
test text5
test text6
```

But the actual result is:
```
test text1
test text2
test text3
test text4
test text5
test text6
```

I understand that this code works in this way because the intent of the string 
defined inside the method is different from the intent of the string outside 
the method.

However, regular users, like me, will think of having a consistent intent 
result value. (because they believe dedent will clear a consistent intent)

If you are concerned that the existing code will be broken, I can implement 
the function using the flag parameter.

If you agree with my opinion, I will submit a PR.

--
components: Library (Lib)
messages: 414972
nosy: xncbf12
priority: normal
severity: normal
status: open
title: If use textwrap.dedent with string formatting, may get unintended 
sentences.
type: behavior
versions: Python 3.10, Python 3.11, 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



[issue46991] Specialize list[slice]

2022-03-11 Thread Ken Jin


New submission from Ken Jin :

According to 
https://github.com/faster-cpython/ideas/blob/main/stats.md#binary_subscr
it's the second most common failed specialization.

array.array[int] is quite hard to specialize, considering that array.array 
deals with 13 different item types based on its initial type argument. IMO 
specializing for it is only useful to bump benchmark numbers, but we won't see 
any real effects in real-world benchmarks.

--
messages: 414971
nosy: kj
priority: normal
severity: normal
status: open
title: Specialize list[slice]
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



[issue46642] typing: tested TypeVar instance subclass TypeError is incidental

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

This still behaves similarly after the bpo-46642 fix:

>>> class V(TypeVar("T")): pass
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in __init__
self.__constraints__ = tuple(_type_check(t, msg) for t in constraints)
   ^^^
  File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in 
self.__constraints__ = tuple(_type_check(t, msg) for t in constraints)
 ^^^
  File "/Users/jelle/py/cpython/Lib/typing.py", line 189, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
^^^
TypeError: TypeVar(name, constraint, ...): constraints must be types. Got (~T,).

--

___
Python tracker 

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



[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

This is now fixed in main thanks to bpo-46644:

```
>>> get_type_hints(Foo)
{'attr': dataclasses.InitVar[int]}
```

We're not backporting that change to the bugfix branches. If we want to fix 
this issue in 3.10 and 3.9, we'll have to add a `__call__` method to `InitVar`. 
My inclination is that that's not worth it.

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



[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters


Tim Peters  added the comment:

Well, that's annoying ;-) In context, the OP was saving a list of 10 million 
splits. So each overallocation by a single element burned 80 million bytes of 
RAM. Overallocating by 7 burned 560 million bytes.

Which is unusual. Usually a split result is short-lived, consumed once then 
thrown away.

OTOH, the overwhelming motivation for overallocating at all is to acheive O(1) 
amortized time after a long _sequence_ of appends, and split results typically 
aren't appended to at all. split() appears to be using it as a timing 
micro-optimization for tiny lists instead.

So, like I said, it's annoying ;-) For "small" lists, split() really shouldn't 
overallocate at all (because, as before, split results are rarely appended to). 
A compromise could be to save pointers to the first N (12, whatever) instances 
of the splitting string in a stack ("auto") vector, before any list object (or 
result string object) is created. If it's out of stuff to do before reaching N, 
fine, build a result out of exactly what was found. If there's more to do, 
build a result from the first N, and go on as currently (letting PyList_Append 
deal with it - overallocation is huge in percentage terms when the list is 
short, but not so much as the list gets longer).

--

___
Python tracker 

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



[issue2771] Test issue

2022-03-11 Thread admin


Change by admin :


--
github: 1 -> 18614

___
Python tracker 

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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 75174371e6cac935b598a68c1113f6db1e0d6ed8 by Jelle Zijlstra in 
branch 'main':
bpo-46644: Fix test_typing test broken by GH-31151 due to a merge race 
(GH-31833)
https://github.com/python/cpython/commit/75174371e6cac935b598a68c1113f6db1e0d6ed8


--

___
Python tracker 

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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +29930
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/31833

___
Python tracker 

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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Some tests are failing on main, probably due to a race. PR incoming.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

> So where getauxval(AT_MINSIGSTKSZ) < SIGSTKSZ the merged changes actually 
> resulted in decrease of the allocated signal deliver stack. 

faulthandler stack is only used in the least likely case: on a fatal error. It 
should reduce its memory footprint, so it's good that it uses less memory.

To fix bpo-21131, I chose to use SIGSTKSZ * 2 because:

* the fix is trivial: add "* 2"
* it "just works"
* there was no API to query how many bytes Linux uses on the stack

Previously, faulthandler had between 0 and SIGSTKSZ bytes depending on which 
CPU extension was used or not on the process.

If I understood correctly, on Linux 5.14 with the change, faulthandler now 
always has SIGSTKSZ bytes for its own usage, and the other bytes are used by 
the Linux kernel. So it's more reliable for faulthandler, to always have the 
same amount of memory for its personal use.

--

___
Python tracker 

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



[issue46677] TypedDict docs are incomplete

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks @CharliieZhao for the improved documentation!

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



[issue46677] TypedDict docs are incomplete

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset b5140a5811aa35f4b488849fb55d84504732d135 by Charlie Zhao in 
branch '3.9':
[3.9] bpo-46677: Add examples of inheritance and attributes to `TypedDict` 
docs. (GH-31349) (GH-31808)
https://github.com/python/cpython/commit/b5140a5811aa35f4b488849fb55d84504732d135


--

___
Python tracker 

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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for your contribution!

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



[issue46644] typing: remove callable() check from typing._type_check

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 870b22b9c442d035190d2b8fb82256cd9a03da48 by Gregory Beauregard in 
branch 'main':
bpo-46644: Remove callable() requirement from typing._type_check (GH-31151)
https://github.com/python/cpython/commit/870b22b9c442d035190d2b8fb82256cd9a03da48


--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread Oleksandr Pavlyk


Oleksandr Pavlyk  added the comment:

So where getauxval(AT_MINSIGSTKSZ) < SIGSTKSZ the merged changes actually 
resulted in decrease of the allocated signal deliver stack. 

On Sapphire Rapids due to tile registers size we have getauxval(AT_MINSIGSTKSZ) 
> SIGSTKSZ.

This is why the initial proposal was to use SIGSTKSZ + 
max(getauxval(AT_MINSIGSTKSZ), SIGSTKSZ).

I suppose, ultimately I am saying that we should check that bpo-21131 does not 
regress.

--

___
Python tracker 

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



[issue46677] TypedDict docs are incomplete

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 28f20a6613b9d9287848bb78369b881a72941a39 by Charlie Zhao in 
branch '3.10':
[3.10] bpo-46677: Add examples of inheritance and attributes to `TypedDict` 
docs (GH-31349) (GH-31815)
https://github.com/python/cpython/commit/28f20a6613b9d9287848bb78369b881a72941a39


--

___
Python tracker 

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



[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

The value 12 is hardcoded here: 
https://github.com/python/cpython/blob/a89c29fbcc7e7e85848499443d819c3fab68c78a/Objects/stringlib/split.h#L14

The comment there says that this is because most .split() calls are on lines of 
human-readable text, which has about 11 words per line. I don't know if I 
believe that.

--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

On my x86-64 Fedora 35 with the CPU "Intel(R) Core(TM) i7-6820HQ CPU @ 
2.70GHz", I get:

* SIGSTKSZ = 8192
* getauxval(AT_MINSIGSTKSZ) = 2032
* faulthandler stack.ss_size = 10224
* os.sysconf('SC_MINSIGSTKSZ') = 2032

In C, sysconf(_SC_MINSIGSTKSZ) is similar to getauxval(AT_MINSIGSTKSZ), but the 
glibc sysconf(_SC_MINSIGSTKSZ) is more generic, whereas IMO 
getauxval(AT_MINSIGSTKSZ) is more the low-level Linux API.

--

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Fixed by 
> https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f

This change is now part of Python 3.11 alpha6 released a few days ago. Python 
3.11a6 news entries were merged into the Misc/NEWS.d/3.11.0a6.rst file.

> Please add a blurb entry.

I consider that the changelog is for changes which impacts users when they 
update. The regression was introduced after 3.11 alpha5 but fixed before Python 
3.11 alpha6. Only projects using contiguous integration were impacted. Only the 
cryptography project was impacted in practice.

> https://github.com/pyca/cryptography/issues/6929

This issue was closed as with the comment:

"Going to close this as it's an upstream python bug that's now been fixed."

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-11 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset a89c29fbcc7e7e85848499443d819c3fab68c78a by Brandt Bucher in 
branch 'main':
bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)
https://github.com/python/cpython/commit/a89c29fbcc7e7e85848499443d819c3fab68c78a


--

___
Python tracker 

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



[issue45274] Race condition in Thread._wait_for_tstate_lock()

2022-03-11 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



[issue29971] threading.Lock.acquire() not interruptible on Windows

2022-03-11 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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

zodbpickle issue: https://github.com/zopefoundation/zodbpickle/issues/67

--

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

PR for bitstruct: https://github.com/eerimoq/bitstruct/pull/26

--

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29929
pull_request: https://github.com/python/cpython/pull/31832

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

PR for msgpack: https://github.com/msgpack/msgpack-python/pull/499

--

___
Python tracker 

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



[issue46983] test_sqlite3: test_trace_too_much_expanded_sql() failed on AMD64 Arch Linux Usan 3.x

2022-03-11 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

The change that introduced this regression was reverted in GH-31788

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

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Oleksandr Pavlyk for your nice enhancement!

I merged your change to 3.9, 3.10 and main branches! I also added 
os.sysconf('SC_MINSIGSTKSZ') to Python 3.11.

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba2b7956fa3932769a5c0aa2575de5c8d7e7ba4b by Victor Stinner in 
branch '3.9':
bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) (GH-31831)
https://github.com/python/cpython/commit/ba2b7956fa3932769a5c0aa2575de5c8d7e7ba4b


--

___
Python tracker 

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



[issue46892] Async Call-Stack Reconstruction

2022-03-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

I've recently dabbled a bit in some new primitives for asyncio, and based on 
that experience I think this would be very useful.

IIRC Trio does this (presumably at considerable cost) in userland.

--

___
Python tracker 

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



[issue46981] Empty typing.Tuple

2022-03-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Alas, I have no idea. I don't even recall what copy_with() is for (it was 
apparently introduced in 3.7). Possibly vopy_with() is wrong here? I imaging 
some of this has to do with the special casing needed so that repr() of an 
empty Tuple type doesn't print "Tuple[]" (which IIRC it did, long ago).

--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2022-03-11 Thread Mark Roseman


Mark Roseman  added the comment:

Just a note, that an (updated) version of the auto-generated API reference has 
been "officially" added to TkDocs ... see https://tkdocs.com/pyref/

Few more things I'd like to do with it in the short term, but it's a decent 
starting point. Let me know if you have further suggestions.

--

___
Python tracker 

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



[issue22543] -W option cannot use non-standard categories

2022-03-11 Thread Michael Merickel


Michael Merickel  added the comment:

Updated affected versions as I ran into this on 3.9.7.

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29928
pull_request: https://github.com/python/cpython/pull/31831

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 882d8096c262a5945e0cfdd706e5db3ad2b73543 by Victor Stinner in 
branch 'main':
bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)
https://github.com/python/cpython/commit/882d8096c262a5945e0cfdd706e5db3ad2b73543


--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 393e2bf6bc6effbfe821f051a230978f0edd70df by Victor Stinner in 
branch '3.10':
bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) (GH-31830)
https://github.com/python/cpython/commit/393e2bf6bc6effbfe821f051a230978f0edd70df


--

___
Python tracker 

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



[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters


Change by Tim Peters :


--
type: behavior -> resource usage

___
Python tracker 

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



[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters


New submission from Tim Peters :

When looking into a StackOverflow question about surprisingly high memory use, 
I stumbled into this (under 3.10.1, Win64):

>>> import sys
>>> s = "1 2 3 4 5".split()
>>> s
['1', '2', '3', '4', '5']
>>> sys.getsizeof(s)
152
>>> _ - sys.getsizeof([])
96
>>> 96 / 8
12.0

That is, we allocated enough space in the list to store 12(!) elements, despite 
that only 5 are used. Other ways of building a 5-element list I've tried 
overallocate by at most 3 slots:

>>> sys.getsizeof([ch for ch in "12345"])
120
>>> sys.getsizeof([1, 2, 3, 4, 5])
120

(and 120 - 56 = 64, room for 8 pointers)

Then there's this curiosity, which allocates space for exactly the 5 needed:

>>> sys.getsizeof(list(tuple("1 2 3 4 5".split(
96

(and 96 - 56 = 40, room for the 5 pointers needed)

I don't expect this to be consistent, but allocating space for 12 when only 5 
are needed is unreasonable. Even allocating space for 8 is pushing it ;-)

--
components: Interpreter Core
messages: 414942
nosy: tim.peters
priority: normal
severity: normal
status: open
title: Surprising list overallocation from .split()
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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

The latest faulthandler bug on sigaltstack() was bpo-21131 about FPU state 
stored by "XSAVE" and a Linux kernel change to fix a security vulnerability:
https://bugs.python.org/issue21131#msg349688

--

___
Python tracker 

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



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

2022-03-11 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ecfff63e06e77e22035a7f7caa26986f033f3aea by Christian Heimes in 
branch 'main':
bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829)
https://github.com/python/cpython/commit/ecfff63e06e77e22035a7f7caa26986f033f3aea


--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29927
pull_request: https://github.com/python/cpython/pull/31830

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3b128c054885fe881c3b57a5978de3ea89c81a9c by Oleksandr Pavlyk in 
branch 'main':
bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789)
https://github.com/python/cpython/commit/3b128c054885fe881c3b57a5978de3ea89c81a9c


--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dc374ac7b0fabaed49461a2044c220765f48d229 by Victor Stinner in 
branch 'main':
bpo-46968: Add os.sysconf_names['SC_MINSIGSTKSZ'] (GH-31824)
https://github.com/python/cpython/commit/dc374ac7b0fabaed49461a2044c220765f48d229


--

___
Python tracker 

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



[issue46761] functools.update_wrapper breaks the signature of functools.partial objects

2022-03-11 Thread Graham Dumpleton


Graham Dumpleton  added the comment:

My vague recollection was that I identified some time back that partial() 
didn't behave correctly regards introspection for some use case I was trying to 
apply it to in the wrapt implementation. As a result I ended up creating my own 
PartialCallableObjectProxy implementation based around wrapt's own transparent 
object proxy object so that introspection worked properly and went with that 
where I needed it. I don't remember the exact details at the moment and don't 
think commit comments in code are likely to help. Even so, will try and spend 
some time this weekend looking more at the issue and see what I can remember 
about it and see if there is anything more I can comment on that may help.

--

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-11 Thread Zachary Ware


Zachary Ware  added the comment:

If it's already turning into a rewrite, how feasible would it be to adopt 
Brett's `py` launcher?

--
nosy: +brett.cannon

___
Python tracker 

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



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

2022-03-11 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +29926
pull_request: https://github.com/python/cpython/pull/31829

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-03-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +29925
pull_request: https://github.com/python/cpython/pull/31828

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5b1b9eacb92dd47d10793a8868246df6ea477ed6 by Serhiy Storchaka in 
branch 'main':
bpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800)
https://github.com/python/cpython/commit/5b1b9eacb92dd47d10793a8868246df6ea477ed6


--

___
Python tracker 

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



[issue46981] Empty typing.Tuple

2022-03-11 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset b35b36e106152245fe68880f4073fd99ec17f65d by Miss Islington (bot) 
in branch '3.10':
bpo-31327: Update time documentation to reflect possible errors (GH-31460)
https://github.com/python/cpython/commit/b35b36e106152245fe68880f4073fd99ec17f65d


--

___
Python tracker 

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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset 30d80213ae305bd0f0ed6bec7a0dff3e97b1c321 by Miss Islington (bot) 
in branch '3.9':
bpo-31327: Update time documentation to reflect possible errors (GH-31460)
https://github.com/python/cpython/commit/30d80213ae305bd0f0ed6bec7a0dff3e97b1c321


--

___
Python tracker 

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



[issue46989] signal.signal, et al, doesn't support [SIGRTMIN, SIGRTMAX] on FreeBSD (not included in NSIG)

2022-03-11 Thread Enji Cooper


New submission from Enji Cooper :

As noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262487, cpython 
relies on the definition of NSIG when building signal handlers to determine 
what signals are and aren't invalid.

Unfortunately on FreeBSD, NSIG doesn't include [SIGRTMIN,SIGRTMAX], as shown 
below:

$ python2
Python 2.7.18 (default, Dec  3 2020, 01:19:40) 
[GCC 4.2.1 Compatible FreeBSD Clang 8.0.1 (tags/RELEASE_801/final 366581)] on 
freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.signal(signal.SIGRTMIN, signal.SIG_DFL)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: signal number out of range
>>> exit()
$ python3
Python 3.8.12 (default, Jan  4 2022, 01:10:15) 
[Clang 10.0.1 (g...@github.com:llvm/llvm-project.git 
llvmorg-10.0.1-0-gef32c611a on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.signal(signal.SIGRTMIN, signal.SIG_IGN)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal number out of range
>>> exit()
$ python3.11
Python 3.11.0a3 (main, Feb  4 2022, 02:34:52) [Clang 10.0.1 
(g...@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.signal(signal.SIGRTMIN, signal.SIG_IGN)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.11/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
  ^^
ValueError: signal number out of range
>>> exit()
$

This results in a cpython interface which doesn't match the OS's signal(3) 
interface:

```
$ cat signal_rtmin.c 
#include 
#include 

int 
main(void)  
{   

if (signal(SIGRTMIN, SIG_DFL) == SIG_ERR)
warn("signal");
return (0);
}
$ cc -o signal_rtmin -Wall signal_rtmin.c
$ ./signal_rtmin
$ uname -a
FreeBSD picasso.local 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC  amd64
$
```

Linux includes [SIGRTMIN,SIGRTMAX] in NSIG, which means it allows these values 
in signal.signal without issue (confirmed on Ubuntu 18.04.6 LTS).

While one can definitely argue that this is an OS portability defect and this 
should be resolved in FreeBSD (and thus, not fixed in cpython), it doesn't 
address existing behavior on older versions of FreeBSD where this hasn't been 
resolved yet.

FreeBSD bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262487

--
components: FreeBSD
messages: 414932
nosy: koobs, ngie
priority: normal
severity: normal
status: open
title: signal.signal, et al, doesn't support [SIGRTMIN,SIGRTMAX] on FreeBSD 
(not included in NSIG)
versions: Python 3.10, Python 3.11, 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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29923
pull_request: https://github.com/python/cpython/pull/31826

___
Python tracker 

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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29924
pull_request: https://github.com/python/cpython/pull/31827

___
Python tracker 

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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29922
pull_request: https://github.com/python/cpython/pull/31825

___
Python tracker 

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



[issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc

2022-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset c83fc9c02c9846ec3a2d0123999c98e02f00b3f5 by slateny in branch 
'main':
bpo-31327: Update time documentation to reflect possible errors (GH-31460)
https://github.com/python/cpython/commit/c83fc9c02c9846ec3a2d0123999c98e02f00b3f5


--
nosy: +miss-islington

___
Python tracker 

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



[issue46892] Async Call-Stack Reconstruction

2022-03-11 Thread Matt Page


Matt Page  added the comment:

Sorry for the confusion, I'm working on a PR. I filed the BPO to gauge interest 
in the feature.

--

___
Python tracker 

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



[issue45993] Main branch of CPython does not build anymore on macOS

2022-03-11 Thread Christian Heimes


Change by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-11 Thread Steve Dower


Steve Dower  added the comment:

Hah, that's funny URL formatting. Let's see if this is any better:



--

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-11 Thread Steve Dower


Steve Dower  added the comment:

I'm working on what's become a rewrite of the launcher. If anyone would like to 
follow along, you can see my changes at 
https://github.com/python/cpython/compare/main...zooba:bpo-46566

It's still missing some functionality, and I'm not sure it's any faster or less 
complex than the previous version :) But it should handle ARM64 properly, and 
also knows how to do an install of a requested version if you don't already 
have it (still TBD whether that stays)

--

___
Python tracker 

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



[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

2022-03-11 Thread Eryk Sun


Change by Eryk Sun :


--
superseder:  -> Encoding error running in subprocess with captured output

___
Python tracker 

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



[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-11 Thread Eryk Sun


Eryk Sun  added the comment:

Itai, you can add a test to Win32NtTests in Lib/test/test_os.py. Maybe spawn a 
child process that creates and unlinks a file in a loop. In the parent process 
execute a loop that tries to stat the file and ignores errors when the file or 
path isn't found. For example:

@support.requires_subprocess()
def test_stat_unlink_race(self):
# bpo-46785: the implementation of os.stat() falls back on reading
# the parent directory if CreateFileW() fails with a permission
# error. If reading the parent directory fails because the file or
# directory is subsequently unlinked or because the volume or
# share is no longer available, then the original permission error
# should not be restored.
fname = os.path.join(os.environ['TEMP'], os_helper.TESTFN + '_46785')
self.addCleanup(os_helper.unlink, fname)
command = '''if 1:
import os
import sys
fname = sys.argv[1]
while True:
try:
with open(fname, "w") as f:
pass
except OSError:
pass
try:
os.remove(fname)
except OSError:
pass
'''
ignored_errors = (
2,  # ERROR_FILE_NOT_FOUND
3,  # ERROR_PATH_NOT_FOUND
21, # ERROR_NOT_READY
67, # ERROR_BAD_NET_NAME
)
deadline = time.time() + 5
p = subprocess.Popen([sys.executable, '-c', command, fname])
try:
while time.time() < deadline:
try:
os.stat(fname)
except OSError as e:
if e.winerror not in ignored_errors:
raise
finally:
p.terminate()

As the above test shows, I think the error should also be kept if 
attributes_from_dir() fails with ERROR_NOT_READY or ERROR_BAD_NET_NAME. For 
example:

switch (error) {
case ERROR_ACCESS_DENIED: /* Cannot sync or read attributes. */
case ERROR_SHARING_VIOLATION: /* It's a paging file. */
/* Try reading the parent directory. */
if (!attributes_from_dir(path, , )) {
/* Cannot read the parent directory. */
switch (GetLastError()) {
// keep these error codes
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
case ERROR_NOT_READY:
case ERROR_BAD_NET_NAME:
break;
// restore the error from CreateFileW()
default:
SetLastError(error);
}
return -1;
}

--

___
Python tracker 

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



[issue45993] Main branch of CPython does not build anymore on macOS

2022-03-11 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I'm getting the same exact error but on `arm64`, and clearing the cache does 
not help.

clang=13.0.0
MacOS=11.5.2

Should I open a new issue for this?


257 warnings generated.
257 warnings generated.
Undefined symbols for architecture arm64:
  "_libintl_bindtextdomain", referenced from:
  __locale_bindtextdomain_impl in _localemodule.o
  "_libintl_dcgettext", referenced from:
  __locale_dcgettext_impl in _localemodule.o
  "_libintl_dgettext", referenced from:
  __locale_dgettext_impl in _localemodule.o
  "_libintl_gettext", referenced from:
  __locale_gettext_impl in _localemodule.o
  "_libintl_setlocale", referenced from:
  __locale_setlocale_impl in _localemodule.o
  _locale_decode_monetary in _localemodule.o
  "_libintl_textdomain", referenced from:
  __locale_textdomain_impl in _localemodule.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_freeze_module] Error 1

--
nosy: +andrei.avk

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2022-03-11 Thread Sam Bull


Sam Bull  added the comment:

There is still an issue here. I proposed a possible solution at: 
https://github.com/python/cpython/pull/28149#issuecomment-1007823782

You can also scroll up through the lengthy discussion to see how I reached that 
conclusion. I've not had time yet to actually try implementing something yet.

--

___
Python tracker 

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



[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

2022-03-11 Thread markhuang3310


Change by markhuang3310 :


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



[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

2022-03-11 Thread markhuang3310


markhuang3310  added the comment:

sorry, I found the duplication
https://bugs.python.org/issue34618

--
resolution:  -> duplicate

___
Python tracker 

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



[issue46971] python takes long time when return big data

2022-03-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

> why it costs lots of time when del a large array?

That's probably a question for the NumPy folks, or possibly for Stack Overflow 
or some other question-and-answer resource. It'll depend on how NumPy arrays 
are de-allocated.

> Is there any way to process del in parallel?

Seems unlikely, given GIL constraints.

--

___
Python tracker 

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



[issue46982] Error in the experts list

2022-03-11 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Oops, sorry for that! I just edited my username, hopefully that fixes things.

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

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29921
pull_request: https://github.com/python/cpython/pull/31824

___
Python tracker 

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



[issue46984] test_concurrent_futures logs many UndefinedBehaviorSanitizer "DEADLYSIGNAL" errors on AMD64 Arch Linux Usan 3.x

2022-03-11 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Arch Linux Usan 3.x:
https://buildbot.python.org/all/#/builders/719/builds/672

I don't know if ASAN_OPTIONS env var is set on this buildbot. test.pythoninfo 
doesn't log ASAN_OPTIONS env var.

0:04:22 load avg: 1.30 [130/433] test_concurrent_futures passed (2 min 48 sec) 
-- running: test_multiprocessing_fork (44.3 sec)
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==348616==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 
0x03e8000551c8 (pc 0x7fec1ffcc702 bp 0x sp 0x7ffc39f5d020 T348616)
==348616==The signal is caused by a READ memory access.
#0 0x7fec1ffcc702 in raise (/usr/lib/libpthread.so.0+0x13702)
#1 0x555e6be87c4d in faulthandler_raise_sigsegv 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5
#2 0x555e6be87c4d in faulthandler_sigsegv 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9
#3 0x555e6bce3c09 in cfunction_call 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18
#4 0x555e6bc6d93a in _PyObject_MakeTpCall 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18
#5 0x555e6bdd2729 in _PyEval_EvalFrameDefault 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c
#6 0x555e6bdc4cb1 in _PyEval_EvalFrame 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16
#7 0x555e6bdc4cb1 in _PyEval_Vector 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24
#8 0x555e6bc6e228 in _PyVectorcall_Call 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16
#9 0x7fec1e2fca2d in load_reduce 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6761:15
#10 0x7fec1e2fca2d in load 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6909:9
#11 0x7fec1e2f23b7 in _pickle_loads_impl 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:7861:14
#12 0x7fec1e2f23b7 in _pickle_loads 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/clinic/_pickle.c.h:834:20
#13 0x555e6bce2d27 in cfunction_vectorcall_FASTCALL_KEYWORDS 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:443:24
#14 0x555e6bc6e398 in _PyObject_VectorcallTstate 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11
#15 0x555e6bc6e398 in PyObject_Vectorcall 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12
#16 0x555e6bdd2729 in _PyEval_EvalFrameDefault 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c
#17 0x555e6bdc4cb1 in _PyEval_EvalFrame 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16
#18 0x555e6bdc4cb1 in _PyEval_Vector 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24
#19 0x555e6bc6e228 in _PyVectorcall_Call 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16
#20 0x555e6bdd5695 in do_call_core 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12
#21 0x555e6bdd5695 in _PyEval_EvalFrameDefault 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22
#22 0x555e6bdc4cb1 in _PyEval_EvalFrame 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16
#23 0x555e6bdc4cb1 in _PyEval_Vector 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24
#24 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15
#25 0x555e6bc6ecb8 in _PyObject_Call_Prepend 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24
#26 0x555e6bd1bcf4 in slot_tp_init 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7802:15
#27 0x555e6bd07c21 in type_call 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:1116:19
#28 0x555e6bc6d93a in _PyObject_MakeTpCall 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18
#29 0x555e6bdd2729 in _PyEval_EvalFrameDefault 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c
#30 0x555e6bdc4cb1 in _PyEval_EvalFrame 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16
#31 0x555e6bdc4cb1 in _PyEval_Vector 
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24
#32 0x555e6bc73034 in _PyObject_VectorcallTstate 

[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

2022-03-11 Thread markhuang3310

markhuang3310  added the comment:

the test output:

PS C:\case_dev> python3 .\test.py
case 1
Я
case 2
b'Traceback (most recent call last):\r\n  File "", line 1, in 
\r\n  File "C:\\Python36\\lib\\encodings\\cp1252.py", line 19, in 
encode\r\nreturn 
codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\nUnicodeEncodeError:
 \'charmap\' codec can\'t encode character \'\\u042f\' in position 0: character 
maps to \r\n'

--

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

> ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: 
> _PySys_GetObjectId(_stdout)  // borrowed ref

It would be nice to notify datatable, or even propose a PR, if the 
_PySys_GetObjectId() is removed in Python 3.11.

--

___
Python tracker 

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



[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

2022-03-11 Thread markhuang3310

New submission from markhuang3310 :

Env:
Windows 10
Python3.8.10 amd64

Desciption:

I try to get output from a python program with a subprocess.
The python program print a unicode character.

```
import subprocess
import sys
cmd = rf'''{sys.executable} -c "print('\u042f')"'''

print('case 1')
stdout, stderr =  subprocess.Popen(cmd, stderr=subprocess.PIPE, 
stdout=None).communicate()
print('case 2')
stdout, stderr =  subprocess.Popen(cmd, stderr=subprocess.PIPE, 
stdout=subprocess.PIPE).communicate()
print(stderr)
```

The issue is that:
In case 1, I can see the "Я" (\u042f) form console.
In case 2, I try to get the output from 
subprocess.Popen(command).communicate()[0], the python process fail with   
UnicodeEncodeError.

Expected result:
In case2, I should get stdout == b'\u042f'

--
components: Windows
files: test.py
messages: 414919
nosy: markhuang3310, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: if a python program is execute by subprocess, the python program  can't 
output unicode characters and raise UnicodeEncodeError
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50667/test.py

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

> From my view, PySys_GetObject is available since Python3.2 both APIs look 
> safe to remove.

_PySys_GetObjectId() and _PySys_GetObjectId() are private API and can be 
removed anytime. We don't provide any backward compatibility warranty on the 
private API:
https://docs.python.org/dev/c-api/stable.html#c-api-stability

"Names prefixed by an underscore, such as _Py_InternalState, are private API 
that can change without notice even in patch releases."

--

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

https://pypi.org/project/pickle5/ should not be used on Python 3.8 and newer: 
it's a backport for Python 3.7 and older.

--

___
Python tracker 

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



[issue46943] fix[imaplib]: call Exception with string instance

2022-03-11 Thread SpaceOne


SpaceOne  added the comment:

@iritkatriel
alright, I am sorry.
I created another PR: https://github.com/python/cpython/pull/31823

--

___
Python tracker 

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



[issue46943] fix[imaplib]: call Exception with string instance

2022-03-11 Thread SpaceOne


Change by SpaceOne :


--
pull_requests: +29920
pull_request: https://github.com/python/cpython/pull/31823

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner
>From my view, PySys_GetObject is available since Python3.2 both APIs look safe 
>to remove.

--

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread Dong-hee Na


Dong-hee Na  added the comment:

@pitrou

https://github.com/pitrou/pickle5-backport/blob/e6117502435aba2901585cc6c692fb9582545f08/pickle5/_pickle.c#L1937

Do you have a plan to use PySys_GetObject("modules") instead of 
_PySys_GetObjectId(_modules)?

--
nosy: +pitrou

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-11 Thread Dong-hee Na


Dong-hee Na  added the comment:

./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: 
_PySys_GetObjectId(_stdin)  // borrowed ref
./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: 
_PySys_GetObjectId(_stdout)  // borrowed ref
./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: 
_PySys_GetObjectId(_stderr)  // borrowed ref
./top_5000/pickle5-0.0.12.tar.gz: pickle5-0.0.12/pickle5/_pickle.c: modules = 
_PySys_GetObjectId(_modules);

--

___
Python tracker 

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



[issue46982] Error in the experts list

2022-03-11 Thread Zachary Ware


Zachary Ware  added the comment:

Jelle, I think the simplest solution would be to remove the space from your bpo 
login name.

--
nosy: +zach.ware

___
Python tracker 

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



[issue46943] fix[imaplib]: call Exception with string instance

2022-03-11 Thread Irit Katriel


Irit Katriel  added the comment:

That happened because your PR was wrong - it contained many commits that 
touched many files, all of whose owners were modified. If you make the PR 
against the main branch, the diff will not have all those files a and they will 
not be notified.

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-03-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3bc801960655ea265599805eac24173164b511a6 by Matt Bogosian in 
branch '3.10':
[3.10] bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061) 
(GH-31821)
https://github.com/python/cpython/commit/3bc801960655ea265599805eac24173164b511a6


--

___
Python tracker 

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



[issue45149] Cover directory and zipfile execution in __main__ module docs

2022-03-11 Thread Petr Viktorin


Change by Petr Viktorin :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue46943] fix[imaplib]: call Exception with string instance

2022-03-11 Thread SpaceOne


SpaceOne  added the comment:

@iritkatriel
they were automatically added by github via your `.github/CODEOWNERS` file with 
the `**/*imap* @python/email-team` match.

And they all will also be informed by another pull request.

--

___
Python tracker 

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



[issue46944] Use FASTCALL calling convention in generator.throw

2022-03-11 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 304197b3820309e3ed695ff3e6a71461881a1728 by Kumar Aditya in 
branch 'main':
bpo-46944: use FASTCALL calling convention in generator.throw (GH-31723)
https://github.com/python/cpython/commit/304197b3820309e3ed695ff3e6a71461881a1728


--

___
Python tracker 

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



  1   2   >