[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-23 Thread Tal Einat
Tal Einat added the comment: This is at least partly a tcl/tk issue. Using Terry's last example, the Text widget reports that the length of the line is 14 (t.index('1.end') -> '1.14'), despite it only including 11 characters. It appears that each emoji character adds an extra character.

[issue44154] Optimize Fraction pickling

2021-05-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Let me know if it's worth openning an issue with above improvement I don't think so. -- ___ Python tracker ___

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is fundamentally a tk text widget issue. Prior to fall 2019, attempts to insert an astral (non-BMP) chars in tkinter widgets raised a unicode decode exception. Then Serhiy fixed tkinter so that such chars could be displayed, either as the actual chars

[issue44222] Improving _removeHandlerRef for a very long _handlerList

2021-05-23 Thread Yonatan Goldschmidt
Change by Yonatan Goldschmidt : -- keywords: +patch pull_requests: +24918 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26325 ___ Python tracker

[issue44222] Improving _removeHandlerRef for a very long _handlerList

2021-05-23 Thread Yonatan Goldschmidt
New submission from Yonatan Goldschmidt : We have an application which creates 10,000s of logging.Logger & logging.Handler objects. I encountered a major slowdown during GCs which happen to collect dead Handler objects, calling logging._removeHandlerRef() along the way. That function looks

[issue44221] ImportError: sys.meta_path is None, Python is likely shutting down

2021-05-23 Thread Luiz Antonio Lazoti
New submission from Luiz Antonio Lazoti : hi, In certain situations I get this error, I believe it is related to evdev, select or inotify in line 715. ImportError: sys.meta_path is None, Python is likely shutting down -- components: asyncio files: events.py messages: 394228 nosy:

[issue44120] logging.config.fileConfig/dictConfig can not import class

2021-05-23 Thread Hiroaki Mizuguchi
Hiroaki Mizuguchi added the comment: > Then bar.logging is ambiguous. Yes, I agree. But this bug is happen new testcase that resolve 'foobar.baz.FooBarFormatter' when 'foo' module has 'import baz' statement or 'baz' variable. -- ___ Python

[issue44220] PyStructSequence_UnnamedField unavailable on Windows

2021-05-23 Thread John Nelson
New submission from John Nelson : The symbol "PyStructSequence_UnnnamedField" is not *explicitly* marked for export, causing it to be omitted from python3x.dll on Windows -- and thus unavailable to Windows extension modules. Attempting to use this symbol then fails at link time: test.obj :

[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-05-23 Thread David Edelsohn
David Edelsohn added the comment: How could release_sentinel() be structured to not call PyThread_release_lock()? This seems to be a situation where _PyThreadState_DeleteExcept() is deleting all thread states. thread__set_sentinel() sets release_sentinel() as its on_delete hook. The thread

[issue44194] Folding ''.join() into f-strings

2021-05-23 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > 1. It can be a str subclass with an overridden __format__. In this case the > result will be different. Thanks! Though this should be possible to do, so not a blocker for suggestion (if I am not missing something) > 2. If it is a str subclass without an

[issue44200] Recommend importlib.abc.Traversable users to implement __fspath__

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: CompatibilityFiles would use this. We could add a dispatch for that too, but that's 2 different cases now and `os.PathLike` would be able to handle both. -- ___ Python tracker

[issue44194] Folding ''.join() into f-strings

2021-05-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I only seen this idiom in the code of Argument Clinic (written by Larry). I am sure that it is used in third-party code, but I do not know how common is it. As for the proposed code, checking that the value is a string is not enough. 1. It can be a str

[issue43207] InspectLoader.is_package is not an abstract method

2021-05-23 Thread miss-islington
miss-islington added the comment: New changeset 069bc4f5b45b28c7685d01c2b86659887f33f804 by Miss Islington (bot) in branch '3.10': bpo-43207: InspectLoader.is_package is not an abstract method (GH-24517) https://github.com/python/cpython/commit/069bc4f5b45b28c7685d01c2b86659887f33f804

[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-05-23 Thread miss-islington
miss-islington added the comment: New changeset e394573c3c75d0611c4eb3f6e0018576ff911494 by Miss Islington (bot) in branch '3.10': bpo-44210: make importlib.metadata._meta.PackageMetadata public (GH-26299) https://github.com/python/cpython/commit/e394573c3c75d0611c4eb3f6e0018576ff911494

[issue44200] Recommend importlib.abc.Traversable users to implement __fspath__

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: > I think `as_file` should learn to behave like `path`, if `__fspath__` is > available, it will use that path. Oh, that's an interesting idea. And that's effectively what happens

[issue43207] InspectLoader.is_package is not an abstract method

2021-05-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +24916 pull_request: https://github.com/python/cpython/pull/26322 ___ Python tracker ___

[issue43207] InspectLoader.is_package is not an abstract method

2021-05-23 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24915 pull_request: https://github.com/python/cpython/pull/26321 ___ Python tracker

[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-05-23 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24914 pull_request: https://github.com/python/cpython/pull/26320 ___ Python tracker

[issue43643] importlib.readers.MultiplexedPath.name is not a property

2021-05-23 Thread Jason R. Coombs
Change by Jason R. Coombs : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44164] Document what are resources in importlib.resources

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've not previously seen a definition of resources. The original implementation of importlib_resources excluded 'directories' as resources and excluded support for resources being in subdirectories (only files in packages were allowed). Now resources can

[issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters

2021-05-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > What about closing this as third party? (Tcl/Tk is a dependency but still > it's a third party right?) Sure. I'll leave that for Terry or any of the other IDLE devs. We can adjust the resolution after close if needed. > Also what's up with this

[issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters

2021-05-23 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: Also what's up with this open-pending issue? -- status: open -> pending ___ Python tracker ___

[issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters

2021-05-23 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: What about closing this as third party? (Tcl/Tk is a dependency but still it's a third party right?) -- status: pending -> open ___ Python tracker

[issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters

2021-05-23 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters

2021-05-23 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- status: pending -> open title: [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters -> [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters ___ Python tracker

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > The smiley emoji  is U+1F600 which is outside of the Unicode Basic > Multilingual Plane (BMP). Correct, and this is documented: https://docs.python.org/3/library/idle.html#user-output-in-shell Suggesting to close this as not-a-bug. -- nosy:

[issue44200] Recommend importlib.abc.Traversable users to implement __fspath__

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: That's why I said it should be optional. If the object can implement it, it should. `pathlib.Path` certainly can, `zipfile.Path` can't, and that's alright. If the Traversable does not represent a path on the file-system, it does not make sense to implement

[issue44202] Add errors argument to importlib.abc.Traversable.read_text

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: It would be straightforward to add that parameter to `read_text` but I'm uncertain if it will be needed. Since a Traversable already provides an open method which _does_ explicitly pass through keyword arguments to the underlying opener, perhaps it would

[issue44200] Recommend importlib.abc.Traversable users to implement __fspath__

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: The problem with the `__fspath__` protocol is that it assumes a file system. The `importlib.resources` and `Traversable` protocols are trying to provide a lower-level interface that doesn't assume a file system. Fortunately, there already exists a helper

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: That makes sense, I wish all these details were documented, but it is more than enough precedent to choose to not add such enforcements to the specification. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: Having a look at the `open` function (https://docs.python.org/3/library/functions.html#open), it does not define which exceptions might be thrown. Similarly for pathlib.Path.open (https://docs.python.org/3/library/pathlib.html#pathlib.Path.open) and

[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-05-23 Thread Matthias Urlichs
New submission from Matthias Urlichs : Opening a file calls `isatty` which calls an ioctl with the GIL held. GDB: ``` #0 __GI___tcgetattr (fd=18, termios_p=termios_p@entry=0x7f618a5df920) at ../sysdeps/unix/sysv/linux/tcgetattr.c:38 #1 0x7f618bd1ca0c in __isatty (fd=) at

[issue44218] Possible Stack Based Buffer Overflow at Programs/_freeze_importlib.c

2021-05-23 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: It's not a Python problem at all. This was occurring in IDLE only. And yeah I know how it print the character. It's just that I was confused that why IDLE is behaving like that. I am happy to learn that it has a fix coming soon. --

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: The smiley emoji  is U+1F600 which is outside of the Unicode Basic Multilingual Plane (BMP). IDLE's underlying graphical toolkit, Tcl/Tk, has problems with Unicode characters outside of the BMP, so this may not be fixable by us. If all you want is to

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: Okay. Having a better look at it, I think we should only add this specification to open(). Traversable, by design, makes it totally plausible that open() cannot be performed. It could be a nonexistent path, the Traversable could represent object where open()

[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: We do implement the protocol, and not TraversableResources, in some places, such as DegenerateFiles for eg. It seems to me that maybe that is an issue and we actually want to inherit from TraversableResources. The question here is, are people supposed to be

[issue44218] Possible Stack Based Buffer Overflow at Programs/_freeze_importlib.c

2021-05-23 Thread Mohammed Dief
New submission from Mohammed Dief : When you open Programs/_freeze_importlib.c code, you will get the main function that gets executed when the C binary is running. That proves the first point that that's the function that is gonna be used when this code is getting built or used on other

[issue44216] Bug in class method with optional parameter

2021-05-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, this is working as the language is designed, and the behaviour occurs for all functions, not just class methods. Default values are only evaluated once, when the function is defined, not every time the function is called. This is even

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Shreyan Avigyan
Change by Shreyan Avigyan : -- versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Shreyan Avigyan
New submission from Shreyan Avigyan : In IDLE, suppose I want to print . I can write it like, print(b'\xf0\x9f\x98\x80'.decode()). I can't print it in console so I tried it in IDLE. It worked. Hurray! Hold on though. Now I thought how can I print  directly. So I used the command

[issue44216] Bug in class method with optional parameter

2021-05-23 Thread William Pickard
William Pickard added the comment: This is not a bug but a side-affect at how defaulted parameters are stored. The rule of thumb is to never use mutable values as default values for parameters. When a method is created in the Python runtime, it checks if the signature has defaulted keyword

[issue44216] Bug in class method with optional parameter

2021-05-23 Thread Ashish Shevale
New submission from Ashish Shevale : Consider the following piece of code class MyClass: def do_something(self, a, b = []): b.append(a) print("b contains", b) def caller(self): a = (1,2) self.do_something(a) a = MyClass().caller() a = MyClass().caller()

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: After reviewing the PR, I'm not convinced the Traversable methods need any specification about when to raise FileNotFoundError (or other exceptions). Let's flesh out what conditions demand prescribed interfaces. --

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2021-05-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +24913 pull_request: https://github.com/python/cpython/pull/26318 ___ Python tracker ___

[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: I don't believe a `TraversableReader` protocol was intended. Instead, the referenced change introduced the `TraversableResources` ABC. There's a typo in the docs. I created PR 26317 instead to correct the mistake. WDYT? --

[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +24912 pull_request: https://github.com/python/cpython/pull/26317 ___ Python tracker ___

[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Jeremy Kloth
Change by Jeremy Kloth : -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44215] help() module listing displays import warnings from deprecated package modules

2021-05-23 Thread Stefano Rivera
New submission from Stefano Rivera : Originally reported against pypy3 in Ubuntu https://bugs.launchpad.net/ubuntu/+source/pypy3/+bug/1920675 $ ./python Python 3.10.0a5+ (heads/master:ffa55d21b4, May 23 2021, 08:14:50) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or

[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are no problems with exposing _PyArg_ParseStack(). Although I am arguing that it would be better to rename it to _PyArg_ParseArray. But _PyArg_ParseStackAndKeywords() is more complicated. It uses a private structure _PyArg_Parser allocated on the

[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Ronald Oussoren
Change by Ronald Oussoren : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44214] PyArg_Parse* for vectorcall?

2021-05-23 Thread Ronald Oussoren
New submission from Ronald Oussoren : I'm currently converting some extensions of my own to vectorcall and an annoying change between the old call protocol and vectorcall is that the latter has no public equivalent to the PyArg_Parse family of functions. There is "_PyArg_ParseStack*" in the

[issue43223] [security] http.server: Open Redirection if the URL path starts with //

2021-05-23 Thread Hamza Avvan
Hamza Avvan added the comment: Requested review for the unit test few days ago. Please check. https://github.com/python/cpython/pull/24848 -- ___ Python tracker ___

[issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX

2021-05-23 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Closing as not-a-bug. Feel free to reopen if we've missed anything. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker