[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-02 Thread Ronald Oussoren
Ronald Oussoren added the comment: Categories make it possible to add methods to an existing class, but not new attributes. The latter shouldn't be a problem in principle for an NSApplication subclass because only a single instance of the application class will get created and you may as

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-02 Thread Tzu-ping Chung
New submission from Tzu-ping Chung : Currently, decorating a coroutine with cached_property would cache the coroutine itself. But this is not useful in any way since a coroutine cannot be awaited multiple times. Running this code: import asyncio import functools class A:

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Chris Angelico writes: > On Thu, 3 Feb 2022 at 15:43, Cecil Westerhof via Python-list > wrote: >> >> Chris Angelico writes: >> >> >> > (Side point: The OP's code is quite inefficient, as it creates a new >> >> > thread for each reiteration, but there's nothing wrong with that if >> >> > you're

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Cecil Westerhof writes: > I need (sometimes) to repeatedly execute a function. For this I wrote > the below class. What do you think about it? I wrote some unit test for the class. Is this the correct way to do this? For example in test_correct_params_no_start I check four things. Some people

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
2qdxy4rzwzuui...@potatochowder.com writes: > FWIW, I'd find some way to tell users the units (seconds, milliseconds, > fortnights, etc.) instead of making them wade through your code to find > the call to (and possibly the [broken] help text of) Timer. You mean with docstring? -- Cecil

[issue45629] Tools/freeze needs tests in the test suite.

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 8726067ace98a27557e9fdf1a8e1c509c37cfcfc by Gregory P. Smith in branch 'main': bpo-45629: Improve test.support.skip_if_buildbot (GH-31094) https://github.com/python/cpython/commit/8726067ace98a27557e9fdf1a8e1c509c37cfcfc --

[issue46621] Should map(function, iterable, ...) replace StopIteration with RuntimeError?

2022-02-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 for being a breaking change, for addressing a minor issue that rarely arises in real life, and for being a slippery slope. -- nosy: +rhettinger ___ Python tracker

[issue45629] Tools/freeze needs tests in the test suite.

2022-02-02 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith nosy_count: 2.0 -> 3.0 pull_requests: +29280 pull_request: https://github.com/python/cpython/pull/31094 ___ Python tracker

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 15:43, Cecil Westerhof via Python-list wrote: > > Chris Angelico writes: > > >> > (Side point: The OP's code is quite inefficient, as it creates a new > >> > thread for each reiteration, but there's nothing wrong with that if > >> > you're looking for something simple.) >

[issue46621] Should map(function, iterable, ...) replace StopIteration with RuntimeError?

2022-02-02 Thread Peiran Yao
New submission from Peiran Yao : Currently, StopIteration raised accidentally inside the `function` being applied is not caught by map(). This will cause the iteration of the map object to terminate silently. (Whereas, when some other exception is raised, a traceback is printed pinpointing

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Chris Angelico writes: >> > (Side point: The OP's code is quite inefficient, as it creates a new >> > thread for each reiteration, but there's nothing wrong with that if >> > you're looking for something simple.) >> >> It is just something I wrote fast. How could I do this in a better way? > >

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 15:28, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-02-03 at 15:07:22 +1100, > Chris Angelico wrote: > > > On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > > > On 2022-02-03 at 12:39:43 +1100, > > > Cameron Simpson wrote: > > > > >

[issue46576] test_peg_generator is extremely slow

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset e8258608c28c65680253d0ca6167430e34c2fd87 by Miss Islington (bot) in branch '3.9': [3.9] [3.10] bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (GH-31015) (GH-31089) (GH-31093)

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset e8258608c28c65680253d0ca6167430e34c2fd87 by Miss Islington (bot) in branch '3.9': [3.9] [3.10] bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (GH-31015) (GH-31089) (GH-31093)

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 15:07:22 +1100, Chris Angelico wrote: > On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-02-03 at 12:39:43 +1100, > > Cameron Simpson wrote: > > > > > You have: > > > > > > def _check_interval(self, interval): > > > if not

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-02-03 at 12:39:43 +1100, > Cameron Simpson wrote: > > > You have: > > > > def _check_interval(self, interval): > > if not type(interval) in [int, float]: > > raise TypeError('{} is not

[issue46576] test_peg_generator is extremely slow

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset f5ebec4d3e1199ec38b88920cfde8e460e5120dd by Gregory P. Smith in branch '3.10': [3.10] bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (GH-31015) (GH-31089)

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-02 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +29279 pull_request: https://github.com/python/cpython/pull/31093 ___ Python tracker

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset f5ebec4d3e1199ec38b88920cfde8e460e5120dd by Gregory P. Smith in branch '3.10': [3.10] bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (GH-31015) (GH-31089)

[issue46576] test_peg_generator is extremely slow

2022-02-02 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +29278 pull_request: https://github.com/python/cpython/pull/31093 ___ Python tracker

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 12:39:43 +1100, Cameron Simpson wrote: > You have: > > def _check_interval(self, interval): > if not type(interval) in [int, float]: > raise TypeError('{} is not numeric'.format(interval)) > > This check is better written: > > if not

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

2022-02-02 Thread Eryk Sun
Eryk Sun added the comment: In case you missed it, I implemented _Py_CreateFile2() in bpo-46506 and rewrote os.stat() based on it. Check it out in case you're interested in moving forward with a PR in bpo-46506. For this issue, follow_symlinks is fairly simple to support with

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset fafd2dadf63973a04f5693e5be19f3e7521c10d4 by Terry Jan Reedy in branch '3.9': [3.9] bpo-45975: Use walrus operator for some idlelib while loops (GH-31083) https://github.com/python/cpython/commit/fafd2dadf63973a04f5693e5be19f3e7521c10d4

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Cameron Simpson writes: > You have: > > def _check_interval(self, interval): > if not type(interval) in [int, float]: > raise TypeError('{} is not numeric'.format(interval)) > > This check is better written: > > if not isinstance(interval, (int,float)): > > which

[issue46620] Documentation of ipaddress behavior for prefix length with leading zeros.

2022-02-02 Thread Kenta Tsuna
New submission from Kenta Tsuna : ipaddress library tolerate the prefix length with leading zeros. $ ./python.exe Python 3.11.0a4+ (heads/main:8fb3649450, Jan 31 2022, 16:39:46) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin Type "help", "copyright", "credits" or "license" for more information.

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 13:32, Avi Gross via Python-list wrote: > > Jen, > > I would not be shocked at incompatibilities in the system described making it > hard to exchange anything, including text, but am not clear if there is a > limitation of four bytes in what can be shared. For me, a

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Avi Gross via Python-list
Jen, I would not be shocked at incompatibilities in the system described making it hard to exchange anything, including text, but am not clear if there is a limitation of four bytes in what can be shared. For me, a character string can use any number of contiguous bytes in memory that some

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +29277 pull_request: https://github.com/python/cpython/pull/31092 ___ Python tracker ___

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset 2ddc278875f789de622262ee8ff5a1c3788f031c by Miss Islington (bot) in branch '3.10': bpo-45975: Use walrus operator for some idlelib while loops (GH-31083) https://github.com/python/cpython/commit/2ddc278875f789de622262ee8ff5a1c3788f031c

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 12:24, Cecil Westerhof via Python-list wrote: > > Chris Angelico writes: > > > On Thu, 3 Feb 2022 at 09:33, Barry wrote: > > (Side point: The OP's code is quite inefficient, as it creates a new > > thread for each reiteration, but there's nothing wrong with that if > >

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +29276 pull_request: https://github.com/python/cpython/pull/31091 ___ Python tracker

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cameron Simpson
You have: def _check_interval(self, interval): if not type(interval) in [int, float]: raise TypeError('{} is not numeric'.format(interval)) This check is better written: if not isinstance(interval, (int,float)): which handles subclasses of these types (but note that

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 51a95be1d035a717ab29e98056b8831a98e61125 by Nick Drozd in branch 'main': bpo-45975: Use walrus operator for some idlelib while loops (GH-31083) https://github.com/python/cpython/commit/51a95be1d035a717ab29e98056b8831a98e61125 --

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Cecil Westerhof writes: >> (regardless of your OS). The same could be done with this timer; an >> __exit__ method would make a lot of sense here, and would allow the >> timer to be used in a with block to govern its execution. (It also >> isn't really necessary, but if you want a good Pythonic

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Chris Angelico writes: > On Thu, 3 Feb 2022 at 09:33, Barry wrote: > (Side point: The OP's code is quite inefficient, as it creates a new > thread for each reiteration, but there's nothing wrong with that if > you're looking for something simple.) It is just something I wrote fast. How could I

[issue46619] lazy module property not recognized by doctests

2022-02-02 Thread Jason R. Coombs
New submission from Jason R. Coombs : Attempting to define a lazy-loaded property for a module, I found [this guidance](https://stackoverflow.com/a/52018676/70170) referencing [module attribute access](https://docs.python.org/3/reference/datamodel.html#customizing-module-attribute-access)

[issue46197] ensurepip bootstrap breaks out of isolated environment

2022-02-02 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the report and PR. The workflow would be to merge a fix to the main branch for 3.11, then there’s a bot that makes backports for active branches (3.10 and 3.9). More info: https://devguide.python.org/ -- nosy: +eric.araujo

[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-02 Thread Inada Naoki
Inada Naoki added the comment: I didn't mean _Py_abspath is problem. I just used it to describe why -O0 and -Og is so different. We can reduce stack usage of it easily, but it is not a problem than _PyEval_EvalFrameDefault. It is difficult to reduce stack usage of _PyEval_EvalFrameDefault

[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43478] Disallow Mock spec arguments from being Mocks

2022-02-02 Thread Matthew Suozzo
Change by Matthew Suozzo : -- pull_requests: +29275 pull_request: https://github.com/python/cpython/pull/31090 ___ Python tracker ___

[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Matthew Stidham
Matthew Stidham added the comment: the problem was a file in our library screwing up the python configuration -- stage: -> resolved status: open -> closed ___ Python tracker

[issue45819] Avoid releasing the GIL in nonblocking socket operations

2022-02-02 Thread jakirkham
Change by jakirkham : -- nosy: +jakirkham ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 09:33, Barry wrote: > > > > > On 2 Feb 2022, at 21:12, Marco Sulla wrote: > > > > You could add a __del__ that calls stop :) > > Didn’t python3 make this non deterministic when del is called? > > I thought the recommendation is to not rely on __del__ in python3 code. >

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-02 Thread Eric Snow
Eric Snow added the comment: FYI, I've posted to python-dev for feedback before proceeding: https://mail.python.org/archives/list/python-...@python.org/thread/DNMZAMB4M6RVR76RDZMUK2WRLI6KAAYS/ -- ___ Python tracker

[issue46618] Exponent operator(**) interpreter issue

2022-02-02 Thread Tim Peters
Tim Peters added the comment: Exponentiation has higher precedence (binds more tightly) than unary minus, so the expression groups as -(2**2). Virtually all computer languages (those that _have_ an exponentiation operator) do the same. For example, here from wxMaxima: (%i1) -2**2; (%o1) -4

[issue42238] Deprecate suspicious.py?

2022-02-02 Thread STINNER Victor
STINNER Victor added the comment: > https://pypi.org/project/sphinx-lint/ Congrats :-) -- ___ Python tracker ___ ___

[issue46618] Exponent operator(**) interpreter issue

2022-02-02 Thread koala-lava
New submission from koala-lava : If I put -2 ** 2 in the interpreter it outputs -4. Expected is 4. If I create a variable and initialize it with -2 and then try the same then it's correct. -- components: Interpreter Core messages: 412402 nosy: koala-lava priority: normal severity:

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Barry
> On 2 Feb 2022, at 21:12, Marco Sulla wrote: > > You could add a __del__ that calls stop :) Didn’t python3 make this non deterministic when del is called? I thought the recommendation is to not rely on __del__ in python3 code. Barry > >> On Wed, 2 Feb 2022 at 21:23, Cecil Westerhof via

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Barry
> On 2 Feb 2022, at 18:19, Jen Kris via Python-list > wrote: > > It's not clear to me from the struct module whether it can actually > auto-detect endianness. It is impossible to auto detect endian in the general case. > I think it must be specified, just as I had to do with

[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Eric V. Smith
Eric V. Smith added the comment: There's too much for us to look at here. Can you create a small example which demonstrates the problem? It should include the input, the code, the actual output, and the expected output. -- nosy: +eric.smith ___

[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Matthew Stidham
New submission from Matthew Stidham : The file which I found the error in is in https://github.com/greearb/lanforge-scripts -- components: C API files: debug from pandas failure.txt messages: 412400 nosy: matthewstidham priority: normal severity: normal status: open title: CSV

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Marco Sulla
You could add a __del__ that calls stop :) On Wed, 2 Feb 2022 at 21:23, Cecil Westerhof via Python-list wrote: > > I need (sometimes) to repeatedly execute a function. For this I wrote > the below class. What do you think about it? > from threading import Timer > > > > class

[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-02 Thread Marc Culler
Marc Culler added the comment: The TKApplication class is a subclass of NSApplication which adds both attributes and methods. Those are used throughout the macOS port of Tk, and as Ronald says, the unique instance of NSApplication in Tk is actually a TKApplication. Every macOS Application

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset 5765eaa13654e5f812a286700da7d6b8e144da0e by Miss Islington (bot) in branch '3.10': bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion (GH-31086)

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset 3c6173ca67c019f3eb7a2fc34c5bfc426f99c5b2 by Miss Islington (bot) in branch '3.9': bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion (GH-31086)

Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
I need (sometimes) to repeatedly execute a function. For this I wrote the below class. What do you think about it? from threading import Timer class repeated_timer(object): def __init__(self, fn, interval, start = False): if not callable(fn): raise

[issue46576] test_peg_generator is extremely slow

2022-02-02 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +29273 pull_request: https://github.com/python/cpython/pull/31089 ___ Python tracker ___

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-02 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +29274 pull_request: https://github.com/python/cpython/pull/31089 ___ Python tracker ___

[issue46576] test_peg_generator is extremely slow

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 164a017e13ee96bd1ea1ae79f5ac9e25fe83994e by Gregory P. Smith in branch 'main': bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (#31015)

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 164a017e13ee96bd1ea1ae79f5ac9e25fe83994e by Gregory P. Smith in branch 'main': bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (#31015)

[issue46550] __slots__ updates despite being read-only

2022-02-02 Thread Ronald Oussoren
Ronald Oussoren added the comment: There's a use case for using a dict for __slots__, pydoc will use a dict value for the slots as a mapping from attribute name to attribute documentation. Because of that it is not really worthwhile to transform the value of __slots__ during class

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +29272 pull_request: https://github.com/python/cpython/pull/31088 ___ Python tracker ___

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29271 pull_request: https://github.com/python/cpython/pull/31087 ___ Python tracker

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread Steve Dower
Steve Dower added the comment: New changeset 89a0a90c2e0e685bc70206fc45e4413c4f4411ed by Steve Dower in branch 'main': bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion (GH-31086)

[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-02 Thread Ned Deily
Ned Deily added the comment: Thanks for looking into this, Ronald. Before we close this as a Python issue, perhaps Marc might have a suggestion on what should be done here from a Tk perspective. -- nosy: +culler status: pending -> open ___ Python

[issue46607] Add DeprecationWarning to configparser's LegacyInterpolation

2022-02-02 Thread Hugo van Kemenade
Hugo van Kemenade added the comment: > > Other configparser deprecations were added in 3.2, but with > > DeprecationWarnings. > Its deprecation was never documented anywhere in Doc/. Correct, only in the docstring: ``` class LegacyInterpolation(Interpolation): """Deprecated

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Dennis Lee Bieber
On Wed, 2 Feb 2022 19:16:19 +0100 (CET), Jen Kris declaimed the following: >It's not clear to me from the struct module whether it can actually >auto-detect endianness.  I think it must be specified, just as I had to do >with int.from_bytes().  In my case endianness was dictated by how the

[issue45173] Remove configparser deprecations

2022-02-02 Thread miss-islington
miss-islington added the comment: New changeset ba4d79af32b6bb8378cb7003f67d6c4d413fbe89 by Hugo van Kemenade in branch '3.10': [3.10] bpo-45173: Note configparser deprecations will be removed in 3.12 (GH-31084)

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Jen Kris via Python-list
An ASCII string will not work.  If you convert 32894 to an ascii string you will have five bytes, but you need four.  In my original post I showed the C program I used to convert any 32-bit number to 4 bytes.  Feb 2, 2022, 10:16 by python-list@python.org: > I applaud trying to find the right

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread Steve Dower
Change by Steve Dower : -- keywords: +patch pull_requests: +29270 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31086 ___ Python tracker

[issue46615] Use-after-free by mutating set during set operations

2022-02-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: set1.isdisjoint(set2) also crashes -- ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Jen Kris via Python-list
It's not clear to me from the struct module whether it can actually auto-detect endianness.  I think it must be specified, just as I had to do with int.from_bytes().  In my case endianness was dictated by how the four bytes were populated, starting with the zero bytes on the left.  Feb 1,

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Avi Gross via Python-list
I applaud trying to find the right solution but wonder if a more trivial solution is even being considered. It ignores big and little endians and just converts your data into another form and back. If all you want to do is send an integer that fit in 32 bits or 64 bits, why not convert it to a

[issue46615] Use-after-free by mutating set during set operations

2022-02-02 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: Segfault in set intersection (&) and difference (-) -> Use-after-free by mutating set during set operations ___ Python tracker ___

[issue46616] test_importlib leaves stray registry entries on Windows

2022-02-02 Thread Steve Dower
New submission from Steve Dower : When running test_importlib.test_windows, it may create registry keys that previously didn't exist. These keys are not fully cleaned up. Detect if the full key is created and then delete it after the test. If it existed, only delete the specific test key.

[issue46615] Segfault in set intersection (&) and difference (-)

2022-02-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: replacing `return True` with `return random() < 0.5` makes *all* of the operations crash, except for `|` and `|=`. -- ___ Python tracker

[issue46615] Segfault in set intersection (&) and difference (-)

2022-02-02 Thread Dennis Sweeney
New submission from Dennis Sweeney : Maybe related to https://bugs.python.org/issue8420 Somewhat obscure, but using only standard Python, and no frame- or gc-hacks, it looks like we can get a use-after-free: from random import random BADNESS = 0.0 class Bad: def __eq__(self, other):

Re: http.client and dns lookups

2022-02-02 Thread Dieter Maurer
Michael Welle wrote at 2022-2-1 19:28 +0100: > ... >That doesn't happen when the 'real' issue occurs. Attaching strace to >the Python process I can see that resolv.conf is stat'ed and open'ed. I >guess now I'm more confused than before ;). There must be an additional >condition that I'm missing.

[issue24132] Direct sub-classing of pathlib.Path

2022-02-02 Thread Barney Gale
Change by Barney Gale : -- pull_requests: +29269 pull_request: https://github.com/python/cpython/pull/31085 ___ Python tracker ___

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35829] datetime: parse "Z" timezone suffix in fromisoformat()

2022-02-02 Thread Paul Ganssle
Paul Ganssle added the comment: I don't think it's necessary to add a feature to `isoformat()` just for the purpose of being able to add the corresponding parser, particularly when the plan is to implement a much broader ISO 8601 parser for Python 3.11 (I've done most of the implementation

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-02 Thread Paul Ganssle
New submission from Paul Ganssle : As part of bpo-35829, it was suggested that we add the ability to output the "Z" suffix in `isoformat()`, so that `fromisoformat()` can both be the exact functional inverse of `isoformat()` and parse datetimes with "Z" outputs. I think that that's not a

[issue45173] Remove configparser deprecations

2022-02-02 Thread Hugo van Kemenade
Change by Hugo van Kemenade : -- pull_requests: +29268 pull_request: https://github.com/python/cpython/pull/31084 ___ Python tracker ___

[issue45975] Simplify some while-loops with walrus operator

2022-02-02 Thread Nick Drozd
Change by Nick Drozd : -- keywords: +patch pull_requests: +29267 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31083 ___ Python tracker ___

[issue31582] Add _pth breadcrumb to sys.path documentation

2022-02-02 Thread Russel Webber
Change by Russel Webber : -- keywords: +patch pull_requests: +29265 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31082 ___ Python tracker

[issue42238] Deprecate suspicious.py?

2022-02-02 Thread Georg Brandl
Georg Brandl added the comment: Looks good. I should have rights automatically for everything in that org. -- ___ Python tracker ___

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Marek Scholle
Marek Scholle added the comment: > a += b means (is closest to) a = type(a).__iadd__(a, b) I exchanged several messages, and this is all I needed! I propose to resolve as "Not a bug" -- ___ Python tracker

[issue46613] Add PyType_GetModuleByDef to the public & limited API

2022-02-02 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +29264 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31081 ___ Python tracker ___

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Vedran Čačić
Vedran Čačić added the comment: You've managed to write 3 messages already, without at any point mentioning what _really_ happens when you += something. a += b means (is closest to) a = type(a).__iadd__(a, b) You focus all the time on __iadd__ call, disregarding that its result it

[issue45173] Remove configparser deprecations

2022-02-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset e8659b47dece5a272111c0af5e340c364a9f807b by Hugo van Kemenade in branch 'main': bpo-45173: Keep configparser deprecations until Python 3.12 (GH-30952) https://github.com/python/cpython/commit/e8659b47dece5a272111c0af5e340c364a9f807b

[issue46228] argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour

2022-02-02 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46101] argparse: using parents & subcommands, options can be ignored

2022-02-02 Thread paul j3
Change by paul j3 : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46613] Add PyType_GetModuleByDef to the public & limited API

2022-02-02 Thread Petr Viktorin
New submission from Petr Viktorin : _PyType_GetModuleByDef (added in bpo-42100)allows module state access from slot methods (like tp_init or nb_add), the main thing missing from PEP 573 (Module State Access from C Extension Methods). It's time to make it public. The function itself can be

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

2022-02-02 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42238] Deprecate suspicious.py?

2022-02-02 Thread Julien Palard
Julien Palard added the comment: Georg, I was able to move forward: - https://github.com/sphinx-contrib/sphinx-lint - https://pypi.org/project/sphinx-lint/ Does everything looks good to you? Next step would be to remove rstlint.py from Docs/tools and add a dependency to rstlint from the

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

2022-02-02 Thread paul j3
paul j3 added the comment: Duplicate of https://bugs.python.org/issue41255 Argparse.parse_args exits on unrecognized option with exit_on_error=False -- nosy: +paul.j3 resolution: -> duplicate stage: patch review -> resolved status: open -> closed

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Marek Scholle
Marek Scholle added the comment: I don't understand the comment https://bugs.python.org/issue46612#msg412374 >>> def f(): x ... >>> f() is OK, so x is something which can be evaluated inside nested function, it is a good target to be used in `x.__iadd__(iterable)`. That >>>

[issue46608] Exclude marshalled-frozen data if deep-freezing to save 300 KB space

2022-02-02 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Eric V. Smith
Eric V. Smith added the comment: The "evaluate the target" part causes the UnboundLocalError, just as in: >>> x=1 >>> def f(): ... x ... x = x + 1 ... >>> f() Traceback (most recent call last): File "", line 1, in File "", line 2, in f UnboundLocalError: local variable 'x'

  1   2   >