[issue42888] Not installed “libgcc_s.so.1” causes parser crash.

2021-01-10 Thread Christian Heimes
Christian Heimes added the comment: What's your platform and distribution? -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue42889] Incorrect behavior of Python parser after ast node of test program being modified

2021-01-10 Thread Xinmeng Xia
New submission from Xinmeng Xia : The following program will lead to a incorrect behavior of Python parser. We change all variable to integer( forcely transformed to string) via ast.NodeTransformer. Then we compile the new code and execute it. It's surprising that code like "1=2; print(1)"

[issue42888] Not installed “libgcc_s.so.1” causes parser crash.

2021-01-10 Thread Xinmeng Xia
New submission from Xinmeng Xia : The following thread program will cause Python3.10 parser "core dump" due to missing “libgcc_s.so.1”. "pthread_cancel" cannot work correctly. I am wondering is there any possible to install or link to libgcc_s.so.1 during Python installation?

[issue42887] Multiple assignments of attribute "__sizeof__" will cause a segfault

2021-01-10 Thread Xinmeng Xia
New submission from Xinmeng Xia : In the following program 1, method "__sizeof__()" is called and assigned multiple times. The program can work well on Python 3.10. However if I change "__sizeof__()" to "__sizeof__". Then a segmentation fault is reported. I think something wrong for the

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ziqiao Kong
Ziqiao Kong added the comment: BTW, uname for the M1 MBP. ``` kabeor@kamino cpython-3.10.0a4 % uname -a Darwin kamino.lan 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm6464 ``` --

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ziqiao Kong
Ziqiao Kong added the comment: Seems that we are getting the same libffi.dylib. kabeor@kamino cpython-3.10.0a4 % otool -L $(./python.exe -c 'import _ctypes;print(_ctypes.__file__)') /Users/kabeor/cpython-3.10.0a4/build/lib.macosx-11.0-arm64-3.10/_ctypes.cpython-310-darwin.so:

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: The problem with that formulation of the feature request is that it would require the math.log function to recognize rationals, or at least the Fraction type. Since the numeric tower and the fractions module are implemented in pure Python that would be

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Any principled change costs more than it's worth :-( For anyone wanting to go forward with this, here's a summary of the feature request: Given two non-zero same signed integers x and y, log10(Fraction(x, y)) does the same as log10(x / y).

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Tim Peters
Tim Peters added the comment: Any principled change costs more than it's worth :-( I'm mostly sympathetic with Guido's view, and have long advocated a new `imath` module to hold the ever-growing number of functions that are really part of integer combinatorics. But it's become nearly

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > math.log10 works perfectly on integers which are too large > to be converted to floats. I see no reason why it couldn't > work as well with fractions. This is tricky territory. Mathematically, a common logarithm can and often will have a irrational

[issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: Cheryl, do you have time to review this? -- nosy: +cheryl.sabella, gvanrossum ___ Python tracker ___

[issue42881] Should typing.get_type_hints change None annotations?

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: I agree this is a bit unfortunate, but I also think it's a bit late to change now. However *if* we're going to change it we should do it now (in 3.10) or never. Given that we never *write* type(None) in annotations, it's unfortunate to get that back

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Camion
Camion added the comment: A generic solution might be to consider all number as fractions (which they are) (floats have denominators being 2^n, decimals have denominators being 10^n, integers have denominators being 1, and fractions have denominators being integers... but this would be a

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Camion
Camion added the comment: math.log10 works perfectly on integers which are too large to be converted to floats. I see no reason why it couldn't work as well with fractions. >>> math.log10(math.factorial(1)) 35659.45427452078 >>> math.log10(math.factorial(100)) 5565708.917186718 >>>

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: I guess another approach might be to change the math module so that all its functions support franctions (and decimal, and other esoteric number types). But that would require having __log__ and many others as methods on the numeric types. Personally I

[issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04

2021-01-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: With a truly minimal but reproducible example, I was able to understand and experiment. As is, widget creation is done without the event loop running. Displaying the message box shifts grabs the internal focus but also displays the unfocused tk window.

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Internally, the math.log10() function only works on floats. By way of the __float__() method, the input to the the math.log10() function is asked to convert itself to a float. Fractions implement __float__() by just dividing the numerator and

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Camion
New submission from Camion : Python is able to computer the logarithms of very large integers and fractions (by using log(num)-log(denom)), However the fractions.Fraction class fails to do it and raises a math domain error exception. >>> import math, fractions >>>

[issue42885] Regex performance problem with ^ aka AT_BEGINNING

2021-01-10 Thread Arnim Rupp
New submission from Arnim Rupp : The re lib needs 7 seconds to check if a billion As start with an x. So e.g. this statement takes this long: re.search(r'^x', 'A' * 10) It takes longer, the longer the string is. The string handling is not the problem, checking if it starts which an

[issue42129] Support resources in namespace packages

2021-01-10 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks! No rush, but ideally soon enough to be merged before the beta release of Python 3.10 (2021-05-03). -- ___ Python tracker ___

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-01-10 Thread Roland Hieber
Roland Hieber added the comment: Okay, I've had a look at this, and it seems that all the heavy lifting is already included in 68669ef7883 (via #38634, PR 16986). The selection of libedit vs. readline still needs to be ported. I've prepared (and tested) PR 24189 for the rebase of this patch

[issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04

2021-01-10 Thread John McCabe
John McCabe added the comment: Apologies, I couldn't find an edit button! That last comment should've said: "As before, changing: self.createWidgets() to: self.after_idle(self.createWidgets) avoids the issue." -- ___ Python tracker

[issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04

2021-01-10 Thread John McCabe
John McCabe added the comment: Fair point about being "too" long. Having seen a "short" example that, unfortunately, didn't actually exhibit the problem, I thought that providing a "smallish" example that definitely did exhibit the issue was quicker than, potentially, spending more time

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-01-10 Thread Roland Hieber
Change by Roland Hieber : -- pull_requests: +23016 pull_request: https://github.com/python/cpython/pull/24189 ___ Python tracker ___

[issue42884] array.index() missing start and end

2021-01-10 Thread Zackery Spytz
Zackery Spytz added the comment: This seems like a duplicate of bpo-31956. -- nosy: +ZackerySpytz ___ Python tracker ___ ___

[issue42884] array.index() missing start and end

2021-01-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42129] Support resources in namespace packages

2021-01-10 Thread Filipe Laíns
Filipe Laíns added the comment: Yes, I will look into it. Do we have a time schedule for when this should be ready, so that I can organize myself? -- ___ Python tracker ___

[issue34804] Repetition of 'for example' in documentation

2021-01-10 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: +Python 3.10 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___

[issue42884] array.index() missing start and end

2021-01-10 Thread Daniel Nicorici
New submission from Daniel Nicorici : Add support for array.index(x [,start [,end]]). Adding start and end would allow to loop thru the entire array (and not start all the time from 0). Currently, is array.index(x) (and it returns the smallest i such that i is the index of the first

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-10 Thread Ned Deily
Change by Ned Deily : -- components: +Build -Installation ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-10 Thread Ned Deily
Change by Ned Deily : -- title: configure errors -> running configure on Solaris 10 gives grep "illegal option" errors ___ Python tracker ___

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-10 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ned Deily
Ned Deily added the comment: Yes, otool should work. Something like: $ otool -L $(python3.9 -c 'import _ctypes;print(_ctypes.__file__)') /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so: /usr/lib/libffi.dylib (compatibility

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ziqiao Kong
Ziqiao Kong added the comment: Thanks for your reply. What shall I do to confirm the version of libffi? By otool? From: report=bugs.python@roundup.psfhosted.org on behalf of Ned Deily Sent: Monday, January 11, 2021 2:17:53 AM To: ziqiaok...@gmail.com

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ned Deily
Ned Deily added the comment: (I also get *34* when building v3.10.0a4 from source on the M1 with 11.1 and Xcode 12.3.) -- ___ Python tracker ___

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ned Deily
Ned Deily added the comment: I tried your test programs on a M1 Mac running macOS 11.1 with the latest macOS universal2 Pythons available from python.org (https://www.python.org/downloads/), 3.9.1 and 3.10.0a4, and both produced the same (correct) result as in your 3.8 example. Are you

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-10 Thread Ned Deily
Change by Ned Deily : -- components: +macOS nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42129] Support resources in namespace packages

2021-01-10 Thread Jason R. Coombs
Jason R. Coombs added the comment: In [this commit](https://github.com/python/importlib_resources/commit/bd20d893f11f387d285c666bc99fd2d4a7c33ef8), I've reconciled and merged the changes from importlib_resources 3.2-5.0, mainly the namespace package support

[issue42881] Should typing.get_type_hints change None annotations?

2021-01-10 Thread Eric V. Smith
Eric V. Smith added the comment: See also https://github.com/python/mypy/issues/640 "Support type(None) as a type", which was closed with "I don't think anyone cares". Jukka's comment was "Or maybe we should update PEP 484 to not suggest that type(None) is valid as a type, and None is the

[issue42881] Should typing.get_type_hints change None annotations?

2021-01-10 Thread Eric V. Smith
Eric V. Smith added the comment: Notice that this isn't just for __init__ or return types, it happens with any annotations (here, with 3.8): >>> def g(i: None): pass ... >>> g.__annotations__ {'i': None} >>> get_type_hints(g) {'i': } >>> I just noticed that PEP 484 also says:

[issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty

2021-01-10 Thread Haoyang
Haoyang added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty

2021-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty

2021-01-10 Thread Haoyang
New submission from Haoyang : Here is the bug-triggered code snippet in the file uploaded class A: def __init__(self, b=[]): print('b = ', b) self.a = b for i in range(3): a = A() a.a.append(1) print(a.a) It seems that when I pass a list "b" to __init__

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-10 Thread hai shi
Change by hai shi : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42879] SystemError from class 'int'

2021-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With debug build of Python I get a crash in other place: $ ./python -Xdev Movement.py pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html python: Objects/abstract.c:155: PyObject_GetItem: Assertion `(item != NULL) ^

[issue41748] HTMLParser: comma in attribute values with/without space

2021-01-10 Thread karl
karl added the comment: Status: The PR should be ready and completed https://github.com/python/cpython/pull/24072 and eventually be merged at a point. Thanks to ezio.melotti for the wonderful guidance. -- ___ Python tracker

[issue42879] SystemError from class 'int'

2021-01-10 Thread Jason Oliver
Jason Oliver added the comment: I will submit the bug report to the pygame bug tracker. -- ___ Python tracker ___ ___

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-10 Thread Yannick Jadoul
New submission from Yannick Jadoul : Issue detected in the embedding tests of pybind11, running on the latest alpha of 3.10: https://github.com/pybind/pybind11/issues/2774 I have reduced the weird issue/crash to a minimal reproducer, which consistently reproduces the crash on my Linux

[issue42881] Should typing.get_type_hints change None annotations?

2021-01-10 Thread Larry Hastings
New submission from Larry Hastings : PEP 484 says: (Note that the return type of __init__ ought to be annotated with -> None. The reason for this is subtle. [...] https://www.python.org/dev/peps/pep-0484/#the-meaning-of-annotations If you follow this advice, then call

[issue42879] SystemError from class 'int'

2021-01-10 Thread Mark Dickinson
Mark Dickinson added the comment: This is more likely to be a bug in Pygame than in Python itself. What's likely happening here is that some part of the Pygame machinery is setting an exception state but then returning a value as normal. (Generally, if some function in a C extension sets an

[issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac

2021-01-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: > Another change that might be needed: ensure that sysconfig.get_platform() > does not return "universal2" as the binary architecture when the compiler > does not support arm64. Hmmm... _osx_support.get_platform_osx() contains the following comment:

[issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac

2021-01-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've added a (draft) PR for this. The PR is a this time not tested on a 10.15 system. Another change that might be needed: ensure that sysconfig.get_platform() does not return "universal2" as the binary architecture when the compiler does not support

[issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac

2021-01-10 Thread Ronald Oussoren
Change by Ronald Oussoren : -- keywords: +patch pull_requests: +23015 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24187 ___ Python tracker ___

[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2021-01-10 Thread hai shi
Change by hai shi : -- pull_requests: +23014 pull_request: https://github.com/python/cpython/pull/24186 ___ Python tracker ___ ___