[issue44675] Cross-platform issues with private methods and multiprocessing

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: More details and a suggested fix here: #37852 . -- ___ Python tracker ___ ___ Python-bugs-list

[issue44675] Cross-platform issues with private methods and multiprocessing

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: The issue seems to be that there was a change between 3.7.7 and 3.8.6, - multiprocessing started using pickle dump / load which cannot handle double underscore methods. See #33007 for a reproducer with pickle. I'm using MacOS and this multiprocessing

[issue38619] [Doc] UUID.hex is lowercase

2021-11-28 Thread jiahua wang
Change by jiahua wang : -- keywords: +patch nosy: +wangjiahua nosy_count: 5.0 -> 6.0 pull_requests: +28061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29830 ___ Python tracker

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Gideon
Gideon added the comment: I've submitted a PR at https://github.com/python/cpython/pull/29829. I'd just like to add that the whole Python team is amazing. Thank you for doing what you do! -- ___ Python tracker

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +28060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29829 ___ Python tracker

[issue45902] Bytes and bytesarrays can be sorted with a much faster count sort.

2021-11-28 Thread Tim Peters
Tim Peters added the comment: I agree with closing this - I don't know of real use cases either. Serhiy, essentially all LSD radix sorts are stable, and rely on that for their own correctness. MSD radix sorts vary. -- ___ Python tracker

[issue45876] Improve accuracy of stdev functions in statistics

2021-11-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +28059 pull_request: https://github.com/python/cpython/pull/29828 ___ Python tracker ___

