[issue38440] Possible new issues with IDLE

2019-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've twice observed another bit of flakey behavior. When editing a line in a shell session, the cursor arrow keys start emitting mac's ? special symbol character. I'll look to see if I can find a reproducer for this as well. --

[issue36321] Fix misspelled attribute name in namedtuple()

2019-10-19 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +16405 pull_request: https://github.com/python/cpython/pull/16858 ___ Python tracker ___

[issue38533] py script runs with python.exe but not pythonw.exe (python console)

2019-10-19 Thread Jon
Jon added the comment: by the way, just to be sure, I am actually running the python.exe / py.exe / pythonw.exe / pyw.exe from the full file path just to be sure. e.g. %LOCALAPPDATA%\Programs\Python\Launcher\pyw.exe test.py -- ___ Python

[issue38533] py script runs with python.exe but not pythonw.exe (python console)

2019-10-19 Thread Jon
New submission from Jon : 3.7.5. Any py script that I run with python.exe or py.exe executes just fine. But if I try to run any py script with pythonW.exe or pyW.exe it will not run. I don't know where the logging for the python executable is located. On the same machine, java.exe and

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: With the new approach, there is no measurable different in performance: venv ❯ pyperf compare_to json/2019-10-19_20-01-master-24dc2f8c5669.json.gz json/2019-10-20_01-32-suggestions2-21404456383b.json.gz -G Slower (3): - 2to3: 400 ms +- 2 ms -> 405 ms

[issue38531] argparse action "extend" not documented as new

2019-10-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38532] Missing decrefs in the _ctypes module

2019-10-19 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +16404 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16857 ___ Python tracker ___

[issue38532] Missing decrefs in the _ctypes module

2019-10-19 Thread Zackery Spytz
New submission from Zackery Spytz : In PyCFuncPtr_FromDll(), there are two missing calls to Py_DECREF() if PySys_Audit() fails! -- components: Extension Modules messages: 354980 nosy: ZackerySpytz priority: normal severity: normal status: open title: Missing decrefs in the _ctypes

[issue38529] Python 3.8 improperly warns about closing properly closed streams

2019-10-19 Thread Caleb Hattingh
Change by Caleb Hattingh : -- nosy: +cjrh ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have opened PR 16856 adding fields to the AttributeError and implementing the feature in PyErr_Display. -- ___ Python tracker ___

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +16403 pull_request: https://github.com/python/cpython/pull/16856 ___ Python tracker ___

[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: All fixed now, right? -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37759] Polish whatsnew for 3.8

2019-10-19 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +16402 pull_request: https://github.com/python/cpython/pull/16854 ___ Python tracker ___

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be better to change an AttributeError to TypeError? Seems this is the only place in the core when missing special method causes an AttributeError and not TypeError. -- nosy: +serhiy.storchaka ___

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2019-10-19 Thread Steve Dower
Steve Dower added the comment: Bumping this - it's bitten me a couple of times as one of the build/release scripts relies on Path.glob(). -- versions: +Python 3.9 -Python 3.6 ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > But the problem is that making a reference to the object we can prolong its > lifetime and even create a reference loop. If I'm not mistaken, as long as the traceback is alive, the object is alive beacuse the frames will contain it. The other case

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg354974 ___ Python tracker ___ ___ Python-bugs-list

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > But the problem is that making a reference to the object we can prolong its > lifetime and even create a reference loop. If I'm not mistaken, as long as the traceback is alive, the object is alive beacuse the frames will contain it. The other case

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue18156, issue22716 and PEP 473. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Why private? They should be public. I was suggesting orivate for now until the/a PEP to modify the exception is approved. In this way we could try to implement the feature that way. -- On the other hand do you see any way to make the current

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why private? They should be public. But the problem is that making a reference to the object we can prolong its lifetime and even create a reference loop. There was a proposition to create a weak reference, but not all types support weak reference.

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I will also repeat the pyperformance results locally just in case something was off on the speed.python.org server. -- ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Serhiy, do you think we could attach the object and the name to some private fields of the AttributeError and check that in sys.excepthook if they are present? -- ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am surprised that it was SO expensive. Pathlib would largely benefit from cached_property if it be compatible with slots. -- ___ Python tracker

[issue38433] 2.7.17rc1 tcl/tk version regression on Windows

2019-10-19 Thread Steve Dower
Steve Dower added the comment: Confirmed that it was a failed clean/rebuild on my build machine. The current build for 2.7.17 has the newer version. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue38531] argparse action "extend" not documented as new

