[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Oh I didn't see Pablo's message on the PR: > @Fidget-Spinner For next occasions, the problem with this is that > PyObject_GC_Del cannot be called like that because it overrides a bunch of > cleanups like the call to _Py_ForgetReference and other possible handling.

[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman
Ethan Furman added the comment: New changeset 9bf7c2d638a582af2444bc864feba13ab8957b68 by Ethan Furman in branch '3.10': [3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010) https://github.com/python/cpython/commit/9bf7c2d638a582af2444bc864feba13ab8957b68 -- __

[issue43474] http.server.BaseHTTPRequestHandler end_header() fails

2021-07-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: Why do you need to `end_headers()` before first doing `send_header()`? I guess the normal use should be: if headers: for h in headers: send_header(h) end_headers() -- nosy: +andrei.avk ___ Python tracker

[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +25570 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27010 ___ Python tracker ___ ___

[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman
New submission from Ethan Furman : >From the SC (was Re: Enum -- last call for comments on 3.10 changes) > The Steering Council discussed this topic at our meeting yesterday. We have > some > discomfort about the changes to En

[issue43418] FTPLib error when server returns byte message instead of string

2021-07-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: This is an issue with cowrie, I've commented on it here: https://github.com/cowrie/cowrie/issues/1394 . In short, cowrie overrides FTP class and opens `self.file` in binary mode. Various FTP methods will break or work incorrectly if `self.file` is in binary

[issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data

2021-07-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > So that seems to be about half a MB increase over 25 MB (about 2% relative > increase). I personally think that is acceptable, so I would be supportive of the patch but for context, many folks have indicated that they are worried about this size ge

[issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data

2021-07-03 Thread Gabriele N Tornetta
Gabriele N Tornetta added the comment: > That is a pointer size per code object. The most standard way is to calculate > the size of all pyc files in the stdlib after compiling them all with "-m > compileall -r 1000 Lib". This yields the following numbers between what was main when I branche

[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Woops, thanks for the quick fix Pablo. I'm guessing the takeaway here is that we should start tracking a GC-ed object as early as possible? -- ___ Python tracker __

[issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data

2021-07-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Is there a "standard" way for me to quantify the memory impact of these kinds > of changes? That is a pointer size per code object. The most standard way is to calculate the size of all pyc files in the stdlib after compiling them all with "-m comp

[issue35866] concurrent.futures deadlock

2021-07-03 Thread STINNER Victor
STINNER Victor added the comment: Great! I close the issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work

2021-07-03 Thread STINNER Victor
STINNER Victor added the comment: Good news: this change fixed bpo-35866 "concurrent.futures deadlock". -- ___ Python tracker ___ _

[issue35866] concurrent.futures deadlock

2021-07-03 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bug

[issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data

2021-07-03 Thread Gabriele N Tornetta
Gabriele N Tornetta added the comment: @pablogsal Commit a0252ab9add7d48e9e0604ebf97342e46cf00419 exposes co_qualname to Python. I've added a test case to check that the result coincides with the current implementation of __qualname__. Is there a "standard" way for me to quantify the memory

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Germán Méndez Bravo
Germán Méndez Bravo added the comment: Nils, unfortunately, fixing the MRO here won’t fix the issue because `TypedDict.__annotations__` in the class copies the annotations from the parent classes, and when the type evaluation is made, it’s made using the copied annotation found in the bottomm

[issue44553] types.Union should support GC

2021-07-03 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the fix, Pablo! Ken Jin, we learned something today! -- nosy: +Guido.van.Rossum ___ Python tracker ___

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 000b9e803a7ec067da0a43f9a3fec16f1078215a by Miss Islington (bot) in branch '3.10': bpo-44553: Correct failure in tp_new for the union object (GH-27008) (GH-27009) https://github.com/python/cpython/commit/000b9e803a7ec067da0a43f9a3fec16f10

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: > The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, > so that it can resolve the forward reference with the same globals as the > ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass > should then pass the

[issue15373] copy.copy() does not properly copy os.environment

2021-07-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think it may be good to deprecate and discourage use of `os.environ.copy()`, and add a new method `os.environ.asdict()`. And possibly have `__copy__` raise an error pointing users to `os.environ.asdict()`. I'm not sure what to do about pickling. -

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset bc3961485639cc73de7c4c7eed1b56f3c74939bf by Pablo Galindo in branch 'main': bpo-44553: Correct failure in tp_new for the union object (GH-27008) https://github.com/python/cpython/commit/bc3961485639cc73de7c4c7eed1b56f3c74939bf -

[issue44553] types.Union should support GC

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

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +25568 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27008 ___ Python tracker ___ ___

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue44553] types.Union should support GC

2021-07-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This commits seems to have broken the tracerefs buildbots: https://buildbot.python.org/all/#/builders/484/builds/322 https://buildbot.python.org/all/#/builders/678/builds/127 Please, take a look at soon as possible, otherwise per the buildbot policy we

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Germán Méndez Bravo
Germán Méndez Bravo added the comment: The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, so that it can resolve the forward reference with the same globals as the ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass should then pass the dict

[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-03 Thread Rupert Tombs
Change by Rupert Tombs : -- keywords: +patch pull_requests: +25567 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27007 ___ Python tracker ___ ___

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Daniel Fleischman
Daniel Fleischman added the comment: Thank you again, Dennis. I would disagree with your conclusion for mainly 3 reasons: 1. The linked list proposal would increase the memory usage by 2 Py_ssize_t per entry, plus another 2 for the whole dictionary. I don't think this is an overwhelming amo

[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-03 Thread Rupert Tombs
New submission from Rupert Tombs : operator.countOf behaves differently in its docstring and its c and python implementations when `is` and `==` differ. help(countOf) -> countOf(a, b, /) Return the number of times b occurs in a. This could be read to say that it returns equal to

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: OrderedDict already uses a linked list alongside a dictionary and meets all of your timing expectations, but has a higher memory usage, as linked lists generally do. Since so many Python objects use dictionaries under the hood, it would probably not be wort

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Daniel Fleischman
Daniel Fleischman added the comment: I think the idea of augmenting the struts to maintain a linked list of elements together with periodically shrinking on removal would solve both time and space issues, right? Space will be always linear, and operations would still be constant amortized

[issue44461] 'Pdb' object has no attribute 'botframe'

2021-07-03 Thread Irit Katriel
Irit Katriel added the comment: I've close PR26937 since we're not going for that. The test from it might still be useful, so I'm copying it here: def test_package_without_a_main(self): pkg_name = 't_pkg' module_name = 't_main' os_helper.rmtree(pkg_name) mo

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset 33022f9e86878c84c605de27aae4bd782ecb8da6 by Irit Katriel in branch '3.10': [3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27006) https://github.com/python/cpython/commit/33022f9e86878c84c605de27aae4bd782ecb8da6

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset 21be6cb0304ba143980b7e4c875cb5b9db30952b by Miss Islington (bot) in branch '3.9': bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27005) https://github.com/python/cpython/commit/21be6cb0304ba143980b7e4c875cb5b9db30952b -

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +25566 pull_request: https://github.com/python/cpython/pull/27006 ___ Python tracker ___

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

2021-07-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset d968a638fcbf9030c999cfacd4c9bf0656e779c4 by Irit Katriel in branch 'main': bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) https://github.com/python/cpython/commit/d968a638fcbf9030c999cfacd4c9bf0656e779c4 -- ___

[issue34266] Bad behavior with "restart \" or "restart "" in pdb

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

[issue35866] concurrent.futures deadlock

2021-07-03 Thread Jakub Wilk
Jakub Wilk added the comment: I can no longer reproduce the bug with Python from git. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue44501] Packing constant call arguments

2021-07-03 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > BTW, why do you not fold 2-argument calls? Seems like it is making stuff worse. > I suspect that in most of other examples the function execution time is too > large to make the optimization meaningful. This is (to some extent) a constant folding pass,

[issue44501] Packing constant call arguments

2021-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Great! Common examples are str.replace(), re.Match.groups() and __exit__(None, None, None). Common anti-patterns include slice(None, None, None) (why not slice(None)?) and datetime(1970, 1, 1) (it should be a global constant). I suspect that in most of ot

[issue44129] zipfile: Add descriptive global variables for general purpose bit flags

2021-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Daniel. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 ___ Python tracker

[issue44129] zipfile: Add descriptive global variables for general purpose bit flags

2021-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 556d5ad11fb380868c19beeba53d49f89c27f32d by Daniel Hillier in branch 'main': bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118) https://github.com/python/cpython/commit/556d5ad11fb380868c19beeba53d49f89c27f32

[issue43443] Should shelve support dict union?

2021-07-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25564 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27004 ___ Python tracker ___

[issue44501] Packing constant call arguments

2021-07-03 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > I am still not sure that it is worth to add 50 lines of the C code to > optimize 0.7% of calls. As I stated, the reason that this is 'relatively' lower is that there are just too many calls, so it just allocates a rather small part of the total pie. > D

[issue39100] email.policy.SMTP throws AttributeError on invalid header

2021-07-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: Anton: thanks for the report! In the message you say you are not sure of the solution, and because of that not sending a patch, but then you created the PR; - please clarify. -- nosy: +andrei.avk ___ Python tracke

[issue44557] It's a bug? Dict

2021-07-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug. Assignment in Python does not make a copy, it creates a second name for the same object. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue44557] It's a bug? Dict

2021-07-03 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This is not a bug since in this case assignment is referring to the same object and thus mutating one variable reflects change in other variable. Relevant FAQ : https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list

[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Thanks for the helpful review and merge Serhiy. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue44553] types.Union should support GC

2021-07-03 Thread miss-islington
miss-islington added the comment: New changeset 0856134542c1067d02c9027ddbb2a61916907e92 by Miss Islington (bot) in branch '3.10': bpo-44553 : Implement GC methods for types.Union (GH-26993) https://github.com/python/cpython/commit/0856134542c1067d02c9027ddbb2a61916907e92 -- __

[issue44557] It's a bug? Dict

2021-07-03 Thread Matheus Oliveira
New submission from Matheus Oliveira : a = {"a":1} b = a a["a"]=33 print(b, a) # {"a":33}, {"a":33} -- components: Interpreter Core messages: 396899 nosy: ymatheus63 priority: normal severity: normal status: open title: It's a bug? Dict type: resource usage versions: Python 3.8 ___

[issue44501] Packing constant call arguments

2021-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am still not sure that it is worth to add 50 lines of the C code to optimize 0.7% of calls. You have found 7 examples of function calls with 3 or 4 constant arguments. Does it include tests? Could you please show several (or several hundreds) non-te

[issue44553] types.Union should support GC

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

[issue44553] types.Union should support GC

2021-07-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1097384ce964dd63686b1aac706cd0fa764c2dc9 by Ken Jin in branch 'main': bpo-44553 : Implement GC methods for types.Union (GH-26993) https://github.com/python/cpython/commit/1097384ce964dd63686b1aac706cd0fa764c2dc9 -- nosy: +serhiy.stor

[issue44539] Imghdr JPG Quantized

2021-07-03 Thread Felipe Rodrigues
Change by Felipe Rodrigues : -- nosy: +fbidu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue37195] test_utime fails on MacOS Mojave (Kernel Version 18.6.0:)

2021-07-03 Thread Felipe Rodrigues
Felipe Rodrigues added the comment: Hi all! I'm seeing the same error that @pablogsal saw here, but I'm on Linux Mint 20.1 x86_64 (Kernel 5.4.0-77): ./python -m test test_os -R : -v == CPython 3.11.0a0 (heads/pr_26964:d375c08c75, Jul 3 2021, 07:47:01) [GCC 9.3.0] == Linux-5.4.0-77-generic-x

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-03 Thread ROpdebee
ROpdebee added the comment: It also lacks the __module__ attribute, causing it to be unusable in PEP 593 typing.Annotated types: from typing import Annotated x: Annotated[int | str, 'test'] Traceback (most recent call last): File "", line 1, in File "/Users/ruben/.pyenv/versions/3.10.0b

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: Alternate idea: the dict could shrink, if required, on the iter() call, whenever a keys/values/items iterator is initialized. -- ___ Python tracker

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: > Can https://bugs.python.org/issue32623 be a fix (or mitigation) of this issue? If such a change is implemented and dictionaries shrink when their fill falls below 1/8, the behavior of `while d: del d[next(iter(d))]` will remain quadradic: there will be `ma

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Inada Naoki
Inada Naoki added the comment: Can https://bugs.python.org/issue32623 be a fix (or mitigation) of this issue? -- ___ Python tracker ___ ___

[issue42238] Deprecate suspicious.py?

2021-07-03 Thread Julien Palard
Julien Palard added the comment: New changeset 01331f1a3cf86fd308e9a134bb867bf01fb191f5 by Julien Palard in branch 'main': bpo-42238: rstlint: Add two new checks. (GH-26966) https://github.com/python/cpython/commit/01331f1a3cf86fd308e9a134bb867bf01fb191f5 -- ___

[issue44550] Spam

2021-07-03 Thread Mark Dickinson
Change by Mark Dickinson : -- title: DIGITAL CLASSROOM -> Spam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: