[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: The problem with moving from Catalina to Big Sur is a known issue, AFAIK there's an open issue for this. The problem is that Big Sur moved system libraries into a big blob (which Apple calls the shared library cache). Ctypes uses an API that's new in macOS

[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: Anyways, the solution for "build on older macOS version, deploy to Big Sur" is to dynamically look for the relevant API (``_dyld_shared_cache_contains_path``) and use it when available. But only in that scenario, the current code path using explicit weak li

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 64f54b7ccd49764b0304e076bfd79b5482988f53 by andrei kulakov in branch 'main': bpo-30511: Add note on thread safety to shutil.make_archive() (#26933) https://github.com/python/cpython/commit/64f54b7ccd49764b0304e076bfd79b5482988f53 -- nosy:

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25819 pull_request: https://github.com/python/cpython/pull/27274 ___ Python tracker _

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +25820 pull_request: https://github.com/python/cpython/pull/27275 ___ Python tracker ___ __

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +25821 pull_request: https://github.com/python/cpython/pull/27276 ___ Python tracker ___ __

[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-21 Thread Tobias Bergkvist
Tobias Bergkvist added the comment: An alternative to using _dyld_shared_cache_contains_path is to use dlopen to check for library existence (which is what Apple recommends in their change notes: https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes

[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-21 Thread Steven Hsu
New submission from Steven Hsu : In Doc/glossary.rst, the first sentence of the entry "__future__" is that "A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter." However, in Doc/library/__future__.rst, the first sente

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset d17449f31d4af7a735e81b587bb329481764412f by Miss Islington (bot) in branch '3.10': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27274) https://github.com/python/cpython/commit/d17449f31d4af7a735e81b587bb329481764412

[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree that the contradiction should be resolved. There is an actual `__future__.py` module, which on my system it is at /usr/local/lib/python3.9/__future__.py But when we use the special syntax: from __future__ import it doesn't do a normal import

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 54d387105a5f0c3825a0f4fa607b58d55d05e572 by Miss Islington (bot) in branch '3.8': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (#27276) https://github.com/python/cpython/commit/54d387105a5f0c3825a0f4fa607b58d55d05e572

[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-07-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c8e35abfe304eb052a5220974006072c37d4b06a by Miss Islington (bot) in branch '3.9': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27275) https://github.com/python/cpython/commit/c8e35abfe304eb052a5220974006072c37d4b06a

[issue44671] Create a built-in yaml module

2021-07-21 Thread Jurj Andrei George
Jurj Andrei George added the comment: I would also like to have yaml in the stdlib. I reckon it would make sense to at least discuss yaml given that toml is on its way in the stdlib. By the time a toml parser gets added, yaml will be the only major data serialization language to not be incl

[issue44694] Message from BytesParser cannot be flattened immediately

2021-07-21 Thread Vitas Ivanoff
New submission from Vitas Ivanoff : Hello. Here is my code: #Parse message from file and immediately flatten it cur_policy = email.policy.SMTPUTF8 with open("/tmp/0.tmp", "rb") as orig_message_file: message_bytes = orig_message_file.read() message_parser = BytesParser(policy=cur_policy) msg

[issue44695] asdict use deep copy to dataclass instances

2021-07-21 Thread Itay azolay
New submission from Itay azolay : Hi, I noticed that 'asdict' use 'deepcopy' on all fields of the dataclass recursively. I believe this behavior can become optional with an argument, and shouldn't be decided for the user as the deepcopy takes significant amount of cpu and can have unexpecte

[issue44695] asdict use deep copy to dataclass instances

2021-07-21 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue44671] Create a built-in yaml module

2021-07-21 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: There was some discussion in 2013 : https://mail.python.org/archives/list/python-id...@python.org/thread/Y3Y5T54S2RSR6QW3HSEQV77EZPP7PWCX/#7H72ZRMSX74453GGURV26242UYM75VOW . This has to go through python-ideas and probably might need a PEP. There is

[issue44686] use pkgutil.resolve_name in unittest.mock

2021-07-21 Thread miss-islington
miss-islington added the comment: New changeset ab7fcc8fbdc11091370deeb000a787fb02f9b13d by Thomas Grainger in branch 'main': bpo-44686 replace unittest.mock._importer with pkgutil.resolve_name (GH-18544) https://github.com/python/cpython/commit/ab7fcc8fbdc11091370deeb000a787fb02f9b13d

[issue44696] Python 2.0.1 Installation:

2021-07-21 Thread chen-y0y0
New submission from chen-y0y0 : # I tried to install Python 2.0.1 onto my virtual machine(Windows 3.1) for low-version developing, but an error occurred while the installation: # Error # Could not load the DLL library # C:\TEMP\~GLF256B.TMP. -- components: IO, Installation,

[issue44353] PEP 604 NewType

2021-07-21 Thread Denis Laxalde
Change by Denis Laxalde : -- nosy: +dlax ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue44696] Python 2.0.1 Installation:

2021-07-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 2.0.1 is 20 years old and not supported. I don't think that installing Python on Windows 3.1 has ever been supported. But even if it was, we're certainly not supporting it now. -- nosy: +steven.daprano resolution: -> wont fix stage: -> reso

[issue44696] Python 2.0.1 Installation:

2021-07-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you really need to get Python 2.0.1 working on Windows 3.1 for some reason, you might find somebody interested in the problem on one of the various Python forums. You could try the Python-Dev mailing list, or Python-List mailing list, or Reddit's r/pyth

[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-21 Thread Steven Hsu
Steven Hsu added the comment: It sounds like that both descriptions (pseudo- and real) are true in different points of view on the __future__ module. I have no idea how to resolve this contradiction of the original design of the module. Any suggestion? Thanks for reply. -- ___

[issue44697] Memory leak when asyncio.open_connection raise

2021-07-21 Thread Artem
New submission from Artem : I write some short example. import resource import asyncio class B: def __init__(self, loop): self.loop = loop self.some_big_data = bytearray(1024 * 1024) # 1Mb for memory bloating async def doStuff(self): if not await self.connect

[issue35183] os.path.splitext documentation needs typical example

2021-07-21 Thread Jake Stockwin
Jake Stockwin added the comment: Hello, I would like to submit a PR for this. It'll be my first contribution to cPython and I am slightly unclear if this suggestion has been "accepted" in some sense (i.e. do the Devs agree it should be fixed as suggested)? If so, I will go ahead and create

[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-07-21 Thread Thomas Wouters
New submission from Thomas Wouters : Objects/complexobject.c's complex_pow uses undefined behaviour, by casting a float of unknown magnitude to a long: int_exponent = (long)exponent.real; At Google we build with clang and -fsanitize=float-cast-overflow by default, which catches this part

[issue44699] Simple regex appears to take exponential time in length of input

2021-07-21 Thread János Brezniczky
New submission from János Brezniczky : I don't know if it's normal, but it's impractical. I seem to have come by an expression consuming o(c^n) CPU cycles with c around 2. Regex: \*([^*]+)*\* Resulted in times (in seconds) of 0.17 (* is there anybody out?) 0.34 1 0.69 12 1.36 123 2.73 123

[issue44699] Simple regex appears to take exponential time in length of input

2021-07-21 Thread János Brezniczky
János Brezniczky added the comment: Might be related to https://bugs.python.org/issue43075, as in would trigger ReDOSability had my syntax highlighting-related changes (which eventually broke golden master tests, fortunately :) ) hit the public. (Meaning my reduced - possibly minimal - corner

[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-07-21 Thread Thomas Wouters
Change by Thomas Wouters : -- keywords: +patch pull_requests: +25823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27278 ___ Python tracker ___ _

[issue42414] unable to document fields of dataclass

2021-07-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Eric: makes sense, I'll go with that. John-Mark: I will go ahead and work on a PR along the lines Terry suggested, let us know if you have any objections or if you would prefer to work on a PR by yourself instead. P.S. I understand now what you meant by 1 l

[issue44699] Simple regex appears to take exponential time in length of input

2021-07-21 Thread János Brezniczky
János Brezniczky added the comment: I'd also raise for consideration the introduction a (default?) timeout on regexes, similarly to how such a feature seems available in .NET. Given the DOS vector vs. occasionally non-trivially complex expressions, this could draw developer attention to this

[issue44699] Simple regex appears to take exponential time in length of input

2021-07-21 Thread Matthew Barnett
Matthew Barnett added the comment: It's called "catastrophic backtracking". Think of the number of ways it could match, say, 4 characters: 4, 3+1, 2+2, 2+1+1, 1+3, 1+2+1, 1+1+2, 1+1+1+1. Now try 5 characters... -- ___ Python tracker

[issue44699] Simple regex appears to take exponential time in length of input

2021-07-21 Thread János Brezniczky
János Brezniczky added the comment: Hello! Thanks for the reply - you are probably right, and I accept that it's normal. However, there may be numerous frameworks getting built on the concept of collaboratively contributed regexes. (Python likes prototyping, prototyping likes portable program

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-07-21 Thread Eric Snow
Change by Eric Snow : -- assignee: eric.snow -> stage: patch review -> needs patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-21 Thread Zachary Ware
Zachary Ware added the comment: Agreed with Paul, it's more useful than confusing to have the version in the name. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue42414] unable to document fields of dataclass

2021-07-21 Thread Andrei Kulakov
Change by Andrei Kulakov : -- pull_requests: +25824 pull_request: https://github.com/python/cpython/pull/27279 ___ Python tracker ___ __

[issue42414] unable to document fields of dataclass

2021-07-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've added a new PR: https://github.com/python/cpython/pull/27279 (note it's a rough PoC draft at this point) The output of inspect.getdoc() is the same: A(total: int, num: int = 5) total: int -- number of widgets num: int [5] -- total widgets --

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-07-21 Thread Guido van Rossum
Guido van Rossum added the comment: Another task seems to have appeared, Nick Coghlan would like the typedef to be renamed to PyLocal_VarKind, and the getter/setter similarly. -- nosy: +ncoghlan ___ Python tracker

[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries
New submission from Jack DeVries : I believe this is a problem with my machine because I've tried checking out to known good commits (which worked on my machine before) and have the same issue, but I've tried everything and don't really know what to do next. I'm hoping someone can help me, and

[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries
Change by Jack DeVries : -- type: -> compile error versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44695] asdict use deep copy to dataclass instances

2021-07-21 Thread Ben Avrahami
Change by Ben Avrahami : -- nosy: +avrahami.ben ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue44701] Create a @deprecated decorator (annotation)

2021-07-21 Thread Leonardo Freua
New submission from Leonardo Freua : Would it be interesting to create a @deprecated decorator to avoid adding warnings.warn("deprecation message", DeprecationWarning, stacklevel=2) in methods body? Using the decorator approach to indicate depreciation would make the methods cleaner (leaving

[issue44695] asdict use deep copy to dataclass instances

2021-07-21 Thread Itay azolay
Change by Itay azolay : -- versions: +Python 3.10, Python 3.11 -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt

2021-07-21 Thread Geoffrey Thomas
Geoffrey Thomas added the comment: Sorry to bump an old thread, but - does need to be in the public Python.h header? Or would it be enough to be in _cryptmodule.c, which is the code that uses crypt_r()? I can provide a quick patch to change that if that seems sound. -- nosy: +geoff

[issue44702] Fix weakref doc

2021-07-21 Thread Svyatoslav
New submission from Svyatoslav : >From https://docs.python.org/3/library/weakref.html: "" Not all objects can be weakly referenced; those objects which can include class instances, functions written in Python (but not in C), instance methods, sets, frozensets, some file objects, generators, typ

[issue44703] deepcopy(frozenset()) returns a new object

2021-07-21 Thread Svyatoslav
New submission from Svyatoslav : from copy import copy, deepcopy t = 1, 2 t1 = t, 3 t2 = t1, 4 t3 = t2, 5 assert copy(t3) is t3 assert deepcopy(t3) is t3 s = frozenset({1, 2}) assert s.copy() is s # method .copy() always returns self, what its purpose? assert copy(s) is s assert deepcopy(s) is

[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries
Jack DeVries added the comment: I'm also getting this warning: ld: warning: object file (Programs/python.o) was built for newer macOS version (11.5) than being linked (11.0) -- ___ Python tracker ___

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Svyatoslav
New submission from Svyatoslav : In docstring of Set._hash in _collections_abc.py is written: "We match the algorithm used by the built-in frozenset type." But >>> s = frozenset({i for i in range(10)}) >>> hash(s) 3895031357313128696 >>> Set._hash(s) 3914343279946282847 Looks like Set._hash is

[issue44703] deepcopy(frozenset()) returns a new object

2021-07-21 Thread Svyatoslav
Change by Svyatoslav : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries
Jack DeVries added the comment: UGH I was experimenting with installing / compilingi gdb and had accidentally installed a different version of `ar` :/ -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue44435] There is no description of PY_SSIZE_T_CLEAN in docs

2021-07-21 Thread Jack DeVries
Jack DeVries added the comment: Looking back at this issue, I can see that there is documentation for this in the 'note' block. I'm just going to close this issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python t

[issue44671] Create a built-in yaml module

2021-07-21 Thread Jarrod Price
Jarrod Price added the comment: Could you please assist me with creating a PEP? I’ve not done it before and I’m not sure where to begin. -- ___ Python tracker ___

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +25825 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27281 ___ Python tracker

[issue35183] os.path.splitext documentation needs typical example

2021-07-21 Thread Jack DeVries
Jack DeVries added the comment: @jstockwin, the process usually goes like this: 1. You open a PR 2. The discussion continues over there. non-core-dev volunteers review your PR and get it into a polished state. 3. A core dev will quickly take a look, provide feedback if necessary, or just merg

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: I opened a PR. It looks like frozenset.__hash__ changed in GH-5194 and GH-5235, but Set._hash wasn't updated accordingly. -- ___ Python tracker

[issue44703] deepcopy(frozenset()) returns a new object

2021-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Returning the same object is just a micro-optimization and we've decided that it isn't worth it. In bpo-40521, frozenset() stop being a singleton. This costs a small bit of space but saves code complexity and a bit of execution time (especially given th

[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-07-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset c878f5d81772dc6f718d6608c78baa4be9a4f176 by Dennis Sweeney in branch 'main': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) https://github.com/python/cpython/commit/c878f5d81772dc6f718d6608c78baa4be9a4f176 -

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +25827 pull_request: https://github.com/python/cpython/pull/27283 ___ Python tracker ___ __

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25826 pull_request: https://github.com/python/cpython/pull/27282 ___ Python tracker _

[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-07-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44705] Support Windows file open modes for `open` built-in function

2021-07-21 Thread Luke Deller
New submission from Luke Deller : Microsoft Windows supports some extra file open modes including: "S"Specifies that caching is optimized for, but not restricted to, sequential access from disk. "T"Specifies a file as temporary. If possible, it is not flushed to disk. "D"Specifie

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset e0ef81600f4331299f61bbe3f7f08bb21d90315b by Miss Islington (bot) in branch '3.9': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27283) https://github.com/python/cpython/commit/e0ef81600f4331299f61bbe3f7f08bb21d9

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 4194f1465fa85371dcbead57a54bb06d1f0b97d9 by Miss Islington (bot) in branch '3.10': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282) https://github.com/python/cpython/commit/4194f1465fa85371dcbead57a54bb06d1f

[issue44705] Support Windows file open modes for `open` built-in function

2021-07-21 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +methane ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue44705] Support Windows file open modes for `open` built-in function

2021-07-21 Thread Dong-hee Na
Change by Dong-hee Na : -- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python

[issue44705] Support Windows file open modes for `open` built-in function

2021-07-21 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue44677] CSV sniffing falsely detects space as a delimiter

2021-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Changing sniffer logic is risky because it risks breaking existing code that relies on the current predictions. FWIW, in your example, the sniffer gets the desired result if given a delimiter hint: >>> s = "a|b\nc| 'd\ne|' f" >>> pprint.pp(dict(vars(Snif

[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-07-21 Thread Josh Meranda
Josh Meranda added the comment: I agree with Bigbird and paul.j3. > But I think this is a real bug in argparse, not a documentation problem. > Off hand I can't think of clean way of refining the description without > getting overly technical about the error handling. It seems like a reasona

[issue44706] UUID constructor should accept another UUID instance

2021-07-21 Thread Tzach Yarimi
Change by Tzach Yarimi : -- components: Library (Lib) nosy: tzach priority: normal severity: normal status: open title: UUID constructor should accept another UUID instance type: behavior versions: Python 3.11 ___ Python tracker

[issue44706] UUID constructor should accept another UUID instance

2021-07-21 Thread Tzach Yarimi
New submission from Tzach Yarimi : Primitives usually accept an instance of their own type in the constructor, for example: int(5) str("a") tuple((1,2,3)) This is not the case for UUID: >>> from uuid import uuid4, UUID >>> x = uuid4() >>> UUID(x) Traceback (most recent call last): File "",

[issue44706] UUID constructor should accept another UUID instance

2021-07-21 Thread Tzach Yarimi
Change by Tzach Yarimi : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python