[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-08 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: Re AlexWaygood: If these PEP-484 related things were so obvious that they would admit a compact description of the problem in 2-3 lines, these issues would likely have been identified much earlier. We would not be seeing them now, given that Python

[issue47121] math.isfinite() can raise exception when called on a number

2022-04-08 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: Tim, the problem may well be simply due to the documentation of math.isfinite() being off here. This is what we currently have: https://docs.python.org/3/library/math.html#math.isfinite === math.isfinite(x) Return True if x is neither an infinity nor

[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-08 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: This is not a partial duplicate of https://bugs.python.org/issue47121 about math.isfinite(). The problem there is about a specific function on which the documentation may be off - I'll comment separately on that. The problem here

[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2022-04-08 Thread Thomas Grainger
Thomas Grainger added the comment: the problem is multiprocessing/process is calling threading._shutdown which tries to join its own thread, because concurrent.futures.thread._threads_queues contains the main thread in the subprocess File "/home/graingert/miniconda3/envs

[issue47166] Dataclass transform should ignore TypeAlias variables

2022-04-06 Thread Thomas MK
Thomas MK added the comment: There is of course no hard reason for not using the global scope. I just often have enums (or other types) that are very closely linked to one class. And it makes sense to me then to have a TypeAlias in that class so that I don't have to import the enum

[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-05 Thread Thomas Fischbacher
New submission from Thomas Fischbacher : Here is a major general problem with python-static-typing as it is described by PEP-484: The approach described in https://peps.python.org/pep-0484/#the-numeric-tower negatively impacts our ability to reason about the behavior of code with stringency. I

[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-30 Thread Thomas MK
New submission from Thomas MK : The dataclass transformation ignores attributes that are annotated as ClassVar. I think it should also ignore attributes that are annotated as TypeAlias. Specifically, I have this usecase in mind: class RunMode(Enum): release = auto() debug = auto

[issue47121] math.isfinite() can raise exception when called on a number

2022-03-25 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: The problem with PEP-484 is that if one wants to use static type analysis, neither of these options are good: - Use static annotations on functions, and additionally spec out expectations in docstrings. Do note that the two types places where "

[issue47121] math.isfinite() can raise exception when called on a number

2022-03-25 Thread Thomas Fischbacher
New submission from Thomas Fischbacher : >>> help(math.isfinite) isfinite(x, /) Return True if x is neither an infinity nor a NaN, and False otherwise. So, one would expect the following expression to return `True` or `False`. We instead observe: >>> math.isfinite(1

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-24 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: Addendum Serhiy, I agree that my assessment was incorrect. It actually is unittest/mock.py that has quite a few 'raise AssertionError' that are not coming from an 'assert' keyword statement. At a deeper level, the problem here is as follows: Every

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch nosy: +graingert nosy_count: 4.0 -> 5.0 pull_requests: +30134 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32044 ___ Python tracker <https://bugs.p

[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-21 Thread Thomas Grainger
New submission from Thomas Grainger : the following code prints: import sys import dis import pprint def demo(): for i in range(1): if i >= 0: pass class Tracer: def __init__(self): self.events = [] def trace(self, frame, event,

[issue47025] bytes do not work on sys.path

2022-03-16 Thread Thomas Grainger
Thomas Grainger added the comment: > I'd advocate for not supporting bytes paths and instead updating the > documentation to require strings. I've got PR GH-31934 started to do this -- message_count: 8.0 -> 9.0 pull_requests: +30026 pull_request: https://github.com/pytho

[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing from a bytes zipimport path on sys.path results in a BytesWarning: Comparison between bytes and string running the reproducer with `python -b` shows: python -b zipfile_demo.py :1345: BytesWarning: Comparison between bytes and string see also

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: zipimporter.zipimporter handles non-bytes paths here: https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67 I think FileFinder should do the same -- ___ Python

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: interestingly bytes filenames pointing to zip files on sys.path do support bytes (see zipfile_demo.py) -- Added file: https://bugs.python.org/file50679/zipfile_demo.py ___ Python tracker <https://bugs.python.

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: https://docs.python.org/3/reference/import.html#path-entry-finders says "The encoding of bytes entries is determined by the individual path entry finders." see https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: this is a regression from 3.2: ``` Python 3.2.6 (default, Jan 18 2016, 19:21:14) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tempfile >>>

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31897 ___ Python tracker <https://bugs.python.org/issu

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issue47

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing a module with bytes in `sys.path` fails with: File "", line 182, in _path_isabs TypeError: startswith first arg must be bytes or a tuple of bytes, not str (see reproducer in attached demo.py) however `sys.path` is documented as

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: The documentation of exceptions in the reference is one of the places that makes the life of users substantially harder than it ought to be, since the documentation appears to not have been written with the intent to give guarantees that users can

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Thomas Fischbacher
New submission from Thomas Fischbacher : The Python reference says: (1) https://docs.python.org/3/library/exceptions.html#concrete-exceptions exception AssertionError Raised when an assert statement fails. (2) https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

[issue46960] Docs: Link from settrace to frame

2022-03-08 Thread Thomas Guettler
New submission from Thomas Guettler : https://docs.python.org/3.10/library/sys.html#sys.settrace > Trace functions should have three arguments: frame, event, and arg. frame is > the current stack frame. It would be super cool, if "current stack frame" could be a hyperlink to

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Thomas Grainger
Thomas Grainger added the comment: The main advantage for my usecase is support for heterogeneous unpacking On Sat, Mar 5, 2022, 6:04 PM Alex Waygood wrote: > > Alex Waygood added the comment: > > I sense we'll have to agree to disagree on the usefulness of NamedTuples

[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-02-28 Thread Thomas Wouters
Change by Thomas Wouters : -- nosy: +twouters ___ Python tracker <https://bugs.python.org/issue46885> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Thomas Grainger
Thomas Grainger added the comment: there could be multiple messages here perhaps it could be: ``` finally: # Must reacquire lock even if wait is cancelled cancelled = [] while True: try: await self.acquire

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29629 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31499 ___ Python tracker <https://bugs.python.org/issu

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger
New submission from Thomas Grainger : the following code: import socket import asyncio async def amain(): with socket.socket(family=socket.AF_INET, proto=socket.IPPROTO_UDP, type=socket.SOCK_DGRAM) as sock: sock.setblocking(False) await asyncio.get_running_loop

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
Thomas Grainger added the comment: hello, it's actually a bit of a round about context, but it was brought up on a tornado issue where I was attempting to port the asyncio optimization to tornado: https://github.com/tornadoweb/tornado/issues/3113#issuecomment-1041019287 I think it would

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29627 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31497 ___ Python tracker <https://bugs.python.org/issu

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
New submission from Thomas Grainger : now that the getaddrinfo lock has been removed on all platforms the numeric only host resolve in asyncio could be moved back into BaseEventLoop.getaddrinfo -- components: asyncio messages: 413699 nosy: asvetlov, graingert, yselivanov priority

[issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem)

2022-02-17 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert, vstinner ___ Python tracker <https://bugs.python.org/issue42752> ___ ___ Python-bugs-list mailing list Unsub

[issue44863] Allow TypedDict to inherit from Generics

2022-02-03 Thread Thomas Grainger
Thomas Grainger added the comment: there's a thread on typing-sig for this now: https://mail.python.org/archives/list/typing-...@python.org/thread/I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ/#I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ -- nosy: +graingert ___ Python

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-01-25 Thread Thomas Grainger
Thomas Grainger added the comment: this also applies to io and _pyio -- ___ Python tracker <https://bugs.python.org/issue46522> ___ ___ Python-bugs-list mailin

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-01-25 Thread Thomas Grainger
New submission from Thomas Grainger : >>> import types >>> types.ModuleType("concurrent.futures").missing_attribute Traceback (most recent call last): File "", line 1, in AttributeError: module 'concurrent.futures' has no attribute 'missing_at

[issue46045] NetBSD: do not use POSIX semaphores

2022-01-18 Thread Thomas Klausner
Thomas Klausner added the comment: Thanks for merging this, @serhiy.storchaka! -- ___ Python tracker <https://bugs.python.org/issue46045> ___ ___ Python-bug

[issue46415] ipaddress.ip_{address, network, interface} raises TypeError instead of ValueError if given a tuple as address

2022-01-17 Thread Thomas Cellerier
Change by Thomas Cellerier : -- title: ipaddress.ip_{address,network,interface} raise TypeError instead of ValueError if given a tuple as address -> ipaddress.ip_{address,network,interface} raises TypeError instead of ValueError if given a tuple as addr

[issue46415] ipaddress.ip_{address, network, interface} raise TypeError instead of ValueError if given a tuple as address

2022-01-17 Thread Thomas Cellerier
Change by Thomas Cellerier : -- keywords: +patch pull_requests: +28845 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30642 ___ Python tracker <https://bugs.python.org/issu

[issue46415] ipaddress.ip_{address, network, interface} raise TypeError instead of ValueError if given a tuple as address

2022-01-17 Thread Thomas Cellerier
New submission from Thomas Cellerier : `IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of (address description, netmask) as the address parameter. When the tuple-based address is used errors are not propagated correctly through the `ipaddress.ip_*` helper because

[issue46045] NetBSD: do not use POSIX semaphores

2022-01-14 Thread Thomas Klausner
Thomas Klausner added the comment: ping - this patch needs a review -- ___ Python tracker <https://bugs.python.org/issue46045> ___ ___ Python-bugs-list mailin

[issue46053] NetBSD: ossaudio support incomplete

2022-01-14 Thread Thomas Klausner
Thomas Klausner added the comment: ping - this patch needs a review -- ___ Python tracker <https://bugs.python.org/issue46053> ___ ___ Python-bugs-list mailin

[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-08 Thread Thomas Klausner
Change by Thomas Klausner : -- nosy: +wiz nosy_count: 8.0 -> 9.0 pull_requests: +28694 pull_request: https://github.com/python/cpython/pull/30490 ___ Python tracker <https://bugs.python.org/issu

[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread Thomas Klausner
Change by Thomas Klausner : -- keywords: +patch pull_requests: +28693 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30490 ___ Python tracker <https://bugs.python.org/issu

[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread Thomas Klausner
New submission from Thomas Klausner : The configure script uses the test(1) '==' operator, which is only supported by bash. The standard comparison operator is '='. -- components: Installation messages: 410120 nosy: wiz priority: normal severity: normal status: open title: Unportable

[issue42369] Reading ZipFile not thread-safe

2022-01-03 Thread Thomas
Thomas added the comment: @khaledk I finally got some time off, so here you go https://github.com/1/ParallelZipFile I can not offer any support for a more correct implementation of the zip specification due to time constraints, but maybe the code is useful for you anyway

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Thomas Grainger added the comment: actually it was already done in 13 months! -- ___ Python tracker <https://bugs.python.org/issue38415> ___ ___ Python-bug

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert nosy_count: 3.0 -> 4.0 pull_requests: +28454 pull_request: https://github.com/python/cpython/pull/30233 ___ Python tracker <https://bugs.python.org/issu

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-22 Thread Thomas Wouters
New submission from Thomas Wouters : test_pathlib contains, in PosixPathTest.test_expanduser, a check that expanduser on a nonexistent user will raise RuntimeError. Leaving aside the question why that's a RuntimeError (which is probably too late to fix anyway), the test performs this check

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2021-12-20 Thread Thomas Gläßle
Change by Thomas Gläßle : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34624> ___ ___ Pyth

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2021-12-20 Thread Thomas Gläßle
Thomas Gläßle added the comment: Ok, it seems at least the incorrect documentation has been fixed in the mean time. I'm going to close this as there seems to be no capacity to deal with this. -- ___ Python tracker <https://bugs.python.

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-19 Thread Thomas Grainger
Thomas Grainger added the comment: > Actually I don't agree with Thomas's logic... his argument feels like > consistency for its own sake. Do you expect sync and async contextmanagers to act differently? Why would sync contextmanagers raise AttributeError and async contextmanagers

[issue46083] PyUnicode_FSConverter() has confusing reference semantics

2021-12-15 Thread Thomas Wouters
New submission from Thomas Wouters : The PyUnicode_FSConverter function has confusing reference semantics, and confusing documentation. https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_FSConverter says the output argument "must be a PyBytesObject* which must be released

[issue1525919] email package content-transfer-encoding behaviour changed

2021-12-13 Thread Thomas Arendsen Hein
Thomas Arendsen Hein added the comment: Default python3 on Debian buster: $ python3 Python 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email.mim

[issue30512] CAN Socket support for NetBSD

2021-12-11 Thread Thomas Klausner
Change by Thomas Klausner : -- pull_requests: +28286 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30066 ___ Python tracker <https://bugs.python.org/issu

[issue46053] NetBSD: ossaudio support incomplete

2021-12-11 Thread Thomas Klausner
Change by Thomas Klausner : -- keywords: +patch pull_requests: +28285 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30065 ___ Python tracker <https://bugs.python.org/issu

[issue46053] NetBSD: ossaudio support incomplete

2021-12-11 Thread Thomas Klausner
New submission from Thomas Klausner : When compiling Python on NetBSD, the ossaudio module is not enabled. 1. the code tries to export some #define that are not in the public OSS API (but that some other implementations provide) 2. on NetBSD, you need to link against libossaudio when using OSS

[issue46045] NetBSD: do not use POSIX semaphores

2021-12-11 Thread Thomas Klausner
Change by Thomas Klausner : -- keywords: +patch pull_requests: +28272 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30047 ___ Python tracker <https://bugs.python.org/issu

[issue46045] NetBSD: do not use POSIX semaphores

2021-12-11 Thread Thomas Klausner
New submission from Thomas Klausner : On NetBSD by default, the following tests do not finish in > 1h: 1:07:13 load avg: 0.00 running: test_compileall (1 hour 7 min), test_multiprocessing_fork (1 hour 7 min), test_concurrent_futures (1 hour 6 min) Defining HAVE_BROKEN_POSIX_SEMAPHORES fi

[issue21459] DragonFlyBSD support

2021-12-10 Thread Thomas Klausner
Thomas Klausner added the comment: Not interested in this any longer, and Dragonfly's Dports doesn't carry this patch, so it's probably not needed any longer. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue21461] Recognize -pthread

2021-12-10 Thread Thomas Klausner
Thomas Klausner added the comment: I must confess, I don't know. This patch has been in pkgsrc since at least the import of the first python 2.7 package in 2011, and I haven't dug deeper. If you think it is unnecessary, I'll trust you. I've just removed it from the python 3.10 package

[issue21461] Recognize -pthread

2021-12-10 Thread Thomas Klausner
Thomas Klausner added the comment: gcc supports this flag. According to the man page: This option consistently for both compilation and linking. This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets. On NetBSD, using -pthread

[issue21461] Recognize -pthread

2021-12-10 Thread Thomas Klausner
Change by Thomas Klausner : -- pull_requests: +28257 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30032 ___ Python tracker <https://bugs.python.org/issu

[issue46000] NetBSD curses compatibility

2021-12-06 Thread Thomas Klausner
Thomas Klausner added the comment: Done: https://github.com/python/cpython/pull/29947 -- ___ Python tracker <https://bugs.python.org/issue46000> ___ ___ Pytho

[issue46000] NetBSD curses compatibility

2021-12-06 Thread Thomas Klausner
New submission from Thomas Klausner : The code in Modules/_cursesmodule.c has an assumption on ncurses. The attached simple patch fixes this and works with both NetBSD curses and ncurses. -- components: Extension Modules files: patch-Modules___cursesmodule.c messages: 407825 nosy: wiz

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: you can see the analogous sync contextmanager issue on python3.6 with: ``` import logging from contextlib import contextmanager @contextmanager def foo(): yield def test(): f = foo() f.__enter__() f.__enter__() test() ``` on python3.7

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: I see the change here: https://github.com/python/cpython/commit/1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf#diff-e00601a380ba6c916ba4333277fe6ea43d2477804002ab1ae64480f80fec8e3aR177-R179 this is intentionally implementing https://bugs.python.org/issue30306

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: ah I can repeat this on python3.8.10 trio but not python3.9.9 trio: ``` import logging import trio from contextlib import asynccontextmanager @asynccontextmanager async def foo(): await trio.sleep(1) yield async def test(): async

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: or consider the trio version: ``` import logging import trio from contextlib import asynccontextmanager @asynccontextmanager async def foo(): await trio.sleep(1) yield async def test(): async with trio.open_nursery() as n: f = foo

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: I think `AttributeError: args` is the desired/expected behaviour consider the sync version: ``` import logging from asyncio import sleep, gather, run from contextlib import asynccontextmanager, contextmanager @contextmanager def foo(): yield def test

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-12-06 Thread Thomas Kluyver
Thomas Kluyver added the comment: It's not my decision, so I can't really say. But the Queue API is pretty stable, and exists 3 times over in Python (the queue module for use with threads, in multiprocessing and in asyncio). So I'd guess that anyone wanting to add to that API would need

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think this is expected. The queue itself doesn't know that one particular process is meant to put data into it. It just knows that there's no data to get, so .get() blocks as the docs say it should. This doesn't apply to issue22393, because the pool knows

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: In the example script, I believe you need to close the write end of the pipe in the parent after forking: cpid = os.fork() if cpid == 0: # Write to pipe (child) else: # Parent os.close(ctx) # Read from pipe This is the same with synchronous

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Thomas Stolarski
Thomas Stolarski added the comment: I figured this would probably be the case, but since YIQ also requires a profile (and the FCC one it implements is pretty weird for digital work), I thought I'd give it a shot anyway. Would it be worth moving the test/formatting changes over

[issue45822] Py_CompileString does not respect the coding cookie with the new parser if flags are empty

2021-11-16 Thread Thomas Wouters
Thomas Wouters added the comment: Py_CompileString() in Python 3.9 and later, using the PEG parser, appears to no longer honours source encoding cookies. A reduced test case: #include "Python.h" #include const char *src = ( "# -*- coding: Latin-1 -*-\n&quo

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-09 Thread Thomas Stolarski
Change by Thomas Stolarski : -- keywords: +patch pull_requests: +27763 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29512 ___ Python tracker <https://bugs.python.org/issu

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-09 Thread Thomas Stolarski
New submission from Thomas Stolarski : Since the implementation of `rgb_to_yiq` roughly 30 years ago now, the advent of HDTV has resulted in most broadcasting and video processing having moved towards Rec 709 (or BT.709). While I know colorsys has been on the chopping block for a while

[issue45748] "import ctypes" segfaults on Python 3.6 and Ubuntu 21.10

2021-11-08 Thread Thomas Trummer
New submission from Thomas Trummer : 3.7 and later are all working fine. First good commit: 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 First bad commit: fdbd01151dbd5feea3e4c0316d102db3d2a2a412 git checkout v3.6.15 #0 0x76cc52a0 in PyCFuncPtr_new (type=0x559157f8, args

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: > An example of multiple descriptors would be to have: > @cached_property > @property > def expensive_calc(self): > #Do something expensive That's decorator chaining. The example you gave is not working code (try to return something from expensive

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: Just to rephrase, because the explanation in my last message can be ambiguous: At dataclass construction time (when the @dataclass decorator inspects and enhances the class): for field in fields: if descriptor := getattr(field, 'descriptor'): setattr

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: Agreed on everything but that last part, which I'm not sure I understand: > If we allow descriptor to accept an iterable as well you could have multiple > descriptors just like normal. Could you give an example of what you mean with a regular class? I've had

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: Scratch that last one, it leads to problem when mixing descriptors with actual default values: @dataclass class Foo: bar = field(default=some_descriptor) # technically this is a descriptor field without a default value or at the very least, the dataclass

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: Thinking a little more about this, maybe a different solution would be to have default values be installed at the class level by default without being overwritten in the init, as is the case today. default_factory should keep being set in the init as is the case

[issue39247] dataclass defaults and property don't work together

2021-10-21 Thread Thomas
Thomas added the comment: Hello everyone, A quick look on SO and Google + this python issue + this blog post and its comments: https://florimond.dev/en/posts/2018/10/reconciling-dataclasses-and-properties-in-python/ show that this is still a problem where dataclass users keep hitting

[issue25625] "chdir" Contex manager for pathlib

2021-10-20 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert nosy_count: 10.0 -> 11.0 pull_requests: +27360 pull_request: https://github.com/python/cpython/pull/29091 ___ Python tracker <https://bugs.python.org/issu

[issue29941] Confusion between asserts and Py_DEBUG

2021-10-18 Thread Thomas Wouters
Change by Thomas Wouters : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue29941> ___ ___ Python-bugs-list

[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread Thomas Wouters
Thomas Wouters added the comment: Victor, what's the benefit of doing this work? Are there real problems this fixes? I'm worried about the churn in third-party extensions, examples, tutorials, etc, especially for audiences that upon seeing a compiler error won't immediately realise

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Thomas Grainger
Thomas Grainger added the comment: it's as part of this discussion in https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6 and others in #python-dev specifically https://github.com/python/cpython/blob

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +27181 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28886 ___ Python tracker <https://bugs.python.org/issu

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- assignee: docs@python components: Documentation nosy: docs@python, graingert priority: normal severity: normal status: open title: delete misleading faq entry about atomic operations ___ Python tracker <ht

[issue45423] SSL SNI varies when host contains port number

2021-10-10 Thread Thomas Hobson
New submission from Thomas Hobson : Not entirely sure if this is intended. When using urllib.request.urlopen, with a hostname and a varying port the SNI information sent differs. To my undersnding, the SNI info shouldn't include the port and should only include the actual host. Attached

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-07 Thread Thomas Grainger
Thomas Grainger added the comment: afaik this is intentional https://bugs.python.org/issue31033 -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue45

[issue45279] avoid redundant _commit_removals pending_removals guard

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +26930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28546 ___ Python tracker <https://bugs.python.org/issu

[issue45279] avoid redundant _commit_removals pending_removals guard

2021-09-24 Thread Thomas Grainger
New submission from Thomas Grainger : refactor to avoid redundant _commit_removals pending_removals guard -- components: Library (Lib) messages: 402554 nosy: graingert priority: normal severity: normal status: open title: avoid redundant _commit_removals pending_removals guard versions

[issue45278] RuntimeError on race on weakset concurrent iteration

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue45278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +26925 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28541 ___ Python tracker <https://bugs.python.org/issu

[issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic

2021-09-24 Thread Thomas Grainger
New submission from Thomas Grainger : the weak collections should have the same threadsafe/thread unsafe guarantees as their strong reference counterparts - eg dict.copy and set.copy are atomic and so the weak versions should be atomic also -- components: Interpreter Core, asyncio

[issue45259] No _heappush_max()

2021-09-21 Thread Thomas
Change by Thomas : -- versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue45259> ___ ___

[issue45259] No _heappush_max()

2021-09-21 Thread Thomas
Change by Thomas : -- nosy: +rhettinger, stutzbach -ThomasLee94 ___ Python tracker <https://bugs.python.org/issue45259> ___ ___ Python-bugs-list mailin

[issue45259] No _heappush_max()

2021-09-21 Thread Thomas
New submission from Thomas : There is no heappush function for a max heap when the other supporting helper functions are already implemented (_siftdown_max()) -- components: Library (Lib) messages: 402351 nosy: ThomasLee94 priority: normal severity: normal status: open title

  1   2   3   4   5   6   7   8   9   10   >