2019-10-19 Thread Christoph Zwerschke
New submission from Christoph Zwerschke : A new action "extend" has been added to argparse in https://github.com/python/cpython/commit/aa32a7e1116f7aaaef9fec453db910e90ab7b101 The documentation should specify that this is new in Python 3.8 addition. I wondered why it didn't work in Python

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK there is existing issue for this idea. I have doubts about performance. I added _PyObject_LookupAttr in particularly to avoid an overhead of raising and silencing an AttributeError. I believe most performance sensitive code in the core now uses it

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Slower (27): - pathlib: 25.2 ms +- 0.4 ms -> 105 ms +- 2 ms: 4.18x slower (+318%) - sympy_str: 315 ms +- 3 ms -> 500 ms +- 3 ms: 1.59x slower (+59%) - sympy_sum: 203 ms +- 2 ms -> 286 ms +- 2 ms: 1.41x slower (+41%) - sqlalchemy_imperative: 36.5 ms +-

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Closing this. Thanks, Dong-hee Na and everyone involved in the issue! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue38525] Strange reversed dict behavior

2019-10-19 Thread miss-islington
miss-islington added the comment: New changeset d73205d788a32148ba9a2beaa27badbd94ab65ff by Miss Islington (bot) in branch '3.8': bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)

[issue38520] There is no proper way to know if a process is the main one

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38525] Strange reversed dict behavior

2019-10-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +16401 pull_request: https://github.com/python/cpython/pull/16853 ___ Python tracker ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 24dc2f8c56697f9ee51a4887cf0814b6600c1815 by Pablo Galindo (Dong-hee Na) in branch 'master': bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am running pyperformance to check the performance cost of this. -- ___ Python tracker ___

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Idea: we could only do this in interactive mode if we consider that is expensive enough. -- ___ Python tracker ___

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Ruby has it integrated into the core : https://bugs.ruby-lang.org/issues/11252 . It was initially a gem that got merged into core. > methosd undefined local variable or method `methosd' for main:Object Did you mean? methods method

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am not super convinced that this is a great idea because it has some performance cost (although somewhat controlled) but I want to open a discussion. -- ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Batuhan
Change by Batuhan : -- nosy: +james ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Batuhan
Batuhan added the comment: It already exists as a 3rd party module and it would be really cool to have this in core level. https://github.com/dutc/didyoumean (by James Powell) -- nosy: +BTaskaya ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +serhiy.storchaka, vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: PR 16850 shows an initial prototype for the idea -- ___ Python tracker ___ ___

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +16400 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16850 ___ Python tracker

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : To improve the debugging experience in both interactive and non-interactive code, I propose to offer suggestions when attribute access fails. For example: >>> class A: foo = None ... >>> A.fou Traceback (most recent call last): File "", line 1,

[issue38529] Python 3.8 improperly warns about closing properly closed streams

2019-10-19 Thread Ron Frederick
New submission from Ron Frederick : In testing AsyncSSH against Python 3.8, I noticed a large number of the following errors, even though I was properly closing streams before the objects holding them were garbage-collected. An open stream object is being garbage collected; call

[issue38528] Docs for 2.7 version switcher still shows 3.8 as pre

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Thanks for thre report. I overlooked 2.7 when updating the version switcher; the change will appear over the next 24 hours or so as the on-line docs get fully rebuilt. > Also, 2.7 docs version switcher at the moment show `dev (3.9)` for 3.9 > whereas the 3.8

[issue38528] Docs for 2.7 version switcher still shows 3.8 as pre

2019-10-19 Thread Julin
Julin added the comment: A PR (16848) has been opened now for the change for pre (3.8) to `3.8.0`. Is the same acceptable for `3.9`? -- ___ Python tracker ___

[issue38528] Docs for 2.7 version switcher still shows 3.8 as pre

2019-10-19 Thread Julin
New submission from Julin : The version switcher in the docs for Python2.7 still shows version 3.8 as `pre (3.8)`. Can we change it to `3.8.0` to mirror that in docs of 3.8? Also, 2.7 docs version switcher at the moment show `dev (3.9)` for 3.9 whereas the 3.8 docs say `3.9.0a0` can it be

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Inada Naoki
Inada Naoki added the comment: When dict is empty, di_pos of reverse iterator must be -1, not 0. Additionally, di_pos must be initialized from ma_used when dict is key sharing dict. diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 64876e0519..6c4b41700b 100644 ---

[issue38514] pathlib's mkdir documentation improvement