[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: I think it's find to address both of these here. -- components: +Documentation -Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 ___ Python tracker

[issue45922] Many method, function, built-in... are not clickable and should be

2021-11-28 Thread Arthur Milchior
New submission from Arthur Milchior : I would like to work on this documentation improvement. Before spending time on it, I would like to know whether it would be accepted in principle and whether the way I would intend to improve the documentation would be accepted. # Problem: In a lot of

[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Eric: I've closed a similar issue about asdict() and now updating the title to keep track of both in this issue. Let me know if you want to keep them separate instead. -- title: dataclasses.astuple does deepcopy on all fields -> dataclasses.astuple

[issue45921] codecs module doesn't support iso-8859-6-i, iso-8859-6-e, iso-8859-8-i or iso-8859-8-i

2021-11-28 Thread Mark Sapiro
New submission from Mark Sapiro : iso-8859-6-i, iso-8859-6-e, iso-8859-8-i and iso-8859-8-i are all IANA recognized character sets per https://www.iana.org/assignments/character-sets/character-sets.xhtml. These are all unrecognized by codecs.lookup(). -- components: Library (Lib)

[issue45614] traceback of exception with non-unicode __module__

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +28058 pull_request: https://github.com/python/cpython/pull/29827 ___ Python tracker ___

[issue45614] traceback of exception with non-unicode __module__

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +28057 pull_request: https://github.com/python/cpython/pull/29826 ___ Python tracker ___

[issue45920] make doctest fails

2021-11-28 Thread Arthur Milchior
Arthur Milchior added the comment: I know understand one thing I missed. I needed to do `make venv` after changing the make file to get 3.10 in virtual environment. The issue being that this would make doc harder to create on ubuntu since 3.10 is not yet easily accessible through apt/snap.

[issue45920] make doctest fails

2021-11-28 Thread Arthur Milchior
New submission from Arthur Milchior : On current main, f87ea0350286837e9e96de03f8bfa215176c2928 , ``` cd cpython/Doc make doctest ``` fails. Due to: Document: library/functions --- Warning, treated as error:

[issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Looks like it's fixed so closing it.. -- nosy: +andrei.avk, kj resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2021-11-28 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Maybe this issue will be solved in issue44092 Yes, this will be resolved in bpo-44092. Hopefully I'll be able to land it sooner than later. -- ___ Python tracker

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Gideon
Gideon added the comment: Sounds good. I've already made the necessary code changes on my own build, so I'll just finish writing the tests + documentation and submit a PR. -- ___ Python tracker

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: While I'd prefer -1 overall, I would also prefer 3 over 2. If we were adding the feature from scratch, we wouldn't have decimal differ from int, float, and complex. And I'm not in favor of an uppercase converter, no matter what we do here. The other

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Mark Dickinson
Mark Dickinson added the comment: On the subject of accuracy, there doesn't seem to be much in it on my mac laptop, and it looks as though pow(2.0, x) is giving correctly rounded results as often as (if not more often than) exp2(x). Here's the log of a terminal session, after recompiling

[issue42268] ./configure failing when --with-memory-sanitizer specified

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

[issue42268] ./configure failing when --with-memory-sanitizer specified

2021-11-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 8d1a5800645575ec876932bbb9aed3aa65d18f46 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer (GH-29806) (GH-29815)

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Mark Dickinson
Mark Dickinson added the comment: See also previous discussion towards the end of https://bugs.python.org/issue3366. FWIW, I don't think there's value in adding exp2 to the cmath module too: we'd have to write our own implementation, and it's just not a function that appears often in the

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Mark Dickinson
Mark Dickinson added the comment: Sounds good to me, provided that all the common platforms that we care about have a reasonable quality implementation. This should be a straightforward wrapping of the C99 function, and with sufficient tests the buildbots should tell us if there are any

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have no strong opinion. I found the discrepancy when reviewed one of Mark's PRs. I was surprised because I did not know that "N" is supported. On other hand, there are reasons for supporting upper-case variant of "n" if we support upper-case variants of

[issue45918] Possibly use ROUND_05UP in decimal's localcontext() example

2021-11-28 Thread Tim Peters
Tim Peters added the comment: I'll add that the rounding mode is intended to ease emulating fixed-point arithmetic. The decimal spec claimed that was a goal, but there really isn't any direct support for saying, e.g., "I want two digits after the decimal point". Only for specifying total

[issue45912] [argparse] Print texts starting with capital letters and finish with dot for more formality

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: I don't think argparse should do such formatting. You can give it the help text in this format if that's what you want printed, and you can implement your own formatter: https://docs.python.org/3/library/argparse.html#formatter-class -- nosy:

[issue28140] Give better errors for OS commands, like 'pip', in REPL, script

2021-11-28 Thread Tom Viner
Tom Viner added the comment: I've updated my pull request from 3 years ago. Fixed merge conflicts and addressed all comments. https://github.com/python/cpython/pull/8536 -- ___ Python tracker

[issue45918] Possibly use ROUND_05UP in decimal's localcontext() example

2021-11-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Christian Heimes
Christian Heimes added the comment: Thank you! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45918] Possibly use ROUND_05UP in decimal's localcontext() example

2021-11-28 Thread Tim Peters
Tim Peters added the comment: Not a good idea in general - this rounding mode is _mostly_ "to zero", and isn't intended for chains of operations. I don't believe I've ever seen it used in a real program, so the current "no example at all" is a fair representation of real usage ;-)

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Eryk Sun
Eryk Sun added the comment: I've created bpo-45919 with a suggested enhancement to use GetFileType() in Windows, since the Windows C runtime does not provide fcntl(). -- ___ Python tracker

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg407216 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45919] Use WinAPI GetFileType() in is_valid_fd()

2021-11-28 Thread Eryk Sun
New submission from Eryk Sun : During startup, is_valid_fd() in Python/pylifecycle.c is called to validate stdin, stdout, and stderr. Performance isn't critical here, but every bit helps in reducing startup time. In my tests, implementing this check in Windows via

[issue44695] asdict use deep copy to dataclass instances

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Duplicate of https://bugs.python.org/issue43905 -- nosy: +andrei.avk resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> dataclasses.astuple does deepcopy on all fields ___ Python

[issue45918] Possibly use ROUND_05UP in decimal's localcontext() example

2021-11-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: I’m concerned though that the intermediate calculations might be worse off than with some other rounding mode. -- ___ Python tracker ___

[issue45912] [argparse] Print texts starting with capital letters and finish with dot for more formality

2021-11-28 Thread Vishal Pandey
Vishal Pandey added the comment: I would like to work on it as my first contribution to the python repository. Can you please assign this to me? -- nosy: +vishalpandeyvip ___ Python tracker

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Christian Heimes
Christian Heimes added the comment: New changeset f87ea0350286837e9e96de03f8bfa215176c2928 by Christian Heimes in branch 'main': bpo-45915: use fcntl(fd, F_GETFD) in is_valid_fd() (GH-29821) https://github.com/python/cpython/commit/f87ea0350286837e9e96de03f8bfa215176c2928 --

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Eryk Sun
Eryk Sun added the comment: In Windows, GetFileType((HANDLE)_get_osfhandle(fd)) is several times faster than close(dup(fd)). For example: #if defined(MS_WINDOWS) int type; _Py_BEGIN_SUPPRESS_IPH type = GetFileType((HANDLE)_get_osfhandle(fd)); _Py_END_SUPPRESS_IPH return

[issue45912] [argparse] Print texts starting with capital letters and finish with dot for more formality

2021-11-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: -pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45918] Possibly use ROUND_05UP in decimal's localcontext() example

