Fw: Flubbed it in the second interation through the string: range error... HOW?
The format in this email is not of my making, should someone know, how to do this so that it's a readable script do tell! KMW *** "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 - Forwarded Message ----- From: Kevin M. Wilson via Python-list To: python-list@python.org Sent: Tuesday, May 28, 2024 at 10:35:23 PM MDTSubject: Flubbed it in the second interation through the string: range error... HOW? The following is my effort to understand how to process a string, letter, by letter: def myfunc(name): index = 0 howmax = len(name) # while (index <= howmax): while (index < howmax): if (index % 2 == 0): print('letter to upper = {}, index {}!'.format(name[index], index)) name = name[index].upper() print('if block {} and index {}'.format(name[index], index)) elif (index % 2 > 0): print(index) print('Start: elseif block, index is {}, letter is {}'.format(index, name)) # print('letter to lower = {}'.format(name[index])) # print('Already lowercase do noting: name = {}'.format(name[index])) index += 1 # index = name.upper() return name myfunc('capitalism') Error message: Not making sense, index is 1, letter s/b 'a'letter to upper = c, index 0! if block C and index 0 1 Start: elseif block, index is 1, letter is C --- IndexError Traceback (most recent call last) Cell In[27], line 21 17 # index = name.upper() 19 return name ---> 21 myfunc('capitalism') Cell In[27], line 8, in myfunc(name) 6 while (index < howmax): 7 if (index % 2 == 0): > 8 print('letter to upper = {}, index {}!'.format(name[index], index)) 9 name = name[index].upper() 10 print('if block {} and index {}'.format(name[index], index)) IndexError: string index out of range*** So, I'm doing something... Stupid!! *** "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Flubbed it in the second interation through the string: range error... HOW?
The following is my effort to understand how to process a string, letter, by letter: def myfunc(name): index = 0 howmax = len(name) # while (index <= howmax): while (index < howmax): if (index % 2 == 0): print('letter to upper = {}, index {}!'.format(name[index], index)) name = name[index].upper() print('if block {} and index {}'.format(name[index], index)) elif (index % 2 > 0): print(index) print('Start: elseif block, index is {}, letter is {}'.format(index, name)) # print('letter to lower = {}'.format(name[index])) # print('Already lowercase do noting: name = {}'.format(name[index])) index += 1 # index = name.upper() return name myfunc('capitalism') Error message: Not making sense, index is 1, letter s/b 'a'letter to upper = c, index 0! if block C and index 0 1 Start: elseif block, index is 1, letter is C --- IndexErrorTraceback (most recent call last) Cell In[27], line 21 17 # index = name.upper() 19 return name ---> 21 myfunc('capitalism') Cell In[27], line 8, in myfunc(name) 6 while (index < howmax): 7 if (index % 2 == 0): > 8 print('letter to upper = {}, index {}!'.format(name[index], index)) 9 name = name[index].upper() 10 print('if block {} and index {}'.format(name[index], index)) IndexError: string index out of range*** So, I'm doing something... Stupid!! *** "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list
Re: Invalid literal for int() with base 10?
Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the base 10 paradigm involved?? years = int('y') # store for calculation ValueError: invalid literal for int() with base 10: 'y' What is meant by "invalid literal"? I'm trying to convert str to int, and I didn't know I needed to specify the base. Plus I haven't read anything that I need to specify the base for the int(). Attached is the code, showing the code and the execution of said code. Sorry, got pissed and didn't check all the content I sent! "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 On Thursday, May 25, 2023 at 05:55:06 PM MDT, Kevin M. Wilson via Python-list wrote: Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the base 10 paradigm involved?? years = int('y') # store for calculationValueError: invalid literal for int() with base 10: 'y'What is meant by "invalid literal"? I'm trying to convert srt to int, and I didn't know I needed to specify the base. Plus I haven't read anything that I need to specify the base for the int(). Attached is the code, showing the code and the execution of said code. "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
From geeksforgeeks.org, on converting the string created by the input() to an INT
We can first convert the string representation of float into float using float() function and then convert it into an integer using int().So, why can't a string of an integer be converted to an integer, via print(int(str('23.5')))??? Perplexed | print(int(float('23.5'))) | "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list
Invalid literal for int() with base 10?
Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the base 10 paradigm involved?? years = int('y') # store for calculationValueError: invalid literal for int() with base 10: 'y'What is meant by "invalid literal"? I'm trying to convert srt to int, and I didn't know I needed to specify the base. Plus I haven't read anything that I need to specify the base for the int(). Attached is the code, showing the code and the execution of said code. "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list
Three (3) >>> in the debug screen of PyCharm... Que Es over?!!
"When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Disable 'style PEP' messages
Hi... How do I set Pycharm to find only syntax errors?!! "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Editing PEP-8, in particular "expected 2 blanks, found 1
Folks, help please! What the @#$! are these doing popping up. Code styles are personal, and not subject to debate.Where can I edit these out of my IDE? Kevin "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
PyCharm's strict PEP and not so strict?
Greetings, I'm in a bit of a quandary, I want some strict syntax errors to be flagged, but the use of single quotes vs double quotes! NOT what I need from the 'checker', you dig? As I've recently returned to the IDE, and no longer have the "stones" for bull, how do I set up the kind of "checking" I want? Thank you, Kevin "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Re: Pycharm IDE
Ok, I got rid of the "print (f'"I am thinking of a number between 1 to {LIMIT}\n")"print ("I am thinking of a number between 1 to {LIMIT}\n"), and Pycharm stopped complaining about it... WHY?? Perplexed "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 On Tuesday, April 18, 2023 at 11:17:52 PM MDT, Kevin M. Wilson via Python-list wrote: print (f'"I am thinking of a number between 1 to {LIMIT}\n")I had the impression that the format specifier 'f' was necessary for the print function, but the double quotes are for the string printed to the user, as a prompt!The Pycharm IDE is showing that it expects a single quotation mark or ')'! No error message is displayed. Perplexed "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 On Tuesday, April 18, 2023 at 06:44:37 PM MDT, aapost wrote: On 4/18/23 19:18, Kevin M. Wilson wrote: >Why complain about a 'comma', or a ')'??? > print (f'"I am thinking of a number between 1 to {LIMIT}\n") my version says it expects ' first (to close the fstring) then on a new line below it, it mentions the comma and ) I believe that is just showing you after ' it expects you to end the print with ) as you have or , to add additional arguments to print -- https://mail.python.org/mailman/listinfo/python-list | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Re: Pycharm IDE
print (f'"I am thinking of a number between 1 to {LIMIT}\n")I had the impression that the format specifier 'f' was necessary for the print function, but the double quotes are for the string printed to the user, as a prompt!The Pycharm IDE is showing that it expects a single quotation mark or ')'! No error message is displayed. Perplexed "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 On Tuesday, April 18, 2023 at 06:44:37 PM MDT, aapost wrote: On 4/18/23 19:18, Kevin M. Wilson wrote: >Why complain about a 'comma', or a ')'??? > print (f'"I am thinking of a number between 1 to {LIMIT}\n") my version says it expects ' first (to close the fstring) then on a new line below it, it mentions the comma and ) I believe that is just showing you after ' it expects you to end the print with ) as you have or , to add additional arguments to print -- https://mail.python.org/mailman/listinfo/python-list | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Pycharm IDE
Greetings... Kevin here:I need help, as you have guessed!I have this line: The Print Statement... Why complain about a 'comma', or a ')'???def play_game(): number = random.randint(1, LIMIT) print (f'"I am thinking of a number between 1 to {LIMIT}\n")Or is this a setting in the IDE, I need to reassign? Regards, Perplexed "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Help, PyCharm fails to recognize my tab setting...See attached picture of the code.
C:\Users\kevin\PycharmProjects\Myfuturevalue\venv\Scripts\python.exe C:\Users\kevin\PycharmProjects\Myfuturevalue\FutureValueCal.py File "C:\Users\kevin\PycharmProjects\Myfuturevalue\FutureValueCal.py", line 31 elif (years > 50.0) or (years < 1.0) : ^IndentationError: expected an indented block after 'if' statement on line 29 Process finished with exit code 1 Good sense makes one slow to anger, and it is his glory tooverlook an offense. Proverbs 19:11 -- https://mail.python.org/mailman/listinfo/python-list
F-string usage in a print()
future_value = 0 for i in range(years): # for i in range(months): future_value += monthly_investment future_value = round(future_value, 2) # monthly_interest_amount = future_value * monthly_interest_rate # future_value += monthly_interest_amount # display the result print(f"Year = ", years + f"Future value = \n", future_value)When joining a string with a number, use an f-string otherwise, code a str() because a implicit convert of an int to str causes a TypeError!Well...WTF! Am I not using the f-string function correctly...in the above line of code??? Caddy Man Good sense makes one slow to anger, and it is his glory tooverlook an offense. Proverbs 19:11 -- https://mail.python.org/mailman/listinfo/python-list
Error at https://docs.python.org/3/search.html?q=f+string_keywords=yes=default
MS Edge settings are displayed in the first picture, the error I encountered is the second picture...not sure how I get around this!I reloaded the browser after checking the settings for JavaScript...confused. Kevin Good sense makes one slow to anger, and it is his glory tooverlook an offense. Proverbs 19:11 -- https://mail.python.org/mailman/listinfo/python-list
Pycharm IDE: seeking an assist!
Greetings Python coders, I have installed the Pycharm IDE, and upon successfully auto install of the path/environment statements. The IDE opened and displayed (bottom right corner): The use of Java options environment variables detected. Such variables override IDE configuration files (*.vmoptions) and may cause performance and stability issues. Please consider deleting these variables: _JAVA_OPTIONS. Now I've opened the installed .bat files...append.bat, format.bat, inspect.bat, itedit.bat, and pycharm.bat! Of the Five(5) listed above, only 'pycharm.bat' contains statements setting up the IDE' run environment, beyond Seven (7) lines. Having searched the 'pycharm.bat' file for "_JAVA_OPTIONS", and the 'pycharm64.exe.vmoptions' file as well. I was able to add the line '-Djava.net.preferIPv4Stack=False', reboot, and still no JOY. Message is still popping open, when the IDE first executes. No documentation have I found, details what this option, the setting of...will do! Any and all help, please! Kevin Good sense makes one slow to anger, and it is his glory to overlook an offense. Proverbs 19:11 -- https://mail.python.org/mailman/listinfo/python-list
[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes
Change by Kevin Locke : -- nosy: +kevinoid nosy_count: 10.0 -> 11.0 pull_requests: +29932 pull_request: https://github.com/python/cpython/pull/23172 ___ Python tracker <https://bugs.python.org/issue34624> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31975] Add a default filter for DeprecationWarning in __main__
Change by Kevin Locke : -- nosy: +kevinoid nosy_count: 7.0 -> 8.0 pull_requests: +29931 pull_request: https://github.com/python/cpython/pull/23172 ___ Python tracker <https://bugs.python.org/issue31975> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45991] Improve ambiguous docstrings in pkgutil
Kevin Hock added the comment: > Maybe instead a note could be put in the Pathlib doc noting functions that > accept path arguments might not accept Path objects? My concern with that is that someone using `pkgutil` wouldn't see it. However, I can see the argument that fixing the 'source' is better than each use. I'm not sure how wide-spread these kind of issues are to weigh in on how many 'uses' there are. If that makes sense. >Should pkgutil call os.fspath() in this case? I really like that idea. (I haven't contributed to CPython before, so I'll let someone else weigh in on if that is standard practice.) -- ___ Python tracker <https://bugs.python.org/issue45991> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45991] Improve ambiguous docstrings in pkgutil
Kevin Hock added the comment: At best it is ambiguous, with the class being confused with Str being called Path. Looking up "AttributeError: 'PosixPath' object has no attribute 'startswith'" gives a lot of results for similar issues, so I think the wording could be improved. -- ___ Python tracker <https://bugs.python.org/issue45991> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46774] Importlib.metadata.version picks first distribution not latest
Change by Kevin Kirsche : -- nosy: +kkirsche ___ Python tracker <https://bugs.python.org/issue46774> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46774] Importlib.metadata.version picks first distribution not latest
New submission from Kevin Kirsche : When using importlib.metadata.version with tools such as poetry which may install the current package one or more times, importlib.metadata.version is not deterministic in returning the latest version of the package, instead returning the first one located. As it's unclear if this behavior is desired by importlib, I'm creating this issue to determine if this is intentional behavior or a bug. I have opened the following poetry issue: * https://github.com/python-poetry/poetry/issues/5204 I have also created the following reproduction repository for the installation issue: https://github.com/kkirsche/poetry-remove-untracked When the after is modified to return the version, it returns the first one found (e.g. if you go 3.0.0 -> 3.0.1 -> 3.0.2, each would be installed and the library would return 3.0.0 to the caller) Thank you for your time and consideration. I apologize if this is not something that requires action by the Python team. I'd be open to trying to submit a PR, but want to verify whether this is intentional or not. -- components: Library (Lib) messages: 413375 nosy: kkirsche2 priority: normal severity: normal status: open title: Importlib.metadata.version picks first distribution not latest type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue46774> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46722] Different behavior for functiools.partial between inspect.isfunction() and other inspect.is*function()
Kevin Shweh added the comment: Frankly, it doesn't make sense that isgeneratorfunction or iscoroutinefunction unwrap partials at all. The original justification for making them do that back in https://bugs.python.org/issue34890 was invalid - the original argument was that isfunction unwraps partials, but it doesn't, and I don't think it ever did. isfunction is supposed to be a very specific check for Python function objects. It rejects all sorts of other callables, like sum (a built-in function), super (a type), or method objects (which wrap functions in a very similar way to partial). Having it be a check for *either* a Python function object *or* a partial object wrapping a Python function object seems to just make it less useful. -- nosy: +Kevin Shweh ___ Python tracker <https://bugs.python.org/issue46722> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46726] Thread spuriously marked dead after interrupting a join call
Kevin Shweh added the comment: The PR you submitted doesn't work, unfortunately. It essentially reintroduces issue 45274. If this line: if locked := lock.acquire(block, timeout): gets interrupted between the acquire and the assignment, locked is still False. That's rare, but so is an interruption between the acquire and the release, which is the original form of issue 45274. -- ___ Python tracker <https://bugs.python.org/issue46726> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46726] Thread spuriously marked dead after interrupting a join call
Kevin Shweh added the comment: Issue 45274 was a subtly different issue. That was a problem that happened if the thread got interrupted *between* the acquire and the release, causing it to *not* release the lock and *not* perform end-of-thread cleanup. The fix for that issue caused this issue, which happens if the thread gets interrupted *during* the acquire, in which case it *does* release the lock (that someone else is holding) and *does* perform end-of-thread cleanup even though it's not supposed to do either of those things. -- ___ Python tracker <https://bugs.python.org/issue46726> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46726] Thread spuriously marked dead after interrupting a join call
New submission from Kevin Shweh : This code in Thread._wait_for_tstate_lock: try: if lock.acquire(block, timeout): lock.release() self._stop() except: if lock.locked(): # bpo-45274: lock.acquire() acquired the lock, but the function # was interrupted with an exception before reaching the # lock.release(). It can happen if a signal handler raises an # exception, like CTRL+C which raises KeyboardInterrupt. lock.release() self._stop() raise has a bug. The "if lock.locked()" check doesn't check whether this code managed to acquire the lock. It checks if *anyone at all* is holding the lock. The lock is almost always locked, so this code will perform a spurious call to self._stop() if it gets interrupted while trying to acquire the lock. Thread.join uses this method to wait for a thread to finish, so a thread will spuriously be marked dead if you interrupt a join call with Ctrl-C while it's trying to acquire the lock. Here's a reproducer: import time import threading event = threading.Event() def target(): event.wait() print('thread done') t = threading.Thread(target=target) t.start() print('joining now') try: t.join() except KeyboardInterrupt: pass print(t.is_alive()) event.set() Interrupt this code with Ctrl-C during the join(), and print(t.is_alive()) will print False. -- components: Library (Lib) messages: 413106 nosy: Kevin Shweh priority: normal severity: normal status: open title: Thread spuriously marked dead after interrupting a join call type: behavior versions: Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46726> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32658] Metacharacter (\) documentation suggestion
Kevin Raeder added the comment: Sure! Thanks for paying attention to my suggestion. Kevin On Fri, Jan 21, 2022 at 10:42 AM mike mcleod wrote: > > mike mcleod added the comment: > > I would like to help with this issue. Is that acceptable? > > -- > nosy: +mikecmcleod > > ___ > Python tracker > <https://bugs.python.org/issue32658> > ___ > -- ___ Python tracker <https://bugs.python.org/issue32658> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43122] Python Launcher doesn't open a terminal window
Kevin added the comment: Many thanks for notifying me that my issue is fixed in the latest updates. I will try to test this soon. Kevin Weidenbaum > On Jan 3, 2022, at 1:59 AM, Ned Deily wrote: > > > Change by Ned Deily : > > > -- > Removed message: https://bugs.python.org/msg409563 > > ___ > Python tracker > <https://bugs.python.org/issue43122> > ___ -- ___ Python tracker <https://bugs.python.org/issue43122> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46085] OrderedDict iterator allocates di_result unnecessarily
Kevin Shweh added the comment: Almost - C's weird bitwise operator precedence means it has to be parenthesized as if ((kind & _odict_ITER_ITEMS) == _odict_ITER_ITEMS) -- ___ Python tracker <https://bugs.python.org/issue46085> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46085] OrderedDict iterator allocates di_result unnecessarily
New submission from Kevin Shweh : The OrderedDict iterator caches a di_result tuple for use with iter(od.items()). It's *supposed* to only do that for the items() case, but the code does if (kind & (_odict_ITER_KEYS | _odict_ITER_VALUES)) to test for this case. This is the wrong test. It should be if ((kind & _odict_ITER_KEYS) && (kind &_odict_ITER_VALUES)) The current test allocates di_result for key and value iterators as well as items iterators. -- components: Library (Lib) messages: 408616 nosy: Kevin Shweh priority: normal severity: normal status: open title: OrderedDict iterator allocates di_result unnecessarily type: resource usage versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46085> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45991] Improve ambiguous docstrings in pkgutil
New submission from Kevin Hock : # Issue If you search for "list of paths" in https://github.com/KevinHock/cpython/blob/main/Lib/pkgutil.py A lot of people mistake this as `PosixPath`. You can see an example here: https://github.com/duo-labs/parliament/pull/207 that references other OSS repositories. # Solution We can - Change the wording. e.g. "list of strings of the paths" or some variation of that. and perhaps additionally - Throw a ValueError similar to: https://github.com/python/cpython/blob/628abe4463ed40cd54ca952a2b4cc2d6e74073f7/Lib/pkgutil.py#L122 -- assignee: docs@python components: Documentation messages: 407727 nosy: docs@python, khock priority: normal severity: normal status: open title: Improve ambiguous docstrings in pkgutil type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45991> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45858] Deprecate default converters in sqlite3
Change by Kevin : -- nosy: +Strongbeard ___ Python tracker <https://bugs.python.org/issue45858> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26651] Deprecate register_adapter() and register_converter() in sqlite3
Change by Kevin : -- nosy: +Strongbeard ___ Python tracker <https://bugs.python.org/issue26651> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45756] mock raises exception when using a spec with an attribute that raises exception on access
New submission from Kevin Jamieson : In Python 3.8 and later creating a mock with a spec specifying an object containing a property that happens to raise an exception when accessed will fail, because _mock_add_spec calls getattr() on every attribute of the spec. This did not happen in Python 3.6/3.7. This is likely a fairly unusual scenario (and in the particular case where I encountered this I could just use a class instead of an instance for the spec), but it was surprising. For example: # cat test.py from unittest import mock class Foo: @property def bar(self) -> str: raise Exception('xxx') m = mock.MagicMock(spec=Foo()) # python3.11 test.py Traceback (most recent call last): File "/root/test.py", line 8, in m = mock.MagicMock(spec=Foo()) ^^ File "/usr/lib/python3.11/unittest/mock.py", line 2069, in __init__ _safe_super(MagicMixin, self).__init__(*args, **kw) ^^^ File "/usr/lib/python3.11/unittest/mock.py", line 1087, in __init__ _safe_super(CallableMixin, self).__init__( ^^ File "/usr/lib/python3.11/unittest/mock.py", line 442, in __init__ self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self) ^ File "/usr/lib/python3.11/unittest/mock.py", line 497, in _mock_add_spec if iscoroutinefunction(getattr(spec, attr, None)): ^ File "/root/test.py", line 6, in bar raise Exception('xxx') ^^ Exception: xxx -- messages: 405982 nosy: kjamieson priority: normal severity: normal status: open title: mock raises exception when using a spec with an attribute that raises exception on access type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45756> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45755] Mock spec with a specialized generic class does not mock class attributes
New submission from Kevin Jamieson : This worked in Python 3.6, but in Python 3.7 and later creating a mock with a spec specifying a subscripted generic class does not mock any of the attributes of the class, because those attributes are not returned by dir(). For example: # cat test.py from typing import Generic, TypeVar from unittest import mock T = TypeVar('T') class Foo(Generic[T]): def bar(self) -> None: pass m = mock.MagicMock(spec=Foo[int]) m.bar() # python3.11 test.py Traceback (most recent call last): File "/root/test.py", line 11, in m.bar() ^^^ File "/usr/lib/python3.11/unittest/mock.py", line 635, in __getattr__ raise AttributeError("Mock object has no attribute %r" % name) ^^ AttributeError: Mock object has no attribute 'bar' -- components: Library (Lib) messages: 405981 nosy: kjamieson priority: normal severity: normal status: open title: Mock spec with a specialized generic class does not mock class attributes type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45755> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22377] %Z in strptime doesn't match EST and others
Kevin added the comment: With the introduction of PEP 0615 (https://www.python.org/dev/peps/pep-0615/) — Support for the IANA Time Zone Database in the Standard Library — should this be revisited to now leverage ZoneInfo to fully parse these time zone values in Python 3.9+ (or 3.11 with introduction of the feature if it is unreasonable to backport this)? -- nosy: +kkirsche ___ Python tracker <https://bugs.python.org/issue22377> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43574] Regression in overallocation for literal list initialization in v3.9+
Change by Kevin Mills : -- nosy: +Zeturic ___ Python tracker <https://bugs.python.org/issue43574> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45104] Error in __new__ docs
New submission from Kevin Shweh : The data model docs for __new__ say "If __new__() is invoked during object construction and it returns an instance or subclass of cls, then the new instance’s __init__() method will be invoked..." "instance or subclass of cls" is incorrect - if for some reason __new__ returns a subclass of cls, __init__ will not be invoked, unless the subclass also happens to be an instance of cls (which can happen with metaclasses). This should probably say something like "instance of cls (including subclass instances)", or "instance of cls or of a subclass of cls", or just "instance of cls". -- assignee: docs@python components: Documentation messages: 401065 nosy: Kevin Shweh, docs@python priority: normal severity: normal status: open title: Error in __new__ docs versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45104> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45054] json module should issue warning about duplicate keys
Kevin Mills added the comment: Sorry to the people I'm pinging, but I just noticed the initial dictionary in my example code is wrong. I figured I should fix it before anybody tested it and got confused about it not matching up with my description of the results. It should've been: import json d1 = {"1": "fromstring", 1: "fromnumber"} string = json.dumps(d1) print(string) d2 = json.loads(string) print(d2) -- ___ Python tracker <https://bugs.python.org/issue45054> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45054] json module should issue warning about duplicate keys
New submission from Kevin Mills : The json module will allow the following without complaint: import json d1 = {1: "fromstring", "1": "fromnumber"} string = json.dumps(d1) print(string) d2 = json.loads(string) print(d2) And it prints: {"1": "fromstring", "1": "fromnumber"} {'1': 'fromnumber'} This would be extremely confusing to anyone who doesn't already know that JSON keys have to be strings. Not only does `d1 != d2` (which the documentation does mention as a possibility after a round trip through JSON), but `len(d1) != len(d2)` and `d1['1'] != d2['1']`, even though '1' is in both. I suggest that if json.dump or json.dumps notices that it is producing a JSON document with duplicate keys, it should issue a warning. Similarly, if json.load or json.loads notices that it is reading a JSON document with duplicate keys, it should also issue a warning. -- components: Library (Lib) messages: 400678 nosy: Zeturic priority: normal severity: normal status: open title: json module should issue warning about duplicate keys type: enhancement versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue45054> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44921] dict subclassing is slow
Kevin Shweh added the comment: Of course it's reasonable to support dict subclasses. We already have a bunch of dict subclasses in the standard library, like collections.defaultdict and collections.Counter, and collections.Counter is significantly slower than it could be because of this issue. (collections.defaultdict seems to be unaffected due to differences between classes implemented in C and Python.) dict.__getitem__ even has dedicated support for a __missing__ hook, which is only useful for subclasses. -- nosy: +Kevin Shweh ___ Python tracker <https://bugs.python.org/issue44921> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42369] Reading ZipFile not thread-safe
Kevin Mehall added the comment: I think I found the root cause of this problem and proposed a fix in https://github.com/python/cpython/pull/26974 To monkey-patch this fix on existing versions of Python, I'm using: class PatchedSharedFile(zipfile._SharedFile): def __init__(self, *args): super().__init__(*args) self.tell = lambda: self._pos zipfile._SharedFile = PatchedSharedFile -- ___ Python tracker <https://bugs.python.org/issue42369> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42369] Reading ZipFile not thread-safe
Change by Kevin Mehall : -- keywords: +patch nosy: +kevinmehall nosy_count: 5.0 -> 6.0 pull_requests: +25538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26974 ___ Python tracker <https://bugs.python.org/issue42369> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44514] configparser.rst & bz2.rst leave temp files after 'make doctest'
Change by Kevin Follstad : -- keywords: +patch pull_requests: +25485 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26909 ___ Python tracker <https://bugs.python.org/issue44514> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44514] configparser.rst & bz2.rst leave temp files after 'make doctest'
New submission from Kevin Follstad : Both Docs/library/configparser.rst and Docs/library/bz2.rst create untracked temp files on the filesystem when 'make doctest' is run because testcleanup directives are absent in these files. -- assignee: docs@python components: Documentation messages: 396541 nosy: docs@python, kfollstad priority: normal severity: normal status: open title: configparser.rst & bz2.rst leave temp files after 'make doctest' type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44514> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24132] Direct sub-classing of pathlib.Path
Change by Kevin Follstad : -- pull_requests: +25482 pull_request: https://github.com/python/cpython/pull/26906 ___ Python tracker <https://bugs.python.org/issue24132> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24132] Direct sub-classing of pathlib.Path
Change by Kevin Follstad : -- nosy: +kfollstad nosy_count: 11.0 -> 12.0 pull_requests: +25030 pull_request: https://github.com/python/cpython/pull/26438 ___ Python tracker <https://bugs.python.org/issue24132> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35633] test_eintr fails on AIX since fcntl functions were modified
Kevin added the comment: FYI, the problem here is that AIX fcntl returns EACCES in the case that the lock is held and non-blocking behavior was requested: > The lockfx and lockf subroutines fail if one of the following is true: Item > > EACCESThe Command parameter is F_SETLK, the l_type field is F_RDLCK, > and the segment of the file to be locked is already write-locked by another > process. > EACCESThe Command parameter is F_SETLK, the l_type field is F_WRLCK, > and the segment of a file to be locked is already read-locked or write-locked > by another process. https://www.ibm.com/docs/en/aix/7.1?topic=l-lockfx-lockf-flock-lockf64-subroutine (Note the docs are a bit wonky referring to lockf/lockfx but talking about parameters and fields which apply to fcntl instead) The lockf/flock APIs provided by AIX handle this appropriately, mapping EACCES to EWOULDBLOCK, but while Python calls the libbsd flock API, it uses its own lockf implementation which calls fcntl directly: https://github.com/python/cpython/blob/main/Modules/fcntlmodule.c#L426 -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue35633> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44040] Update broken link in pathlib source
Change by Kevin Follstad : -- keywords: +patch pull_requests: +24573 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25905 ___ Python tracker <https://bugs.python.org/issue44040> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44040] Update broken link in pathlib source
New submission from Kevin Follstad : Update broken link (repeated in several places) in pathlib sources. - # (see https://bitbucket.org/pitrou/pathlib/issue/12/) + # (see http://web.archive.org/web/20200623061726/https://bitbucket.org/pitrou/pathlib/issues/12/ ) -- assignee: docs@python components: Documentation messages: 392960 nosy: docs@python, kfollstad priority: normal severity: normal status: open title: Update broken link in pathlib source versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue44040> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43970] Optimize Path.cwd() in pathlib
Change by Kevin Follstad : -- keywords: +patch pull_requests: +24388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25699 ___ Python tracker <https://bugs.python.org/issue43970> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43970] Optimize Path.cwd() in pathlib
New submission from Kevin Follstad : python3.10 -m timeit -r 5 -n 10 -s 'from pathlib import Path' 'Path.cwd()' 10 loops, best of 5: 206 usec per loop python3.10-mypatch -m timeit -r 5 -n 10 -s 'from pathlib import Path' 'Path.cwd()' 10 loops, best of 5: 156 usec per loop -- components: Library (Lib) messages: 392255 nosy: kfollstad priority: normal severity: normal status: open title: Optimize Path.cwd() in pathlib type: performance versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43970> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38908] Troubles with @runtime_checkable protocols
Kevin Shweh added the comment: It seems like the straightforward, minimal fix would be to just add if (getattr(cls, '_is_protocol', False) and not getattr(cls, '_is_runtime_protocol', False) and not _allow_reckless_class_cheks()): raise TypeError(...) to _ProtocolMeta.__instancecheck__. Does that fail on some edge case (that the current implementation works on)? It's a little weird that _ProtocolMeta.__instancecheck__ doesn't explicitly check that the protocol is runtime-checkable. -- nosy: +Kevin Shweh ___ Python tracker <https://bugs.python.org/issue38908> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43784] starting a thread in __del__ hangs at interpreter shutdown
Kevin M added the comment: eryksun, wow, that's speedy analysis, but there might be more to it. I went and tested a bunch of test cases. my subrocess code doesn't seem to hang on Linux where the thread example code does? Linux - Python 3.6.8 - your threading example DOESN'T hang Linux - Python 3.6.8 - My subprocess code also DOESN'T hang Linux - Python 3.8.5 - thread example HANGs Linux - Python 3.8.5 - My subprocess code also DOESN'T hang Windows - Python 3.9.1 - thread example HANGs Windows - Python 3.9.1 - subprocess code HANGs -- ___ Python tracker <https://bugs.python.org/issue43784> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43784] [Windows] interpreter hangs indefinitely on subprocess.communicate during __del__ at script exit
New submission from Kevin M : I've noticed an issue (or user error) in which Python a call that otherwise usually works in the __del__ step of a class will freeze when the Python interpreter is exiting. I've attached sample code that I've ran against Python 3.9.1 on Windows 10. The code below runs a process and communicates via the pipe. class SubprocTest(object): def run(self): print("run") proc_args = ["cmd.exe"] self._process = subprocess.Popen(proc_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def __del__(self): print("__del__") if self._process is not None: self.terminate() def terminate(self): print("terminate") self._process.communicate(input=b"exit\n", timeout=1) print("kill") self._process.kill() self._process = None if __name__ == "__main__": s = SubprocTest() s.run() del s print("s done") t = SubprocTest() t.run() print("t done") Current output: run __del__ terminate kill s done run t done __del__ terminate <<<<<< hangs indefinitely here, even though timeout=1 Expected output: run __del__ terminate kill s done run t done __del__ terminate kill In normal circumstances, when you del the object and force a run of __del__(), the process ends properly and the terminate() method completes. When the Python interpreter exits, Python calls the __del__() method of the class. In this case, the terminate() never completes and the script freezes indefinitely on the communicate() -- components: Library (Lib), Windows files: win_subprocess_hang.py messages: 390587 nosy: paul.moore, steve.dower, sylikc, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] interpreter hangs indefinitely on subprocess.communicate during __del__ at script exit versions: Python 3.9 Added file: https://bugs.python.org/file49947/win_subprocess_hang.py ___ Python tracker <https://bugs.python.org/issue43784> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.
Kevin Geller added the comment: I was also facing the similar issue. But I got it fixed by following the steps provided on https://enhau.com/ -- nosy: +kevingeller ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43344] RotatingFileHandler breaks file type associations
Kevin Hollingshead added the comment: Thanks Vinay, I was able to do this with: def namer(name): return name.replace(".log", "") + ".log" Then when initializing the logger: handler.namer = namer My full initializer script: import os import logging from logging.handlers import TimedRotatingFileHandler from config import constants def namer(name): return name.replace(".log", "") + ".log" def init(baseFilename): logPath = constants.LOGGING_DIR envSuffix = '-prod' if constants.ENV == 'prod' else '-dev' logFilename = os.path.join(logPath, baseFilename + envSuffix + '.log') print(f"Logging to {logFilename}") handler = TimedRotatingFileHandler(logFilename, when = "midnight", backupCount = 30, encoding = 'utf8') handler.setLevel(logging.DEBUG) handler.suffix = "%Y%m%d" handler.namer = namer formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s [%(module)s:%(lineno)d]') handler.setFormatter(formatter) logging.basicConfig( handlers = [handler], format = '%(asctime)s %(levelname)s %(message)s [%(module)s:%(lineno)d]', level = logging.DEBUG, datefmt = '%Y-%m-%d %H:%M:%S') if __name__ == '__main__': init('testing') logging.error("ohai") logging.debug("ohai debug") logging.getLogger().handlers[0].doRollover() logging.error("ohai next day") logging.debug("ohai debug next day") On Mon, Mar 1, 2021 at 8:13 AM Vinay Sajip wrote: > > Vinay Sajip added the comment: > > As per the documentation at > > > https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BaseRotatingHandler.namer > > You can set the handler's "namer" attribute to a callable that returns a > computed name for the rotated file - this can be computed as per your > requirements. The cookbook also has an entry about this: > > > https://docs.python.org/3/howto/logging-cookbook.html#using-a-rotator-and-namer-to-customize-log-rotation-processing > > -- > > ___ > Python tracker > <https://bugs.python.org/issue43344> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43344> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43344] RotatingFileHandler breaks file type associations
Kevin Hollingshead added the comment: Sure. Thanks for your help. On Tue, Mar 2, 2021, 1:08 PM Vinay Sajip wrote: > > Vinay Sajip added the comment: > > I'll add to the cookbook recipe with this real-world example, when I get a > chance. > > -- > > ___ > Python tracker > <https://bugs.python.org/issue43344> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43344> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43344] RotatingFileHandler breaks file type associations
New submission from Kevin Hollingshead : The filenames generated by logging.RotatingFileHandler breaks the ability to associate a program (e.g. notepad++, sublime text, etc.) with the log files using Windows or OSX file associations because the extension is overridden by the added suffix. For example, if I specify the filename as "test.log" for a TimeBasedRotatingFileHandler with a suffix of "%Y%m%d", rolled over files are named test.log.MMDD. There is no way to associate a program with this type of file extension. A good non-breaking fix would be to add a parameter "extension" to RotatingFileHandler, and if specified would be applied to all filenames. Thus if I specify filename="test" and "extension="log" for my handler it would give "test.log" for the initial file and "test.MMDD.log" for rollover files. -- components: Extension Modules files: logger_bug.py messages: 387793 nosy: kh14821 priority: normal severity: normal status: open title: RotatingFileHandler breaks file type associations type: behavior Added file: https://bugs.python.org/file49840/logger_bug.py ___ Python tracker <https://bugs.python.org/issue43344> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Tkinter needed as a legacy version 2.7 imports the module...
Hey Community, Is there a site where I might/can download a version of Tkinter for Python 2.7? Seriously, KMW John 1:4 "In him was life; and the life was the light of men." -- https://mail.python.org/mailman/listinfo/python-list
[issue43298] Windows build cannot detect missing Windows SDK
Kevin Thomas added the comment: Hi Steve actually there was none installed which was strange as I had Visual Studio installed but it was not checked by default. After selecting it and installing it, everything works as expected. Updating the error message in some way might be helpful. -- ___ Python tracker <https://bugs.python.org/issue43298> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43298] Windows build cannot detect missing Windows SDK
Kevin Thomas added the comment: Thank you Steve. I did not have the latest installed which is Win10SDK_10.0.18362, therefore it did trigger that original error in msg387518. After installing, Win10SDK_10.0.18362, it did in-fact allow a successful compilation. Updating that error code would be most helpful to Windows developers. I would have never caught it but I wanted to help test 3.10 so I thought I should try it on the Windows 10 box to make sure the community had all platforms covered. RESULTS: Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:01:10.34 C:\Users\kevin\cpython>python.bat Running Release|x64 interpreter... Python 3.10.0a5+ (heads/master:91a639a094, Feb 22 2021, 14:01:03) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> -- ___ Python tracker <https://bugs.python.org/issue43298> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43298] Windows build issue
New submission from Kevin Thomas : When compiling for Windows it does not properly handle the version string MSB4184 C:\Users\kevin\cpython>PCbuild\build.bat Using py -3.7 (found 3.7 with py.exe) Fetching external libraries... bzip2-1.0.6 already exists, skipping. sqlite-3.34.0.0 already exists, skipping. xz-5.2.2 already exists, skipping. zlib-1.2.11 already exists, skipping. Fetching external binaries... libffi already exists, skipping. openssl-bin-1.1.1i already exists, skipping. tcltk-8.6.10.0 already exists, skipping. Finished. Using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" (found in the Visual Studio installation) C:\Users\kevin\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" "C:\Users\kevin\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /clp:summary /p:Configuration=Release /p:Platform=x64 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" C:\Users\kevin\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot be evaluated. Version string portion was too short or too long. [C:\Users\kevin\cpython\PCbuild\pythoncore.vcxproj] Build FAILED. C:\Users\kevin\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot be evaluated. Version string portion was too short or too long. [C:\Users\kevin\cpython\PCbuild\pythoncore.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.06 -- messages: 387518 nosy: mytechnotalent priority: normal severity: normal status: open title: Windows build issue type: compile error versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43298> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Python 2.7 and 3.9
My employer has hundreds of scripts in 2.7, but I'm writing new scripts in 3.9! I'm running into 'invalid syntax' errors.I have to maintain the 'Legacy' stuff, and I need to mod the path et al., to execute 3.7 w/o doing damage to the 'Legacy' stuff...IDEA' are Welcome! KMW John 1:4 "In him was life; and the life was the light of men." -- https://mail.python.org/mailman/listinfo/python-list
[issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched
Kevin Purrone added the comment: Sorry, I meant to say the title of the PROGRAM in the menu items is now Python. -- ___ Python tracker <https://bugs.python.org/issue38946> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched
Kevin Purrone added the comment: I have little experience posting in forums, so if this post is in the wrong place, please let me know. I am running Python3.9, with Apple OS 10.15.7 I was using IDLE successfully for a class in Python for the past three weeks, although I was rarely able to open a file by double clicking it. It actually worked a few times, but most of the time, nothing happened, and I would open IDLE first, and then open a file from its file menu. But today, IDLE will not open. When I click on the icon in the dock like I usually did, it seems to open for about .5 seconds, and then quits. Also, now when I double click on a .py file, IDLE will open for about .5 seconds and then quits. I reinstalled the package, but no change. However, in terminal I can launch python with this command: python3.9. Then I can launch IDLE with this command: import idlelib.idle. The IDLE window opens, and I can open files from the file menu and they run as before. However, the title of the file menu is now "Python" where before, it was "IDLE" -- nosy: +KevinPurrone versions: +Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue38946> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python cannot count apparently
Set i = 0 at the begin of the code, that way each entry starts at Logical 0 of the array/container/list... "The only way to have experience is by having the experience"! On Sunday, February 7, 2021, 12:56:40 PM MST, Karsten Hilbert wrote: Am Sun, Feb 07, 2021 at 07:47:03PM + schrieb Paul Bryan: > That's not the only problem with the code. There's a missing close- > paren and a reference to "string" which I presume was meant to be > "myString". I know. I wasn't going to spoil everything right away. The sort of response we would get from OP would tell us what sort of help might be most suitable :-) Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
[issue43122] Python Launcher doesn't open a terminal window
Kevin added the comment: William, Thanks for your comment. I assumed the same thing, but it goes by so fast I am never sure.. > On Feb 3, 2021, at 10:27 PM, William Pickard wrote: > > > William Pickard added the comment: > > That quick flash would be your terminal window if I have to guess (based on > no Mac experience, but Windows). > > -- > nosy: +WildCard65 > > ___ > Python tracker > <https://bugs.python.org/issue43122> > ___ -- ___ Python tracker <https://bugs.python.org/issue43122> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43122] Python Launcher doesn't open a terminal window
New submission from Kevin : Machine: new MacBook Air with M1 chip, running Big Sur Downloaded: Python versions 2.7, 3.8, and 3.9 Situation: Programs run just fine IF I run them out of a terminal window (/usr/local/bin/python name-of-python-program). Also programs that use Tkinter windows and don't require a terminal window for input or output run properly. Problem: Can't launch programs by double-clicking on them. When I try, Python Launcher starts and displays its preferences and there is a microsecond flash of something on the screen that appears to descend into the program icon that was clicked on. Note: Playing with a shebang in the program made no difference. Everything works fine when the programs are opened and run in IDLE. -- messages: 386473 nosy: kjw priority: normal severity: normal status: open title: Python Launcher doesn't open a terminal window type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue43122> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
For example: Question, moving a folder (T061RR7N1) containing a Specific file (ReadCMI), to folder: C:\\...\DUT0
for path, dir, files in os.walk(myDestinationFolder): # for path, dir, files in os.walk(destfolder): print('The path is %s: ', path) print(files) os.chdir(mySourceFolder) if not os.path.isfile(myDestinationFolder + file): # if not os.path.isfile(destfolder + file): print('The file is %s: ', file) shutil.copytree(mySourceFolder, myDestinationFolder) # os.rename(path + '\\' + file, myDestinationFolder + file) # os.rename(path + '\\' + file, destfolder + file) os.rename(path + '\\' + file, myDestinationFolder + file) elif os.path.isfile(myDestinationFolder + file): # os.rename(path + '\\' + file, destfolder + file) shutil.copytree(mySourceFolder, myDestinationFolder) So I would very much appreciate your ideas on the above statements!Because...I think I've got the wrong function (os.path.isfile), when I should be (s/b) using a stepped approach!Note: program allows input of ID = T061RR7N1 (for example)1) find the folder containing "file": where folder = T061RR7N1, and file is "ReadCMI"; if TRUE, shutil.copytree C:\\...\T061RR7N1\ReadCMI (TO) C:\\...\DUT[?], where [?] is a num from 0 - 15.2) append to C:\\...\DUT[?]\T061RR7N1, which contains "ReadCMI"! and would you mind telling me why this works (in every example I've found on the internet): r'C:\\anyfolder\\anyotherfolder\\'...what does the "r" signify? If it's 'read', why can't I use the 'a' for append? KMW "The only way to have experience is by having the experience"! -- https://mail.python.org/mailman/listinfo/python-list
[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value
Kevin Chen added the comment: Awesome thanks! Does the rewrite fix the issue with creating negated flags as well? -- ___ Python tracker <https://bugs.python.org/issue42915> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value
New submission from Kevin Chen : Here's a code sample: ``` import time from enum import Flag, auto class MyFlag(Flag): NONE = 0 FLAG_1 = auto() FLAG_2 = auto() FLAG_3 = auto() FLAG_4 = auto() FLAG_5 = auto() FLAG_6 = auto() # # NOT_FLAG_1_OR_2 = ~FLAG_1 & ~FLAG_2 def test_flag(): f = MyFlag.NONE inverted = ( ~MyFlag.FLAG_1 & ~MyFlag.FLAG_2 & ~MyFlag.FLAG_3 & ~MyFlag.FLAG_4 & ~MyFlag.FLAG_5 & ~MyFlag.FLAG_6 ) return f & inverted INVERTED = ( ~MyFlag.FLAG_1 & ~MyFlag.FLAG_2 & ~MyFlag.FLAG_3 & ~MyFlag.FLAG_4 & ~MyFlag.FLAG_5 & ~MyFlag.FLAG_6 ) def test_flag_cached(): f = MyFlag.NONE return f & INVERTED if __name__ == "__main__": start_time = time.time() for _ in range(10_000): test_flag() elapsed = time.time() - start_time print(f"Took normal {elapsed:2f} seconds.") start_time = time.time() for _ in range(10_000): test_flag_cached() elapsed = time.time() - start_time print(f"Took cached {elapsed:2f} seconds.") ``` And its outputs: ``` Took normal 1.799731 seconds. Took cached 0.009488 seconds. ``` Basically, bitwise negation is very very slow. From what I can tell, it seems that a lot of time is spent here computing powers of two. I've read elsewhere that flag values are cached, and it looks like negated Flag values can't be cached? This seems related to the second issue, which is that any negated Flag value being defined results in `RecursionError: maximum recursion depth exceeded` as it searches for a good name for Flag. Obviously, the simple workaround is just to define a constant variable elsewhere with the negated value, but it isn't very obvious anywhere that this is necessary, and I wanted to raise this to see if anyone has knowledge of the implementation details of Flag for possibly resolving this in the class itself. -- messages: 384983 nosy: aspin2 priority: normal severity: normal status: open title: enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42915> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42912] enum.Flag ~ bitwise negation is very slow
New submission from Kevin Chen : Ignore this, opened issue by accident -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42912> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42912] enum.Flag ~ bitwise negation is very slow
Change by Kevin Chen : -- nosy: aspin2 priority: normal severity: normal status: open title: enum.Flag ~ bitwise negation is very slow versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42912> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42817] timedelta zeropadding hh
Kevin Rasmussen added the comment: Eric makes a pretty good point about how that ends up looking with days included and backward compatibility. Thanks everyone for humouring me and talking me through this one I'm going to close the issue as "not a bug". -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42817] timedelta zeropadding hh
Kevin Rasmussen added the comment: Question: Why should it be zeropadded to 2? Answer: Why wouldn't it be zeropadded to match the rest of the library? Honestly it just seemed like an inconsistency with the rest of the datetime module. It caught me off guard when I went I tried to pull __str__ of a timedelta and the padding was different than what I saw elsewhere. I figured it could potentially be a quick fix if the current behaviour is not desired. I'm curious why that would have been rejected if it was even considered/noticed before. Do you know of any good way to figure out if this was discussed before? So far all I have done for searching was a search of issues that were already brought up and I didn't find anything at first glance. -- ___ Python tracker <https://bugs.python.org/issue42817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42817] timedelta zeropadding hh
Kevin Rasmussen added the comment: Current behaviour: ``` # python Python 3.9.1 (default, Dec 18 2020, 05:16:04) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> td = datetime.timedelta(hours=3) >>> str(td) '3:00:00' >>> dt = datetime.datetime.strptime(str(td), "%H:%M:%S") >>> dt.strftime("%H:%M:%S") '03:00:00' >>> ``` Expected behaviour: ``` # python Python 3.9.1 (default, Dec 18 2020, 05:16:04) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> td = datetime.timedelta(hours=3) >>> str(td) '03:00:00' >>> dt = datetime.datetime.strptime(str(td), "%H:%M:%S") >>> dt.strftime("%H:%M:%S") '03:00:00' >>> ``` -- ___ Python tracker <https://bugs.python.org/issue42817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42817] timedelta zeropadding hh
Change by Kevin Rasmussen : -- keywords: +patch pull_requests: +22908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24075 ___ Python tracker <https://bugs.python.org/issue42817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42817] timedelta zeropadding hh
New submission from Kevin Rasmussen : It looks like hh should be zeropadded to 2 and isn't for timedelta. -- messages: 384273 nosy: krasmussen priority: normal severity: normal status: open title: timedelta zeropadding hh type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue42817> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42541] Tkinter colours wrong on MacOS universal2
Kevin Walzer added the comment: Ned, I wish I knew. Marc and I are both now members of the TCT, and have had a few conversations around the release schedule, but the release schedule is more or less determined when one or two senior members of the TCT decide things are ready. We had some momentum toward an RC of 8.6.11 a few months ago, but that seems to have stalled out. -- ___ Python tracker <https://bugs.python.org/issue42541> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42541] Tkinter colours wrong on MacOS universal2
Kevin Walzer added the comment: This bug is not present in IDLE 3.9.0 when built against the tip of Tk core-8-6-branch. Marc Culler has done some work to fix the visual artifacts, and the work continues. The problem here is that Apple's API churn continually breaks parts of Tk with each new OS release, and there is large amount of work just to keep things working reasonably. -- nosy: +wordtech ___ Python tracker <https://bugs.python.org/issue42541> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37733] Fail to build _curses module of Python 3.7.4 on AIX 7.1 using gcc
Kevin added the comment: Both 3.6 and 3.7 are in security only mode so at this point, so if the issue is fixed in newer versions I think this issue could be closed. -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue37733> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37009] Threading and THREAD_SAFE for AIX
Change by Kevin : -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue37009> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11188] test_time error on AIX
Change by Kevin : -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue11188> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23023] ./Modules/ld_so_aix not found on AIX during test_distutils
Kevin added the comment: Is this issue still relevant? I can't find any current buildbot errors on AIX for this test. -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue23023> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42309] BUILD: AIX-64-bit segmentation fault
Kevin added the comment: I have not encountered this problem when building Python 3.10 on AIX and PASE with GCC 6.3. -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue42309> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24886] open fails randomly on AIX
Kevin added the comment: Given that the AIX bug has long been fixed and Python 2.7 is EOL we can probably close this bug. -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue24886> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24046] Incomplete build on AIX
Kevin added the comment: Looks like RAND_egd was made optional in https://bugs.python.org/issue21356 Can this issue be closed? -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue24046> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24501] configure does not find (n)curses in /usr/local/libs
Kevin added the comment: There error indicates it can't find ncurses.h configure:14223: xlc_r -c -qmaxmem=-1 -DSYSV -D_AIX -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/usr/local/include -I/usr/include/ncursesw conftest.c >&5 "conftest.c", line 311.10: 1506-296 (S) #include file not found. Are you sure you don't need -I/usr/include/ncurses instead of -I/usr/include? -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue24501> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17454] ld_so_aix not used when linking c++ (scipy)
Kevin added the comment: This was fixed by https://github.com/python/cpython/pull/10437 -- nosy: +kadler ___ Python tracker <https://bugs.python.org/issue17454> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42273] Using LazyLoader leads to AttributeError
Kevin Keating added the comment: One possible solution here would be to update the documentation at https://github.com/python/cpython/blob/master/Doc/library/importlib.rst#implementing-lazy-imports to either note the limitation or to modify the lazy_import function so that it adds the module to the package's namespace. That's basically the workaround that we've been using. -- ___ Python tracker <https://bugs.python.org/issue42273> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42273] Using LazyLoader leads to AttributeError
Kevin Keating added the comment: Brett, what do you mean by "the way import works"? Is the difference between using LazyLoader and using a normal import intentional? -- status: -> open ___ Python tracker <https://bugs.python.org/issue42273> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42273] Using LazyLoader leads to AttributeError
Kevin Keating added the comment: My colleague just tested this on Mac and confirms that the bug also occurs there using Python 3.8.3. -- ___ Python tracker <https://bugs.python.org/issue42273> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42273] Using LazyLoader leads to AttributeError
Kevin Keating added the comment: An __init__.py shouldn't be necessary. If I comment out the 'b = lazy_import("foo.b")' line in a.py (i.e. disable the lazy import), then the print statement works correctly as written without any other changes. Also, I double checked with the colleague who originally ran into this issue, and it turns out he encountered the bug on Linux, not on Mac (still Python 3.8.3). -- ___ Python tracker <https://bugs.python.org/issue42273> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42273] Using LazyLoader leads to AttributeError
New submission from Kevin Keating : Steps to reproduce: Create the following three files (or download the attached zip file, which contains these files): main.py import foo from foo import a from foo import b print(foo.b.my_function()) foo/a.py import importlib.util import sys # implementation copied from https://github.com/python/cpython/blob/master/Doc/library/importlib.rst#implementing-lazy-imports def lazy_import(name): spec = importlib.util.find_spec(name) loader = importlib.util.LazyLoader(spec.loader) spec.loader = loader module = importlib.util.module_from_spec(spec) sys.modules[name] = module loader.exec_module(module) return module b = lazy_import("foo.b") foo/b.py def my_function(): return "my_function" and then run main.py Expected results my_function should be printed to the terminal Actual results The following traceback is printed to the terminal Traceback (most recent call last): File "F:\Documents\lazy_import\main.py", line 6, in print(foo.b.my_function()) AttributeError: module 'foo' has no attribute 'b' If you comment out "from foo import a" from main.py, then the traceback doesn't occur and my_function gets printed. Alternatively, if you move "from foo import a" after "from foo import b", then the traceback doesn't occur and my_function gets printed. Adding "foo.b = b" before "print(foo.b.my_function())" will also fix the traceback. A colleague of mine originally ran into this bug when writing unit tests for lazily imported code, since mock.patch("foo.b.my_function") triggers the same AttributeError. I've reproduced this on Windows using both Python 3.8.3 and Python 3.9.0, and my colleague was using Python 3.8.3 on Mac. -- components: Library (Lib) files: lazy_import.zip messages: 380437 nosy: KevKeating priority: normal severity: normal status: open title: Using LazyLoader leads to AttributeError versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49574/lazy_import.zip ___ Python tracker <https://bugs.python.org/issue42273> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42272] Warning filter message/module documentation is misleading
Change by Kevin Locke : -- keywords: +patch pull_requests: +22084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23172 ___ Python tracker <https://bugs.python.org/issue42272> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42272] Warning filter message/module documentation is misleading
New submission from Kevin Locke : "The Warnings Filter" section of the documentation for the warnings module describes the message and module filters as "a string containing a regular expression". While that is true when they are arguments to the filterwarnings function, it is not true when they appear in -W or $PYTHONWARNINGS where they are matched literally (after stripping any starting/ending whitespace). Additionally, in the "Describing Warning Filters" section, the example "error:::mymodule[.*]" does not behave as described. If it were used as an argument to filterwarnings, where it would be treated as a regular expression, it would match the (invalid) module names mymodule. or mymodule* while it would match mymodule[.*] literally if passed via -W or $PYTHONWARNINGS. -- assignee: docs@python components: Documentation messages: 380429 nosy: docs@python, kevinoid priority: normal severity: normal status: open title: Warning filter message/module documentation is misleading type: enhancement versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue42272> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior
New submission from Kevin Modzelewski : The problem is that the descriptor-ness of a type-level attribute is only checked at opcache-set time, not at opcache-hit time. $ python3.8 test.py 2 $ ./python --version Python 3.10.0a2+ $ git rev-parse --short HEAD 789359f47c $ ./python test.py 1 -- components: Interpreter Core files: test.py messages: 380370 nosy: Kevin Modzelewski, pablogsal priority: normal severity: normal status: open title: LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file49568/test.py ___ Python tracker <https://bugs.python.org/issue42266> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42225] Tkinter hangs or crashes when displaying astral chars
Kevin Walzer added the comment: Some work has been done this year on expanding support for these types of glyphs in Tk, but I'm not sure of its current state--it's not my area of expertise. Can you open a ticket at https://core.tcl-lang.org/tk/ so one of the folks working on this can take a look? -- ___ Python tracker <https://bugs.python.org/issue42225> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42190] global declarations affect too much inside exec or compile
New submission from Kevin Shweh : A global declaration inside a function is only supposed to affect assignments inside that function, but in code executed with exec, a global declaration affects assignments outside the function: >>> gdict = {} >>> ldict = {} >>> exec('x = 1', gdict, ldict) >>> 'x' in gdict False >>> 'x' in ldict True >>> >>> gdict = {} >>> ldict = {} >>> exec(''' ... x = 1 ... def f(): global x''', gdict, ldict) >>> 'x' in gdict True >>> 'x' in ldict False Here, we can see that the presence of a "global x" declaration inside f causes the "x = 1" outside of f to assign to globals instead of locals. This also affects code objects compiled with compile(). -- components: Interpreter Core messages: 379855 nosy: Kevin Shweh priority: normal severity: normal status: open title: global declarations affect too much inside exec or compile type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42190> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com