2019-10-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: FYI c = A(0, 1) print(type(c.__dict__)) print(list(iter(c.__dict__))) print(list(reversed(c.__dict__))) works as we expected. -- ___ Python tracker

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: > The proposed fix fixes a crash, but there is other bug in iterating shared > dicts. Yes, you are right. But I can not work on this issue today. (I have to finalize my paperwork by today :-() since priority is critical if other core developers finalize this

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed fix fixes a crash, but there is other bug in iterating shared dicts. class A: def __init__(self, x, y): if x: self.x = x if y: self.y = y a = A(1, 2) print(list(iter(a.__dict__))) print(list(reversed(a.__dict__))) b = A(1,

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: > Wops, we made a PR at the same time, Dong-hee Na. lol > I will close mine :) Oh.. thank you for giving me a chance. -- ___ Python tracker

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Wops, we made a PR at the same time, Dong-hee Na. I will close mine :) -- ___ Python tracker ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal, remi.lapeyre priority: normal -> critical ___ Python tracker ___ ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +16397 pull_request: https://github.com/python/cpython/pull/16847 ___ Python tracker ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +16396 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16846 ___ Python tracker ___

[issue33462] reversible dict

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +16399 pull_request: https://github.com/python/cpython/pull/16847 ___ Python tracker ___

[issue30040] Speedup empty dict creation and reduce its memory usage

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +16398 pull_request: https://github.com/python/cpython/pull/16847 ___ Python tracker ___

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue38517. For now we need to better document the use of __set_name__ with cached_property. -- ___ Python tracker ___

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread hongweipeng
hongweipeng added the comment: Is it possible to add an attrname parameter? It is more convenient to use. class cached_property: def __init__(self, func, attrname=None): self.attrname = attrname ... cls.age3 = cached_property(age, 'age3') --

[issue38527] configure script fails to detect "float word ordering" on Solaris

2019-10-19 Thread Arnon Yaari
Change by Arnon Yaari : -- keywords: +patch pull_requests: +16395 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16845 ___ Python tracker ___

[issue38527] configure script fails to detect "float word ordering" on Solaris

2019-10-19 Thread Arnon Yaari
New submission from Arnon Yaari : When running the configure script on Solaris SPARC (versions 10 and 11), the script fails with the following error: checking whether float word ordering is bigendian... unknown configure: error: Unknown float word ordering. You need to manually

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: Can I take look at this issue? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: >>> reversed({}.items()) >>> a = reversed({}.items()) >>> next(a) Assertion failed: (value != NULL), function dictreviter_iternext, file Objects/dictobject.c, line 3834. [1]4106 abort ./python.exe -- ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: This issue is related to reversed dict iter. >>> a = reversed({}) >>> next(a) Assertion failed: (value != NULL), function dictreviter_iternext, file Objects/dictobject.c, line 3834. [1]1366 abort ./python.exe -- nosy: +corona10

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38526] zipfile.Path has the wrong method name

2019-10-19 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This looks like a valid issue to me. The docs were added with issue36832. -- nosy: +jaraco, xtreak type: -> behavior versions: +Python 3.9 ___ Python tracker

[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2019-10-19 Thread Caleb Hattingh
Change by Caleb Hattingh : -- nosy: +cjrh ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38526] zipfile.Path has the wrong method name

2019-10-19 Thread Alex Walters
New submission from Alex Walters : https://docs.python.org/3.8/library/zipfile.html#zipfile.Path.listdir The docs for zipfile.Path list a method named 'listdir', the closest approximation to the functionality described in the actual code is a method named 'iterdir' -- assignee:

[issue37285] Python 2.7 setup.py incorrectly double-joins SDKROOT

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Thanks for the report and the PR (and sorry for the delay in responding). There were several problems with building on macOS without installed header files, which is no longer supported in the most recent Xcode / Command Line Tools releases, as well as a

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You have to call __set_name__() if you create a cached_property dynamically outside of the class namespace. p = cached_property(age) p.__set_name__(cls, 'age3') cls.age3 = p (And setattr() is not needed here.) -- nosy: +serhiy.storchaka

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +carljm, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Thanks for the report, by the way! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Outside of IDLE, the example causes a segfault. With debug build of current master HEAD: Assertion failed: (value != NULL), function dictreviter_iternext, file ../../source/Objects/dictobject.c, line 3834. if (d->ma_values) { if (i < 0) {

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ivan Bykov
New submission from Ivan Bykov : Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> list(reversed({1: 1})) [1] >>> list(reversed({}))

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: The documentation doesn't mention ``__set_name__``, but it does say that cached_property is useful for properties which are "effectively immutable". The ``__set_name__`` error message is pretty cryptic, that seems to have something to do with this PEP:

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread hongweipeng
New submission from hongweipeng : ``` from functools import cached_property def age(self): return 10 class A: def __init__(self): setattr(self.__class__, 'age', property(age)) setattr(self.__class__, 'age3', cached_property(age)) age2 = cached_property(age) a = A()