2021-11-28 Thread Raymond Hettinger
New submission from Raymond Hettinger : Candidate example: with localcontext() as ctx: ctx.prec += 10# Perform a higher precision calculation ctx.rounding = ROUND_05UP # Avoid double rounding of the final calculation step s = calculate_something() s =

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +mark.dickinson, rhettinger, serhiy.storchaka, tim.peters ___ Python tracker ___ ___

[issue45917] Add math.exp2() function: 2^x

2021-11-28 Thread Gideon
New submission from Gideon : Dear Python Support Team, I was looking through Python’s list of supported methods in the math module, and I noticed that C99’s exp2 method was not implemented. This method raises 2 to the power of the supplied argument. I understand that it’s pretty trivial to

[issue28140] Give better errors for OS commands, like 'pip', in REPL, script

2021-11-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I closed #45721, which has additional comments, as a duplicate of this. 'print foo' now results in "SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?" -- components: +Interpreter Core nosy: +aroberge title: Attempt to

[issue45721] Improve error message for OS command entered at >>> prompt

2021-11-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Attempt to give better errors for pip commands typed into the REPL ___ Python tracker

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: I'd support -1. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28499] Logging module documentation needs a rework.

2021-11-28 Thread Vinay Sajip
Vinay Sajip added the comment: Closing, as no objections raised. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: I support deprecating "N". -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue19737] Documentation of globals() and locals() should be improved

