[issue44405] add program passed as string to dis module.

2021-06-12 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44408] imaplib fails when server sends extra blank line after literal value

2021-06-12 Thread John L
Change by John L : -- keywords: +patch pull_requests: +25286 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26701 ___ Python tracker ___

[issue44408] imaplib fails when server sends extra blank line after literal value

2021-06-12 Thread John L
New submission from John L : Some IMAP servers return an extra blank line after a counted literal value, which makes imaplib crash. MacOS mail and T'bird handle the blank line OK so it seems to be a somewhat common bug. -- components: Library (Lib) messages: 395729 nosy: jrlevine

[issue44407] A "Coroutines and Tasks" code example needs "asyncio.run(main())"

2021-06-12 Thread Atsushi Sakai
New submission from Atsushi Sakai : This is very small documentation improvement proposal. In the "Coroutines and Tasks" doc, the code example after "Let’s modify the above example and run two say_after coroutines concurrently:" is missing "asyncio.run(main())" at the end of the code example:

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: > If _test were considered obsolete, it could be removed. removing _test: https://github.com/CCLDArjun/cpython/commit/8b3b8ccef0ef693f8f4105fd1eb56e9386675301 does not break dis tests. -- ___ Python tracker

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

2021-06-12 Thread alessandro mantovani
alessandro mantovani added the comment: Fuzzing experimental techniques, but then I observed the same behavior was happening with vanilla afl++. As a starting queue I used the *.py files that I found in the repo under ‘test’ or so Best Alessandro Mantovani Inviato da iPhone > Il giorno

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: > If _test were considered obsolete, it could be removed. Yup, originally it was added 2 decades ago (in 2000) originally as a test: 1fdae12c932 -- ___ Python tracker

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: Huh, that's actually weird that the "exisisting command line interface" (quotes because it was added as a test) isn't official. I've found it to be convinient as a newcomer to the cpython codebase. > What is unusual, I think, for a CLI test function is that it

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: What is unusual, I think, for a CLI test function is that it requires a passed in argument. As a sanity-check test, 'python -m dis' could (should) disassemble itself. Perhaps there once were some true tests that were moved to unittests. (I started IDLE

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I checked https://docs.python.org/3/library/dis.html and there is no mention of dis having a command-line interface. This suggests that _test is likely present only for testing the module, not for using it. This was common a couple of decades ago before

[issue44406] Divergent sys.prefix behavior causes `python -m build` command to fail when in virtual environment

2021-06-12 Thread Dylan
New submission from Dylan : Confirmed on 3.6 and 3.9. The issue can be found in venv\__init__.py where the sys.prefix is used to determine the parent path of the python executable (near the bottom of the symlink_or_copy method at about line 190). On the venv documentation page

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
New submission from Arjun : python dis module should have a program passed in as string. Currently, you can do this: $ echo "x = 6" | python -m dis /dev/stdin 1 0 LOAD_CONST 0 (6) 2 STORE_NAME 0 (x) 4 LOAD_CONST

[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-12 Thread STINNER Victor
STINNER Victor added the comment: > To reduce the adverse effects of this frequency offset error, recent versions > of Windows, particularly Windows 8, use multiple hardware timers to detect > the frequency offset and compensate for it to the extent possible. This > calibration process is

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-12 Thread STINNER Victor
STINNER Victor added the comment: > I think this is a good idea. MultiLoopChildWatcher could use setwakeupfd with > some no-op callback just to wakeup the loop. A no-op doesn't solve the issue. It doesn't wake up the event loop. There are only two options to wake up the event loop: * Raise

[issue44283] Add jump table for certain safe match-case statements

2021-06-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here are some benchmarks: PS C:\Users\sween\Source\Repos\cpython2\cpython> .\python.bat -m pyperf compare_to .\main.json .\PR-26697.json Running Release|x64 interpreter... 1: Mean +- std dev: [main] 117 us +- 4 us -> [PR-26697] 122 us +- 3 us: 1.04x slower

[issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils

2021-06-12 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset 736ed6f7a9f465ba728198e8bca81e5fbe71bc37 by Dong-hee Na in branch 'main': bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693) https://github.com/python/cpython/commit/736ed6f7a9f465ba728198e8bca81e5fbe71bc37 --

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-12 Thread Barney Gale
Barney Gale added the comment: I think I agree How would you feel about two new arguments? Following `os.curdir` and `os.pardir` names: def normpath(path, *, keep_curdir=False, keep_pardir=False) ... -- ___ Python tracker

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +25285 pull_request: https://github.com/python/cpython/pull/26700 ___ Python tracker ___

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-12 Thread Eryk Sun
Eryk Sun added the comment: > single dots are collapsed For pathlib, I've previously discussed a desire to retain a leading dot component from the initializing path. This could be implemented in strict mode for normpath(). A leading dot is significant in the path of an executable in a

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +25284 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26699 ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Ah, I see now that it's deprecated in the docs as well: https://docs.python.org/3/library/ssl.html#ssl.OP_NO_TLSv1_3 -- ___ Python tracker

[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-12 Thread Philip Sundt
New submission from Philip Sundt : ``` >>> import tkinter >>> from functools import partial >>> r=tkinter.Tk() >>> r.after(500, partial(print, "lol")) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.7/tkinter/__init__.py", line 755, in after

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Let me know if you want me to open a PR that adds the correct flag and adds deprecation wrappers to the tests. -- ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Yes, and judging from PEP 644, I figured the TLSv1.3 flag was _not_ deprecated. Sorry for the misunderstanding/noise. -- ___ Python tracker

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Christian Heimes
Christian Heimes added the comment: 3.10 requires OpenSSL >= 1.1.1 The code checks for presence of deprecated options and emits a warning for all SSL_OP_NO_TLS/SSL* constants. -- ___ Python tracker

[issue27827] pathlib is_reserved fails for some reserved paths on Windows

2021-06-12 Thread Barney Gale
Barney Gale added the comment: I've put Eryk's patch up as a PR: https://github.com/python/cpython/pull/26698 -- ___ Python tracker ___

[issue27827] pathlib is_reserved fails for some reserved paths on Windows

2021-06-12 Thread Barney Gale
Change by Barney Gale : -- nosy: +barneygale nosy_count: 6.0 -> 7.0 pull_requests: +25283 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26698 ___ Python tracker

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Christian Heimes
Change by Christian Heimes : -- resolution: duplicate -> versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: But TLSv1.3 is included in openssl 1.1.1, no? -- ___ Python tracker ___ ___ Python-bugs-list

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Christian Heimes
Christian Heimes added the comment: It's a typo, not a duplicate entry. Correct line is: SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3 -- nosy: +christian.heimes resolution: fixed -> duplicate stage: resolved -> needs patch status: closed -> open

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

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

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

2021-06-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset d03f342a8389f1ea9100efb0d1a205601e607254 by Miss Islington (bot) in branch '3.10': bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676) (GH-26695)

[issue44283] Add jump table for certain safe match-case statements

2021-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +25282 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26697 ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks for the report, Brother Beer. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-12 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: New changeset cb7230c7a7d6d497e54c25e9ba640eec79de10f2 by Erlend Egeberg Aasland in branch 'main': bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680) https://github.com/python/cpython/commit/cb7230c7a7d6d497e54c25e9ba640eec79de10f2 --

[issue16845] warnings.simplefilter should validate input

2021-06-12 Thread Bonifacio
Change by Bonifacio : -- keywords: +patch nosy: +Bonifacio2 nosy_count: 3.0 -> 4.0 pull_requests: +25281 pull_request: https://github.com/python/cpython/pull/26696 ___ Python tracker

[issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX

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

[issue44403] Add os.path.isreserved() function

2021-06-12 Thread Barney Gale
New submission from Barney Gale : Windows reserves certain filenames like 'NUL'. Checking for these names is part of a small handful of functionality that is available in pathlib but not in os.path. I propose that we add an os.path.isreserved() function, encorporating Eryk Sun's work on

[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-12 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: @jack__d, please feel free to work on a PR. Also, do not hesitate to ask any questions along the way. Thanks for contributing to CPython. -- ___ Python tracker

[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-12 Thread Jack DeVries
Jack DeVries added the comment: Hi Joannah, I'm a new contributor and happy to take a crack at this if you haven't already started on a fix / would like me to do that. Thanks! -- nosy: +jack__d ___ Python tracker

[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-12 Thread Jacob Walls
Jacob Walls added the comment: Sounds reasonable to me. -- components: +Library (Lib) nosy: +jacobtylerwalls type: -> behavior versions: +Python 3.11 -Python 3.9 ___ Python tracker

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-12 Thread Barney Gale
Barney Gale added the comment: For this bug specifically, the pathlib docs describe the desirable behaviour: Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links: >>> PurePath('foo//bar')

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-12 Thread Barney Gale
Barney Gale added the comment: Thanks Terry, I've added a topic here: https://discuss.python.org/t/pathlib-and-os-path-code-duplication-and-feature-parity/9239 The bit about `normpath()` is towards the middle of the post. -- ___ Python tracker

[issue44369] Improve syntax error for wrongly closed strings

2021-06-12 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: >From what I can share by my experience, this error happens soo much. So I'd >love to see it. For a more consistent message with others, maybe it could be something like this; SyntaxError: invalid syntax. Maybe you meant to use a different type of quote

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

2021-06-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: alessandro mantovani, one question, how did you generate the crash scripts? -- ___ Python tracker ___

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

2021-06-12 Thread miss-islington
miss-islington added the comment: New changeset a342cc5891dbd8a08d40e9444f2e2c9e93258721 by Pablo Galindo in branch 'main': bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676)

[issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror()

2021-06-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +25280 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26695 ___ Python tracker ___

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset af5fb6706219d7949c1db5c9f2b7da53198123f3 by Miss Islington (bot) in branch '3.8': bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) (GH-26670)

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-12 Thread Barney Gale
Change by Barney Gale : -- keywords: +patch pull_requests: +25279 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26694 ___ Python tracker ___

[issue44376] Improve performance of integer exponentiation

2021-06-12 Thread Tim Peters
Tim Peters added the comment: Closing this now because the pull request did, I believe, all that can be done at the function level. Exponents of 1 and 2 are well within a factor of 2 of repeated multiplication now, and it's essentially a tie at exponent 3 now. Above that, pow() wins now. On

[issue44376] Improve performance of integer exponentiation

2021-06-12 Thread Tim Peters
Tim Peters added the comment: New changeset 9d8dd8f08aae4ad6e73a9322a4e9dee965afebbc by Tim Peters in branch 'main': bpo-44376 - reduce pow() overhead for small exponents (GH-26662) https://github.com/python/cpython/commit/9d8dd8f08aae4ad6e73a9322a4e9dee965afebbc --

[issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils

2021-06-12 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch nosy: +corona10 nosy_count: 4.0 -> 5.0 pull_requests: +25278 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26693 ___ Python tracker

[issue34199] Add support for delete logger in log module.

2021-06-12 Thread Юлий Бройде
Юлий Бройде <124...@gmail.com> added the comment: I have a similar scenario. I need to create a logger for each client of my system and than to delete them -- nosy: +124bit versions: +Python 3.9 -Python 3.8 ___ Python tracker

[issue29688] Add support for Path.absolute()

2021-06-12 Thread Barney Gale
Barney Gale added the comment: Hi - please could a core dev review PR 26153? It adds documentation and tests for Path.absolute(). Thank you! -- ___ Python tracker ___

[issue44400] Propose random.randbool()

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As for randbool() I concur with Steven. It is too trivial and in most case you do not even need to call bool(). Alternate methods: choice((False, True)) random() < 0.5 They are less efficient than getrandbits(1), but can be easily extended to

[issue44400] Propose random.randbool()

2021-06-12 Thread Dong-hee Na
Dong-hee Na added the comment: s / from other core-devs / from core-devs -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-06-12 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44400] Propose random.randbool()

2021-06-12 Thread Dong-hee Na
Dong-hee Na added the comment: To explain my thought, > Not every one line expression needs to be a function in a library. > `bool(getrandbits(1))` is self-explanatory enough, Yeah, I agree with the point of view, it might be enough. But considering the popularity of the Python language

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba by Serhiy Storchaka in branch 'main': bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) https://github.com/python/cpython/commit/9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba

[issue36663] pdb: store whole exception information in locals (via user_exception)

2021-06-12 Thread Irit Katriel
Irit Katriel added the comment: Isn't it enough that the traceback is available on exc_value.__traceback__? -- nosy: +iritkatriel ___ Python tracker ___

[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-12 Thread Ryan Hileman
Ryan Hileman added the comment: I think a lot of that is based on very outdated information. It's worth reading this article: https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps I will repeat Microsoft's current recommendation (from that article): >

[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-12 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-12 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 4a42cebf6dd769e2fa4e234a9e91093b3ad1cb63 by Mark Dickinson in branch 'main': bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606) https://github.com/python/cpython/commit/4a42cebf6dd769e2fa4e234a9e91093b3ad1cb63 --

[issue44400] Propose random.randbool()

2021-06-12 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-12 Thread STINNER Victor
STINNER Victor added the comment: Changing is clock is a tricky. There are many things to consider: * Is it really monotonic in all cases? * Does it have a better resolution than the previous clock? * Corner cases: does it include time spent in time.sleep() and while the system is suspended?

[issue36027] Support negative exponents in pow() where a modulus is specified.

2021-06-12 Thread Mark Dickinson
Change by Mark Dickinson : -- pull_requests: +25277 pull_request: https://github.com/python/cpython/pull/26690 ___ Python tracker ___

[issue44401] const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue21011. We cannot change this because it breaks C API. -- nosy: +serhiy.storchaka resolution: -> wont fix stage: patch review -> resolved status: open -> closed superseder: -> PyArg_ParseTupleAndKeywords doesn't take

[issue44400] Propose random.randbool()

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is difficult to deprecate getrandbits() because it is one of two base methods. All Random methods call either getrandbits() or randome(). Overriding them is a way to make a new random generator. -- nosy: +serhiy.storchaka

[issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior

2021-06-12 Thread Matthew Clapp
Matthew Clapp added the comment: To clarify my intent: I'd really love a way to get the paths info from context from an existing native venv without affecting the directories of the venv. It seems like this is what ensure_directories *actually* does if clear==False. I'm hoping that this