2021-11-28 Thread jiahua wang
Change by jiahua wang : -- nosy: +180909 nosy_count: 5.0 -> 6.0 pull_requests: +28055 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29823 ___ Python tracker

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 209cec8a2a2e845df5af764a9171af05a2a4c8e3 by Miss Islington (bot) in branch '3.9': [3.9] bpo-19460: Add test for MIMENonMultipart (GH-29817) (#29819) https://github.com/python/cpython/commit/209cec8a2a2e845df5af764a9171af05a2a4c8e3 --

[issue18717] test for request.urlretrieve

2021-11-28 Thread jiahua wang
Change by jiahua wang : -- nosy: +180909 nosy_count: 2.0 -> 3.0 pull_requests: +28054 pull_request: https://github.com/python/cpython/pull/29822 ___ Python tracker ___

[issue45913] readline + GTK + Pytest Seg Fault with Python 3.7 and 3.10 on CI

2021-11-28 Thread Dan Yeaw
Dan Yeaw added the comment: I continued to look in to this and updated the title of the issue, I don't think this is caused by doctest. I also updated a minimum example here: https://github.com/danyeaw/plugin-console-test If using pytest and GTK, any module loaded that makes use of readline

[issue17383] [doc] Possibly ambiguous phrasing in tutorial/modules#more-on-modules

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- title: Possibly ambiguous phrasing in tutorial/modules#more-on-modules -> [doc] Possibly ambiguous phrasing in tutorial/modules#more-on-modules versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6 ___ Python

[issue20281] [doc] time.strftime %z format specifier is the same as %Z

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: Seems like the only thing to do on this issue is to add a reference to the footnote in the table entries for %z and %Z. -- components: +Library (Lib) keywords: +easy nosy: +iritkatriel title: time.strftime %z format specifier is the same as %Z -> [doc]

[issue22356] mention explicitly that stdlib assumes gmtime(0) epoch is 1970

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: The docs now say "The epoch is the point where the time starts, and is platform dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC). To find out what the epoch is on a given platform, look at time.gmtime(0)." which I believe covers this issue.

[issue22618] [doc] urllib.parse.parse_qsl different results after urllib.parse.unquote

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- title: urllib.parse.parse_qsl different results after urllib.parse.unquote -> [doc] urllib.parse.parse_qsl different results after urllib.parse.unquote versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5 ___

[issue12970] [doc] os.walk() consider some symlinks as dirs instead of non-dirs

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- title: os.walk() consider some symlinks as dirs instead of non-dirs -> [doc] os.walk() consider some symlinks as dirs instead of non-dirs versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker

[issue10149] [doc] Data truncation in expat parser

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: Eric's patch needs to be converted to a GitHub PR. -- components: +Library (Lib) keywords: +easy -patch nosy: +iritkatriel title: Data truncation in expat parser -> [doc] Data truncation in expat parser versions: +Python 3.11 -Python 2.7, Python 3.1,

[issue16726] expat ParseFile expects bytes, not string

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- components: +Library (Lib) nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5 ___ Python tracker

[issue28140] Attempt to give better errors for pip commands typed into the REPL

2021-11-28 Thread Alex Waygood
Alex Waygood added the comment: Similar discussion in a newer issue: https://bugs.python.org/issue45721 -- nosy: +AlexWaygood, pablogsal, steven.daprano, terry.reedy ___ Python tracker

[issue28140] Attempt to give better errors for pip commands typed into the REPL

2021-11-28 Thread Irit Katriel
Irit Katriel added the comment: On 3.11: >>> pip install requests File "", line 1 pip install requests ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? -- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

[issue31184] Fix data descriptor detection in inspect.getattr_static

2021-11-28 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

[issue45916] documentation link error

2021-11-28 Thread Tony Zhou
New submission from Tony Zhou : 3.10.0 Documentation » The Python Tutorial » 15. Floating Point Arithmetic: Issues and Limitationsin in the link "The Perils of Floating Point" brings user to https://www.hmbags.tw/ I don't think this is right. please check -- messages: 407200 nosy:

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-28 Thread Christian Heimes
Christian Heimes added the comment: New changeset aaf4cfd5774d23ca48ff304ace1f64426201 by Erlend Egeberg Aasland in branch 'main': bpo-45847: Port _multiprocessing to PY_STDLIB_MOD (GH-29768) https://github.com/python/cpython/commit/aaf4cfd5774d23ca48ff304ace1f64426201 --

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 2c398a5acf85d1bbc5796f3385972d0759b90e54 by Miss Islington (bot) in branch '3.10': [3.10] bpo-19460: Add test for MIMENonMultipart (GH-29817) (GH-29818) https://github.com/python/cpython/commit/2c398a5acf85d1bbc5796f3385972d0759b90e54

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +28053 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29821 ___ Python tracker

[issue28445] Wrong documentation for GzipFile.peek

2021-11-28 Thread jiahua wang
Change by jiahua wang : -- keywords: +patch nosy: +180909 nosy_count: 4.0 -> 5.0 pull_requests: +28052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29820 ___ Python tracker

[issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid

2021-11-28 Thread Christian Heimes
New submission from Christian Heimes : is_valid_fd() uses dup() or fstat() to check whether an fd is valid. Both operations are costly. fcntl() with F_GETFD returns the file descriptor flags (e.g. CLOEXEC) and -1 with errno set to EBADF when fd is not an open file descriptor. It's faster

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Mark Dickinson
Mark Dickinson added the comment: I could be persuaded for any of options -1, 1 and 2. I don't much like option 0. -- ___ Python tracker ___

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Mark Dickinson
Mark Dickinson added the comment: Eric, Serhiy: do you have opinions on the right way forward? Here are 6 options, on a spectrum of increasing level of acceptance of "N". -2. Remove "N" support for cdecimal right now (i.e., for Python 3.11), on the basis that there's no need for deprecation

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +28051 pull_request: https://github.com/python/cpython/pull/29819 ___ Python tracker ___

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +28050 pull_request: https://github.com/python/cpython/pull/29818 ___ Python tracker

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 46c8d915715aa2bd4d697482aa051fe974d440e1 by 180909 in branch 'main': bpo-19460: Add test for MIMENonMultipart (GH-29817) https://github.com/python/cpython/commit/46c8d915715aa2bd4d697482aa051fe974d440e1 -- nosy: +asvetlov

[issue45911] SystemError occured while running an extention

2021-11-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue45911] SystemError occured while running an extention

2021-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: At first glance, it looks like: if(!(PyArg_ParseTuple(args,"s",s))) return NULL; should be: if(!(PyArg_ParseTuple(args,"s",))) return NULL; The docs say: "A pointer to an existing string is stored in the character pointer variable whose address you pass."