From report at bugs.python.org Fri Jan 1 00:16:27 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 01 Jan 2021 05:16:27 +0000 Subject: [issue42801] Exception catching function crashes on recursive list Message-ID: <1609478187.83.0.886724654093.issue42801@roundup.psfhosted.org> New submission from Steven D'Aprano : This function crashes on the following recursive list: def length(x): try: return sum(length(i) for i in x) except Exception: return 1 a = [[1, 2, 3], [4, 5, 6]] a.append(a) length(a) Crashes: Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow. Python runtime state: initialized Current thread 0x00007eff18d77740 (most recent call first): File "", line 3 in length File "", line 3 in File "", line 3 in length File "", line 3 in ... Aborted (core dumped) For brevity I've cut some of the output. There are about fifty pairs of "line 3 in length"/line 3 in " lines, all identical. ---------- components: Interpreter Core messages: 384150 nosy: steven.daprano priority: normal severity: normal status: open title: Exception catching function crashes on recursive list type: crash versions: Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:23:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 06:23:58 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609482238.96.0.776699906154.issue42756@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:26:51 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 06:26:51 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609482411.71.0.589936782924.issue42756@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:35:59 2021 From: report at bugs.python.org (mattip) Date: Fri, 01 Jan 2021 06:35:59 +0000 Subject: [issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem) In-Reply-To: <1609023821.09.0.189504509221.issue42752@roundup.psfhosted.org> Message-ID: <1609482959.01.0.808915030002.issue42752@roundup.psfhosted.org> mattip added the comment: Just to be clear, here is the code from the test (how do you format a code block here?) that demonstrates the writer is not closed when nothing is put into the queue ``` $ python3 Python 3.8.6 | packaged by conda-forge | (default, Oct 7 2020, 19:08:05) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing >>> q = multiprocessing.Queue() >>> q.close() >>> q.join_thread() >>> q._reader.closed True >>> q._writer.closed False >>> ``` And the changed behaviour to close the writer if the queue is used ``` >>> q = multiprocessing.Queue() >>> q.put(1) >>> q.get() 1 >>> q.close() >>> q.join_thread() >>> q._reader.closed True >>> q._writer.closed True ``` ---------- nosy: +mattip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:38:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 06:38:21 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609483101.71.0.491666030651.issue42756@roundup.psfhosted.org> Dong-hee Na added the comment: This ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:38:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 06:38:38 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609483118.73.0.118964496937.issue42756@roundup.psfhosted.org> Dong-hee Na added the comment: This is a regression bug that should be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 01:38:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 06:38:58 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609483138.35.0.734338762132.issue42756@roundup.psfhosted.org> Change by Dong-hee Na : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 02:49:53 2021 From: report at bugs.python.org (hai shi) Date: Fri, 01 Jan 2021 07:49:53 +0000 Subject: [issue30963] xxlimited.c XxoObject_Check should be XxoObject_CheckExact In-Reply-To: <1500412678.84.0.816991478409.issue30963@psf.upfronthosting.co.za> Message-ID: <1609487393.39.0.260135918702.issue30963@roundup.psfhosted.org> hai shi added the comment: >The Check code is now commented out, and the issue of type checking is mentioned in PEP 630. Got it, thanks for your supplement :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 03:36:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 08:36:12 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609490172.93.0.358190877962.issue42794@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 03:46:06 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 08:46:06 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609490766.26.0.566040187237.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: == CPython 3.10.0a3+ (heads/master:c8a7b8fa1b, Jan 1 2021, 08:28:41) [GCC 7.5.0] == Linux-5.4.0-1031-azure-x86_64-with-glibc2.27 little-endian == cwd: /home/corona10/cpython/build/test_python_66899? == CPU count: 2 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.00 Run tests sequentially 0:00:00 load avg: 0.00 [1/1] test_nntplib test_descriptions (test.test_nntplib.NNTPv1Tests) ... ok test_descriptions (test.test_nntplib.NNTPv2Tests) ... ok test_descriptions (test.test_nntplib.NetworkedNNTPTests) ... ok test_descriptions (test.test_nntplib.NetworkedNNTP_SSLTests) ... ERROR ====================================================================== ERROR: test_descriptions (test.test_nntplib.NetworkedNNTP_SSLTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/corona10/cpython/Lib/test/test_nntplib.py", line 250, in wrapped meth(self) File "/home/corona10/cpython/Lib/test/test_nntplib.py", line 99, in test_descriptions desc = descs[self.GROUP_NAME] KeyError: 'comp.lang.python' ---------------------------------------------------------------------- Ran 4 tests in 4.734s FAILED (errors=1) test test_nntplib failed test_nntplib failed == Tests result: FAILURE == 1 test failed: test_nntplib Total duration: 4.8 sec Tests result: FAILURE My test machine success to reproduce this issue. (Pdb) descs {} There might be 4 ways to solve this issue. 1. Re-create group and skip test while descs is empty 2. Update test to use other NNTP server which supports SSL ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 03:46:20 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 08:46:20 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609490780.62.0.476335292593.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: 4 ways / 2 ways ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 03:54:30 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 08:54:30 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609491270.41.0.244247951677.issue42794@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +22877 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 03:56:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 08:56:43 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609491403.09.0.304078056613.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: I submit the patch to use group_name which is mentioned from https://news.aioe.org/manual/aioe-hierarchy/ IMHO, it will be not changed frequently than what we used before. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 04:40:34 2021 From: report at bugs.python.org (Costas Basdekis) Date: Fri, 01 Jan 2021 09:40:34 +0000 Subject: [issue42797] Allow doctest to select tests via -m/--match option In-Reply-To: <1609442293.63.0.396324558319.issue42797@roundup.psfhosted.org> Message-ID: <1609494034.49.0.04464209676.issue42797@roundup.psfhosted.org> Costas Basdekis added the comment: Thanks for the thorough feedback Steven (and happy new year). About -m flag: we could use -k as other testing frameworks use (pytest), or even -t. About selecting multiple indexes: what you described is my exact use case, as I have a lot of failing examples in one method with verbose output, and also the examples depend on previous examples to be able to run, I'm currently debugging with `-m Ground.step:3,4,6,7`. So I think you have very valid points, and I'd like to find a way to make the extra overhead be worth it: * Currently the failing case output is f'File "{path}", line {line}, in {name}': we can add the index as f'File "{path}", line {line}, in {name}, example {index}', so it would be easy to know the indexes * I think globs in the pattern have been very useful to me in the past (with frameworks that allowed it), because sometimes similarly named functions can have the same types of errors you try to focus on. In any case, it looks like less effort to allow arbitrary globs rather than matching on module name parts I understand I'm adding complexity, and if we could support the same behaviour in a simpler way I'd be glad to attempt that. In the very least I think allowing a `finder=None` argument in `testmod` would allow more complex solutions, even if they are not accepted in `doctest`. In the end I'd welcome even a small improvement (for my personal usecase). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 05:31:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 10:31:02 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609497062.48.0.139789950541.issue42794@roundup.psfhosted.org> Serhiy Storchaka added the comment: The test was passed on my computer because test.test_nntplib.NetworkedNNTP_SSLTests was skipped because of the configuration of SSL on Ubuntu 20.04 (see issue41561). After using custom openssl.cnf I get the same errors. $ OPENSSL_CONF=~/py/openssl.cnf ./python -m test -vuall test_nntplib -m 'test_description*' The NNTP server nntp.aioe.org is used instead of snews.gmane.org since 2010 (45ca9874955b1eaf3d941b7a278b594fad50d4ee). Sadly there is no reference to any discussion, maybe Antoine remember some details. What other alternatives were considered? How to handle similar breakage of external servers? ---------- nosy: +pitrou Added file: https://bugs.python.org/file49714/openssl.cnf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 06:01:01 2021 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 01 Jan 2021 11:01:01 +0000 Subject: [issue34752] warnings.warn fails silently with unicode input In-Reply-To: <1537452937.66.0.956365154283.issue34752@psf.upfronthosting.co.za> Message-ID: <1609498861.86.0.512092085422.issue34752@roundup.psfhosted.org> Zackery Spytz added the comment: Python 2.7 is no longer supported, so I think this issue should be closed. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 06:31:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 11:31:46 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609500706.47.0.375885148787.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: > How to handle similar breakage of external servers? For tests with the external environment, How about skipping tests if servers are not available? It is assumed that if there is a change related to NNTP, it is well checked in the CI and review. This is because, at this point, reviewers and patch submitters check whether tests with external servers are passed. The reason for testing with the outside is to confirm that the whole operation works well. If external servers are not available, we can emit warning messages so that we can recognize when an issue occurs. Other than that, I can think of local server testing or mocking testing, but I am not sure if it is easy way for the SSL environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 06:37:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 11:37:21 +0000 Subject: [issue42801] Exception catching function crashes on recursive list In-Reply-To: <1609478187.83.0.886724654093.issue42801@roundup.psfhosted.org> Message-ID: <1609501041.97.0.611949388074.issue42801@roundup.psfhosted.org> Dong-hee Na added the comment: FYI,I am able to reproduce on Python 3.9 The master version is not able to reproduce. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 07:07:48 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 12:07:48 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609502868.47.0.2955950893.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: > For tests with the external environment, How about skipping tests if servers are not available? Hmm, I change my mind this is not a good idea :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 07:27:40 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 12:27:40 +0000 Subject: [issue34752] warnings.warn fails silently with unicode input In-Reply-To: <1537452937.66.0.956365154283.issue34752@psf.upfronthosting.co.za> Message-ID: <1609504060.05.0.290713352965.issue34752@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 07:57:44 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 01 Jan 2021 12:57:44 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609505864.33.0.935382054752.issue42794@roundup.psfhosted.org> Christian Heimes added the comment: Does this issue mean that I should include nntplib in PEP 594 again? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:01:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 01 Jan 2021 13:01:52 +0000 Subject: [issue42796] tempfile doesn't seem to play nicely with os.chdir on Windows In-Reply-To: <1609429462.99.0.549073524259.issue42796@roundup.psfhosted.org> Message-ID: <1609506112.79.0.649444809148.issue42796@roundup.psfhosted.org> Christian Heimes added the comment: The code fails because TemporaryDirectory.__exit__() is unable to remove the directory. Windows doesn't let you remove files and directories that are used by a process. On POSIX-like operating systems like Linux support removing of opened files. For example anonymous temporary files use the trick. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:34:49 2021 From: report at bugs.python.org (Gabriele Tornetta) Date: Fri, 01 Jan 2021 13:34:49 +0000 Subject: [issue42796] tempfile doesn't seem to play nicely with os.chdir on Windows In-Reply-To: <1609429462.99.0.549073524259.issue42796@roundup.psfhosted.org> Message-ID: <1609508089.79.0.236161571076.issue42796@roundup.psfhosted.org> Gabriele Tornetta added the comment: That makes sense, but I wonder what the "right" behaviour should be in this case. Surely the infinite recursion should be fixed at the very minimum. Perhaps the code on Windows could be enhanced to catch the case whereby one is trying to delete the cwd and do something like chdir('..') and then delete the temp folder. However, I suspect that something like this still wouldn't be enough. For example, this works fine ~~~ python def test_chdir(): with tempfile.TemporaryDirectory() as tempdir: old = os.getcwd() os.chdir(tempdir) os.chdir(old) ~~~ whereas this doesn't (same stacktrace as the original case) ~~~ python def test_chdir(): with tempfile.TemporaryDirectory() as tempdir: old = os.getcwd() os.chdir(tempdir) with open(os.path.join(tempdir, "delme")) as fout: fout.write("Hello") os.chdir(old) ~~~ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:40:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 01 Jan 2021 13:40:19 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1609508419.45.0.105924789561.issue25479@roundup.psfhosted.org> Irit Katriel added the comment: This PR probably doesn't improve test coverage because the feature is tested indirectly (and directly from test_typing). But I think this test should be added nevertheless for completeness and to demonstrate how the feature works. That said, this test shows that the documentation of issubclass is not quite accurate when it states that "a class is considered a subclass of itself" (https://docs.python.org/3/library/functions.html#issubclass). That should probably be a separate bpo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:40:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 01 Jan 2021 13:40:26 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1609508426.55.0.0174970434566.issue25479@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:52:53 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 01 Jan 2021 13:52:53 +0000 Subject: [issue42796] tempfile doesn't seem to play nicely with os.chdir on Windows In-Reply-To: <1609429462.99.0.549073524259.issue42796@roundup.psfhosted.org> Message-ID: <1609509173.66.0.453854599803.issue42796@roundup.psfhosted.org> Eryk Sun added the comment: > Windows doesn't let you remove files and directories that are used > by a process. Windows does allow deleting open files/directories, but read/execute, write/append, and delete/rename access have to be explicitly shared when opening a file or directory. WinAPI SetCurrentDirectoryW (called by os.chdir) does not share delete access when opening a directory as the new working directory, and the handle is kept open to use as the NTAPI RootDirectory handle when opening relative paths. So the directory can only be deleted after either the working directory changes or the process exits. See bpo-35144 for the source of the recursion error. An onerror handler was added that retries rmtree() after attempting to reset permissions. I proposed a workaround in the linked issue, but I don't think it's enough. Maybe there should be a separate onerror function for Windows. The two common PermissionError cases to handle in Windows are readonly files and sharing violations. If the readonly attribute is set, we can remove it and retry the unlink() or rmdir() call. I don't think there's no need for a recursive call since rmtree() only removes empty directories. For a sharing violation (winerror 32), all that can be done is to set an atexit function that retries deleting the directory. If rmtree() still fails, emit a resource warning and give up. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 08:58:19 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 01 Jan 2021 13:58:19 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609505864.33.0.935382054752.issue42794@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: On 01.01.2021 13:57, Christian Heimes wrote: > > Does this issue mean that I should include nntplib in PEP 594 again? The test fails because it was relying on an external news server's configuratoin. This doesn't mean the code itself is broken, just the test, so clearly: no. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:14:09 2021 From: report at bugs.python.org (karl) Date: Fri, 01 Jan 2021 14:14:09 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609510449.53.0.992739877802.issue4643@roundup.psfhosted.org> Change by karl : ---------- nosy: +karlcow nosy_count: 4.0 -> 5.0 pull_requests: +22878 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/24038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:20:03 2021 From: report at bugs.python.org (karl) Date: Fri, 01 Jan 2021 14:20:03 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609510803.05.0.5824548293.issue4643@roundup.psfhosted.org> karl added the comment: Converted into GitHub PR https://github.com/python/cpython/pull/24038 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:20:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 14:20:45 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609510845.53.0.483111122853.issue42794@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset ec3165320e81ac87edcb85c86c452528ddbaec1c by Dong-hee Na in branch 'master': bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) https://github.com/python/cpython/commit/ec3165320e81ac87edcb85c86c452528ddbaec1c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:20:47 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:20:47 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609510847.89.0.596633821411.issue42794@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +22880 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:20:55 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:20:55 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609510855.09.0.331527005216.issue42794@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22881 pull_request: https://github.com/python/cpython/pull/24040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:21:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:21:01 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609510861.89.0.255976128493.issue42794@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22882 pull_request: https://github.com/python/cpython/pull/24041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:21:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:21:09 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609510869.11.0.0962007107692.issue42794@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22883 pull_request: https://github.com/python/cpython/pull/24042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:27:04 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 01 Jan 2021 14:27:04 +0000 Subject: [issue42796] tempfile doesn't seem to play nicely with os.chdir on Windows In-Reply-To: <1609429462.99.0.549073524259.issue42796@roundup.psfhosted.org> Message-ID: <1609511224.2.0.133035718092.issue42796@roundup.psfhosted.org> Eryk Sun added the comment: > def test_chdir(): > with tempfile.TemporaryDirectory() as tempdir: > old = os.getcwd() > os.chdir(tempdir) > with open(os.path.join(tempdir, "delme")) as fout: > fout.write("Hello") > os.chdir(old) The open() call in test_chdir() fails before os.chdir(old) executes. You would need to call os.chdir(old) in a `finally` block. But the cleanup routine could still fail due to a sharing violation from some other process (likely a child process) setting the directory or a child directory as the working directory. Also, a sharing violation when trying to delete a regular file in the tree causes the cleanup routine to fail with NotADirectoryError because the onerror function calls rmtree() if unlink() fails with a PermissionError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:28:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 14:28:27 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command Message-ID: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> New submission from STINNER Victor : Attached PR removes it. The bdist_wininst command was deprecated in Python 3.8: commit 1da4462765b084dfa8d869b6cb5855e8f6014a11 Author: Victor Stinner Date: Fri Jul 5 10:44:12 2019 +0200 bpo-37481: Deprecate distutils bdist_wininst command (GH-14553) The distutils bdist_wininst command is now deprecated, use bdist_wheel (wheel packages) instead. "What?s New In Python 3.9: Build Changes" also announced: * On non-Windows platforms, creating ``bdist_wininst`` installers is now officially unsupported. (See :issue:`10945` for more details.) https://docs.python.org/dev/whatsnew/3.9.html#build-changes See bpo-37481 and: https://discuss.python.org/t/deprecate-bdist-wininst/1929 ---------- components: Distutils messages: 384173 nosy: dstufft, eric.araujo, vstinner priority: normal severity: normal status: open title: distutils: Remove bdist_wininst command versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:30:26 2021 From: report at bugs.python.org (Steve Stagg) Date: Fri, 01 Jan 2021 14:30:26 +0000 Subject: [issue42801] Exception catching function crashes on recursive list In-Reply-To: <1609478187.83.0.886724654093.issue42801@roundup.psfhosted.org> Message-ID: <1609511426.33.0.73445085619.issue42801@roundup.psfhosted.org> Steve Stagg added the comment: This is fixed by https://github.com/python/cpython/pull/23744 ---------- nosy: +stestagg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:32:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 14:32:41 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609511561.98.0.547894505514.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: There are 19 issues (+ this one) on bdist_wininst. Once distutils bdist_wininst command will be removed, I propose to all these issues. Search for open issues with "bdist_wininst" in the title. Only bpo-41771 was active recently (3 months ago). The 18 other issues are inactive for between 18 months and 121 months (10 years!). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:40:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:40:21 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609512021.85.0.105752511939.issue42794@roundup.psfhosted.org> miss-islington added the comment: New changeset 381f3e4bfd4b1c440f7cb3025972fe0acd0406fc by Miss Islington (bot) in branch '3.8': bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) https://github.com/python/cpython/commit/381f3e4bfd4b1c440f7cb3025972fe0acd0406fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:42:46 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 14:42:46 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609512166.42.0.762612700749.issue42794@roundup.psfhosted.org> miss-islington added the comment: New changeset b20d5e5ce95248e0fa77c5d7bf8f6f5b1231fa53 by Miss Islington (bot) in branch '3.9': bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) https://github.com/python/cpython/commit/b20d5e5ce95248e0fa77c5d7bf8f6f5b1231fa53 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:43:03 2021 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 01 Jan 2021 14:43:03 +0000 Subject: [issue42803] Traced line number is wrong for "if not __debug__" Message-ID: <1609512183.17.0.454209386156.issue42803@roundup.psfhosted.org> New submission from Ned Batchelder : (Using CPython commit 6b1ac809b9) This program never executes line 4, but the "if not __debug__" is partly attributed to line 4, giving an incorrect trace: for value in [True, False]: if value: if not __debug__: 1/0 # line 4 else: x = 6 Using a simple trace program (https://github.com/nedbat/coveragepy/blob/master/lab/run_trace.py), it produces this output: call 1 @-1 line 1 @0 line 2 @8 line 3 @12 line 4 @14 line 1 @4 line 2 @8 line 6 @16 line 1 @4 return 1 @24 Various simplifications of the program make the problem go away. ---------- components: Interpreter Core messages: 384178 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Traced line number is wrong for "if not __debug__" versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 09:44:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 14:44:30 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609512270.92.0.0174157121748.issue42802@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +22884 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:02:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 15:02:51 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609513371.14.0.0156126239515.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: FYI last year, I fixed setuptools v45.2 (released in February 2020) when bdist_wininst is missing: https://github.com/pypa/setuptools/commit/5d17586a56077dfa3109a5861cf0ff579095a42e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:05:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 15:05:12 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609513512.98.0.168727870465.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: Note: bdist_msi is deprecated since Python 3.9 (bpo-39586). I prefer to wait for Python 3.11 to remove it: commit 29b3fc0a18f105de666fdd586b537f34e349766d Author: Hugo van Kemenade Date: Mon Feb 10 15:26:40 2020 +0200 bpo-39586: Deprecate distutils bdist_msi command (GH-18415) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:10:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 15:10:07 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609513807.55.0.65283379452.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: I created a https://discuss.python.org/t/remove-bdist-wininst-command/6434 topic to check if anyone wants to keep the command, or if it's ok to remove it right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:16:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 01 Jan 2021 15:16:10 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609514170.08.0.00103800015921.issue4643@roundup.psfhosted.org> Irit Katriel added the comment: On closer scrutiny I'm not sure this patch should not be merged. The getattr call here has a default value, so it should not raise AttributeError. It should also not raise any other exception because a valid implementation of __getattr__ should raise only AttributeError: https://docs.python.org/3/reference/datamodel.html#object.__getattr__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:16:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 01 Jan 2021 15:16:50 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609514210.19.0.00210890984531.issue4643@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg384182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:17:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 01 Jan 2021 15:17:00 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609514220.83.0.876949122193.issue4643@roundup.psfhosted.org> Irit Katriel added the comment: On closer scrutiny I'm not sure this patch should be merged. The getattr call here has a default value, so it should not raise AttributeError. It should also not raise any other exception because a valid implementation of __getattr__ should raise only AttributeError: https://docs.python.org/3/reference/datamodel.html#object.__getattr__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 10:20:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 01 Jan 2021 15:20:49 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609514449.63.0.974857878445.issue42794@roundup.psfhosted.org> Christian Heimes added the comment: > The test fails because it was relying on an external news server's > configuratoin. This doesn't mean the code itself is broken, just the > test, so clearly: no. Broken and unstable tests are one of two reasons why I listed nntplib in my PEP, https://www.python.org/dev/peps/pep-0594/#nntplib . Q.E.D. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 11:43:04 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 01 Jan 2021 16:43:04 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609519384.88.0.643969284001.issue42794@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: Thanks for the patch, Dong-hee Na. Christian: Tests relying on external resources will always have such issues. This doesn't mean that the code which is being tested is outdated or broken. It's just an issue with the tests. Perhaps we ought to disable external tests for NNTP on CI or ask the PSF to setup a news server for testing purposes (just like we have for SSL tests), e.g. news.pythontest.net mirroring comp.lang.python. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:03:26 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Fri, 01 Jan 2021 17:03:26 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1609520606.69.0.115630301092.issue42802@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:20:33 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 17:20:33 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609521633.16.0.846094394518.issue42756@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 3bf05327c2b25d42b92795d9d280288c22a0963d by Ross in branch 'master': bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when timeout not provided (GH-23969) https://github.com/python/cpython/commit/3bf05327c2b25d42b92795d9d280288c22a0963d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:23:15 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 17:23:15 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609521795.69.0.62237772436.issue42756@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +22885 pull_request: https://github.com/python/cpython/pull/24049 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:24:55 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Jan 2021 17:24:55 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609521895.82.0.110640298452.issue42756@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -22885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:30:55 2021 From: report at bugs.python.org (Ross Rhodes) Date: Fri, 01 Jan 2021 17:30:55 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609522255.91.0.119522393021.issue42756@roundup.psfhosted.org> Change by Ross Rhodes : ---------- pull_requests: +22886 pull_request: https://github.com/python/cpython/pull/24050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:39:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 17:39:44 +0000 Subject: [issue42759] Take into acount a Tcl interpreter when compare variables and fonts In-Reply-To: <1609100219.29.0.633808020235.issue42759@roundup.psfhosted.org> Message-ID: <1609522784.87.0.537929335954.issue42759@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e3a9adba329681b1b73b7223515e71e94fc35e12 by Serhiy Storchaka in branch '3.8': [3.8] bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968) (GH-24026) https://github.com/python/cpython/commit/e3a9adba329681b1b73b7223515e71e94fc35e12 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:40:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 17:40:14 +0000 Subject: [issue42425] Possible leak in initialization of errmap for OSError In-Reply-To: <1605970873.69.0.937757784906.issue42425@roundup.psfhosted.org> Message-ID: <1609522814.61.0.727565022855.issue42425@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1a544e1dcf8e0880ee35ce78a7f90fc4e5c98c4f by Serhiy Storchaka in branch '3.8': [3.8] bpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446). (GH-24025) https://github.com/python/cpython/commit/1a544e1dcf8e0880ee35ce78a7f90fc4e5c98c4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:40:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 17:40:41 +0000 Subject: [issue36589] Incorrect error handling in curses.update_lines_cols() In-Reply-To: <1554923035.79.0.592038232821.issue36589@roundup.psfhosted.org> Message-ID: <1609522841.78.0.311005325178.issue36589@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 187785e2fa2050156a6eda93fb2da31db13f07a6 by Serhiy Storchaka in branch '3.8': [3.8] bpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766) (GH-24023) https://github.com/python/cpython/commit/187785e2fa2050156a6eda93fb2da31db13f07a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:41:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 17:41:52 +0000 Subject: [issue39068] Base 85 encoding initialization race condition In-Reply-To: <1576518904.56.0.627490233403.issue39068@roundup.psfhosted.org> Message-ID: <1609522912.31.0.0748837306187.issue39068@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b863607d303a87e8680149361ac987328b35ca5f by Serhiy Storchaka in branch '3.8': [3.8] bpo-39068: Fix race condition in base64 (GH-17627) (GH-24022) https://github.com/python/cpython/commit/b863607d303a87e8680149361ac987328b35ca5f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:42:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 17:42:27 +0000 Subject: [issue26407] csv.writer.writerows masks exceptions from __iter__ In-Reply-To: <1456144733.82.0.26880413097.issue26407@psf.upfronthosting.co.za> Message-ID: <1609522947.06.0.928799035112.issue26407@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6dffa67b98f78ae41b596f84478f3379f55d4d03 by Serhiy Storchaka in branch '3.8': [3.8] bpo-26407: Do not mask errors in csv. (GH-20536) (GH-24021) https://github.com/python/cpython/commit/6dffa67b98f78ae41b596f84478f3379f55d4d03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:46:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 17:46:29 +0000 Subject: [issue39068] Base 85 encoding initialization race condition In-Reply-To: <1576518904.56.0.627490233403.issue39068@roundup.psfhosted.org> Message-ID: <1609523189.52.0.163479926171.issue39068@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22887 pull_request: https://github.com/python/cpython/pull/24051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:46:45 2021 From: report at bugs.python.org (Paul "TBBle" Hampson) Date: Fri, 01 Jan 2021 17:46:45 +0000 Subject: [issue2142] difflib.unified_diff(...) produces invalid patches In-Reply-To: <1203365817.7.0.0998491412302.issue2142@psf.upfronthosting.co.za> Message-ID: <1609523205.1.0.423760665564.issue2142@roundup.psfhosted.org> Paul "TBBle" Hampson added the comment: I just bounced off this issue and proposed a work-around for it in Black (https://github.com/psf/black/pull/1897). Since it wasn't mentioned here earlier, the `\` marker _is_ documented in the GNU Diffutils documentation, under "Incomplete Lines" (https://www.gnu.org/software/diffutils/manual/html_node/Incomplete-Lines.html#Incomplete-Lines), and applies to both Context and Normal diff output formats. ---------- nosy: +TBBle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 12:50:30 2021 From: report at bugs.python.org (Big Stone) Date: Fri, 01 Jan 2021 17:50:30 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1609523430.02.0.785761976695.issue42686@roundup.psfhosted.org> Big Stone added the comment: it seems resolved now, at least with VS 2019 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:00:07 2021 From: report at bugs.python.org (Bharath Posa) Date: Fri, 01 Jan 2021 18:00:07 +0000 Subject: [issue42804] Unable to compile the code x86 windows Message-ID: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> New submission from Bharath Posa : Hi Team, While I am trying to build the cpython in windows 10. I am getting tcl.h file not found error. You can find the screen shot of the error along with the bug. regards Sunny ---------- components: Build files: error_python_compilation.JPG messages: 384194 nosy: pbharat priority: normal severity: normal status: open title: Unable to compile the code x86 windows versions: Python 3.8 Added file: https://bugs.python.org/file49715/error_python_compilation.JPG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:02:08 2021 From: report at bugs.python.org (Bharath Posa) Date: Fri, 01 Jan 2021 18:02:08 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609524128.31.0.457952375171.issue42804@roundup.psfhosted.org> Change by Bharath Posa : ---------- title: Unable to compile the code x86 windows -> Unable to compile the cpython code x86 windows type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:21:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 01 Jan 2021 18:21:41 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609525301.37.0.494988568992.issue42804@roundup.psfhosted.org> Dennis Sweeney added the comment: What commands did you enter? Are you following the instructions at https://devguide.python.org/setup/ ? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:31:18 2021 From: report at bugs.python.org (Bharath Posa) Date: Fri, 01 Jan 2021 18:31:18 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609525878.8.0.923313142669.issue42804@roundup.psfhosted.org> Bharath Posa added the comment: Followed the instructions as per the link https://devguide.python.org/setup/#setup While running the command build.bat ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:37:42 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 01 Jan 2021 18:37:42 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609526262.27.0.0152572905538.issue42794@roundup.psfhosted.org> Ned Deily added the comment: New changeset 8200ee66697601a8766f234d6eb8e4c8735216fd by Miss Islington (bot) in branch '3.7': bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) (GH-24041) https://github.com/python/cpython/commit/8200ee66697601a8766f234d6eb8e4c8735216fd ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:42:19 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 01 Jan 2021 18:42:19 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609526539.3.0.568741562698.issue42794@roundup.psfhosted.org> Ned Deily added the comment: New changeset 546baba63a446e261d0248338f9034e56eccfc46 by Miss Islington (bot) in branch '3.6': bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) (GH-24042) https://github.com/python/cpython/commit/546baba63a446e261d0248338f9034e56eccfc46 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 13:48:59 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 01 Jan 2021 18:48:59 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609526939.85.0.452599113002.issue42804@roundup.psfhosted.org> Dennis Sweeney added the comment: Were you able to run PCbuild\get_externals.bat ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 14:14:13 2021 From: report at bugs.python.org (Bharath Posa) Date: Fri, 01 Jan 2021 19:14:13 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609528453.7.0.984704919187.issue42804@roundup.psfhosted.org> Bharath Posa added the comment: I just ran the file but got the below error saying permission denied PermissionError: [WinError 5] Access is denied: 'E:\\Libarary\\workspace\\python_dev\\cpython\\PCbuild\\..\\externals\\cpython-bin-deps-tcltk-8.6.9.0' -> 'E:\\Libarary\\workspace\\python_dev\\cpython\\PCbuild\\..\\externals\\tcltk-8.6.9.0' ---------- Added file: https://bugs.python.org/file49716/errors_python.JPG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 14:21:24 2021 From: report at bugs.python.org (Sunny) Date: Fri, 01 Jan 2021 19:21:24 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609528884.96.0.0572717610717.issue42804@roundup.psfhosted.org> Sunny added the comment: I am running using admin rights but still getting the error ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 14:25:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jan 2021 19:25:55 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609529155.61.0.0481350277216.issue42794@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Dong-hee Na for the fix! We have many tests using external services, like test_ssl that Christian may know ;-) https://pythondev.readthedocs.io/infra.html#services-used-by-unit-tests ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 14:39:57 2021 From: report at bugs.python.org (monchy) Date: Fri, 01 Jan 2021 19:39:57 +0000 Subject: [issue42805] broken pygame integration into wxpython Message-ID: <1609529997.71.0.350416816551.issue42805@roundup.psfhosted.org> New submission from monchy : in previous python verions a pygame window could be embedded into wxpython by assigning the SDL_WINDOWID to the current wx.Panel.GetHandle() and the SDL_VIDEODRIVER to 'windib' before importing python the same code creates a separate pygame window in the newest python version a basic implementation can be found here: https://github.com/Monchytales/Puppet-Theatre/blob/main/pygame_panel.py ---------- messages: 384203 nosy: MonchyTales priority: normal severity: normal status: open title: broken pygame integration into wxpython type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 14:56:08 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 01 Jan 2021 19:56:08 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1609530968.5.0.201191621168.issue42686@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yes, R. Hipp has fixed this here: https://www2.sqlite.org/cgi/src/info/e5d7209e118a8453 We still need to modify PCbuild in order to build the SQLite library with math functions from 3.35.0 and onwards. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:18:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 01 Jan 2021 20:18:48 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1609532328.71.0.624584711472.issue42686@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +22888 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:42:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 01 Jan 2021 20:42:52 +0000 Subject: [issue39068] Base 85 encoding initialization race condition In-Reply-To: <1576518904.56.0.627490233403.issue39068@roundup.psfhosted.org> Message-ID: <1609533772.68.0.118598803344.issue39068@roundup.psfhosted.org> miss-islington added the comment: New changeset 0d6e40744ae40ff397883ff90ca235efd3b63f18 by Miss Islington (bot) in branch '3.9': bpo-39068: Fix race condition in base64 (GH-17627) https://github.com/python/cpython/commit/0d6e40744ae40ff397883ff90ca235efd3b63f18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:46:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 20:46:38 +0000 Subject: [issue39068] Base 85 encoding initialization race condition In-Reply-To: <1576518904.56.0.627490233403.issue39068@roundup.psfhosted.org> Message-ID: <1609533998.0.0.797105001173.issue39068@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:47:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 20:47:08 +0000 Subject: [issue26407] csv.writer.writerows masks exceptions from __iter__ In-Reply-To: <1456144733.82.0.26880413097.issue26407@psf.upfronthosting.co.za> Message-ID: <1609534028.37.0.37340010258.issue26407@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:50:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 20:50:36 +0000 Subject: [issue42759] Take into acount a Tcl interpreter when compare variables and fonts In-Reply-To: <1609100219.29.0.633808020235.issue42759@roundup.psfhosted.org> Message-ID: <1609534236.53.0.298425780428.issue42759@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 15:54:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Jan 2021 20:54:44 +0000 Subject: [issue42805] broken pygame integration into wxpython In-Reply-To: <1609529997.71.0.350416816551.issue42805@roundup.psfhosted.org> Message-ID: <1609534484.89.0.287992809.issue42805@roundup.psfhosted.org> Serhiy Storchaka added the comment: Pygame and wxpython are not parts of the stdlib. Please use an appropriate bug tracker. ---------- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 18:30:03 2021 From: report at bugs.python.org (monchy) Date: Fri, 01 Jan 2021 23:30:03 +0000 Subject: [issue42805] broken pygame integration into wxpython In-Reply-To: <1609534484.89.0.287992809.issue42805@roundup.psfhosted.org> Message-ID: monchy added the comment: The only thing I changed was the version of python I was using, which means that whatever caused the problem was python itself if something was changed in how the interpreter operates the environmental variables or something then that might do it PYTHON broke MY software, so this and this alone is the appropriate bug tracker On Fri, 1 Jan 2021 at 15:54, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Pygame and wxpython are not parts of the stdlib. Please use an appropriate > bug tracker. > > ---------- > nosy: +serhiy.storchaka > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:00:22 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 02 Jan 2021 00:00:22 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions Message-ID: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> New submission from Anthony Sottile : here's a sample file. this is distilled down from an example which broke a code formatter here: https://github.com/asottile/add-trailing-comma/issues/106 def f(): x = ( 'PERL_MM_OPT', ( f'INSTALL-BASE={shlex.quote(venv)} ' f'wat' ), ) A diff from astpretty (https://github.com/asottile/astpretty) between the old and new parser: ```console $ diff -u <(.tox/py39/bin/python -X oldparser -m astpretty perl.py) <(.tox/py39/bin/python -m astpretty perl.py) --- /dev/fd/63 2021-01-01 15:58:09.108060968 -0800 +++ /dev/fd/62 2021-01-01 15:58:09.108060968 -0800 @@ -35,19 +35,19 @@ end_col_offset=22, value=Call( lineno=4, - col_offset=32, + col_offset=16, end_lineno=4, - end_col_offset=49, + end_col_offset=33, func=Attribute( lineno=4, - col_offset=32, + col_offset=16, end_lineno=4, - end_col_offset=43, - value=Name(lineno=4, col_offset=32, end_lineno=4, end_col_offset=37, id='shlex', ctx=Load()), + end_col_offset=27, + value=Name(lineno=4, col_offset=16, end_lineno=4, end_col_offset=21, id='shlex', ctx=Load()), attr='quote', ctx=Load(), ), - args=[Name(lineno=4, col_offset=44, end_lineno=4, end_col_offset=48, id='venv', ctx=Load())], + args=[Name(lineno=4, col_offset=28, end_lineno=4, end_col_offset=32, id='venv', ctx=Load())], keywords=[], ), conversion=-1, ``` the old parser is correct here, and the new parser is wrong notably it thinks that the call inside the f-string substitution is positioned at column 16 which is the position of the f-string start this bug is also present in 3.10: ```console $ venv/bin/python3.10 --version Python 3.10.0a3 $ diff -u <(.tox/py39/bin/python -X oldparser -m astpretty perl.py) <(venv/bin/python3.10 -m astpretty perl.py) --- /dev/fd/63 2021-01-01 15:59:54.000059968 -0800 +++ /dev/fd/62 2021-01-01 15:59:54.000059968 -0800 @@ -35,19 +35,19 @@ end_col_offset=22, value=Call( lineno=4, - col_offset=32, + col_offset=16, end_lineno=4, - end_col_offset=49, + end_col_offset=33, func=Attribute( lineno=4, - col_offset=32, + col_offset=16, end_lineno=4, - end_col_offset=43, - value=Name(lineno=4, col_offset=32, end_lineno=4, end_col_offset=37, id='shlex', ctx=Load()), + end_col_offset=27, + value=Name(lineno=4, col_offset=16, end_lineno=4, end_col_offset=21, id='shlex', ctx=Load()), attr='quote', ctx=Load(), ), - args=[Name(lineno=4, col_offset=44, end_lineno=4, end_col_offset=48, id='venv', ctx=Load())], + args=[Name(lineno=4, col_offset=28, end_lineno=4, end_col_offset=32, id='venv', ctx=Load())], keywords=[], ), conversion=-1, ``` ---------- components: Interpreter Core messages: 384208 nosy: Anthony Sottile priority: normal severity: normal status: open title: Incorrect offsets in new parser for f-string substitutions type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:11:01 2021 From: report at bugs.python.org (Rahul Jha) Date: Sat, 02 Jan 2021 00:11:01 +0000 Subject: [issue34451] docs: tutorial/introduction doesn't mention toggle of prompts In-Reply-To: <1534877418.64.0.56676864532.issue34451@psf.upfronthosting.co.za> Message-ID: <1609546261.37.0.511325408053.issue34451@roundup.psfhosted.org> Change by Rahul Jha : ---------- nosy: +RJ722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:23:44 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 02 Jan 2021 00:23:44 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609547024.86.0.0692508313058.issue42806@roundup.psfhosted.org> Anthony Sottile added the comment: +peg parser individuals to nosy ---------- nosy: +gvanrossum, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:25:44 2021 From: report at bugs.python.org (Rahul Jha) Date: Sat, 02 Jan 2021 00:25:44 +0000 Subject: [issue30044] shutil.copystat should (allow to) copy ownership, and other attributes In-Reply-To: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za> Message-ID: <1609547144.42.0.99485147955.issue30044@roundup.psfhosted.org> Change by Rahul Jha : ---------- nosy: +RJ722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:34:54 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 02 Jan 2021 00:34:54 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609547694.62.0.841834646555.issue42806@roundup.psfhosted.org> Guido van Rossum added the comment: Did you check this with master? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:43:45 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 02 Jan 2021 00:43:45 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609548225.95.0.710589176503.issue42806@roundup.psfhosted.org> Anthony Sottile added the comment: I didn't initially, but now I have and it has the same bug in the current master: 3bf05327c2b25d42b92795d9d280288c22a0963d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:45:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 02 Jan 2021 00:45:58 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1609548358.77.0.83632795028.issue41559@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 11276cd9c49faea66ce7760f26a238d1edbf6421 by Ken Jin in branch 'master': bpo-41559: Documentation for PEP 612 (GH-24000) https://github.com/python/cpython/commit/11276cd9c49faea66ce7760f26a238d1edbf6421 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 19:49:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 02 Jan 2021 00:49:59 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1609548599.47.0.77014975734.issue41559@roundup.psfhosted.org> Guido van Rossum added the comment: Looks like we can close this now, right? You can open a separate issue in the python/typing repo to update typing_extensions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:41:59 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:41:59 +0000 Subject: [issue16132] ctypes incorrectly encodes .format attribute of memory views In-Reply-To: <1349364906.03.0.586114989306.issue16132@psf.upfronthosting.co.za> Message-ID: <1609555319.44.0.383788925404.issue16132@roundup.psfhosted.org> Change by David Beazley : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:42:12 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:42:12 +0000 Subject: [issue27436] Strange code in selectors.KqueueSelector In-Reply-To: <1467387207.61.0.938158843585.issue27436@psf.upfronthosting.co.za> Message-ID: <1609555332.76.0.684930035581.issue27436@roundup.psfhosted.org> Change by David Beazley : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:42:25 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:42:25 +0000 Subject: [issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4 In-Reply-To: <1439312804.21.0.961990235071.issue24844@psf.upfronthosting.co.za> Message-ID: <1609555345.91.0.514675596156.issue24844@roundup.psfhosted.org> Change by David Beazley : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:42:35 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:42:35 +0000 Subject: [issue32810] Expose ags_gen and agt_gen in asynchronous generators In-Reply-To: <1518205773.11.0.467229070634.issue32810@psf.upfronthosting.co.za> Message-ID: <1609555355.81.0.37247657569.issue32810@roundup.psfhosted.org> Change by David Beazley : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:42:47 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:42:47 +0000 Subject: [issue16894] Function attribute access doesn't invoke methods in dict subclasses In-Reply-To: <1357670592.25.0.470525675752.issue16894@psf.upfronthosting.co.za> Message-ID: <1609555367.4.0.505011727378.issue16894@roundup.psfhosted.org> Change by David Beazley : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 21:43:00 2021 From: report at bugs.python.org (David Beazley) Date: Sat, 02 Jan 2021 02:43:00 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1609555380.58.0.0562917834059.issue7946@roundup.psfhosted.org> Change by David Beazley : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 22:44:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 02 Jan 2021 03:44:12 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609559052.74.0.451612561318.issue42756@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 69120613c071e9327a9dc6e4b1ff21b2e94d885e by Ross in branch '3.9': [3.9] bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when timeout not provided (GH-23969) (GH-24050) https://github.com/python/cpython/commit/69120613c071e9327a9dc6e4b1ff21b2e94d885e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 22:48:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 02 Jan 2021 03:48:39 +0000 Subject: [issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified In-Reply-To: <1609074713.39.0.771360640486.issue42756@roundup.psfhosted.org> Message-ID: <1609559319.69.0.621759766092.issue42756@roundup.psfhosted.org> Dong-hee Na added the comment: Thanks, Ross Rhodes for the fix! And thanks, W?stengecko for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 23:23:16 2021 From: report at bugs.python.org (oon arfiandwi) Date: Sat, 02 Jan 2021 04:23:16 +0000 Subject: [issue42807] smtplib send_message should gives more clear exception if the msg is None Message-ID: <1609561396.29.0.629926386929.issue42807@roundup.psfhosted.org> New submission from oon arfiandwi : I want to enhance the error message on the send_message method of class SMTP, in module smtplib. One of the parameters on send_message is msg which is email.message.Message object, this is a required argument. If the msg is None, currently it will raise "AttributeError: 'NoneType' object has no attribute 'get_all'". This message is not straight forward and a bit hard to debug. As the easy fix with additional check if msg is None in send_message method. I want to add PR on this, also with the additional test(s). This is my first issue, appreciate any feedback. thank you. ---------- components: Library (Lib) messages: 384216 nosy: oon priority: normal severity: normal status: open title: smtplib send_message should gives more clear exception if the msg is None type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 1 23:30:10 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 02 Jan 2021 04:30:10 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1609548599.47.0.77014975734.issue41559@roundup.psfhosted.org> Message-ID: Ken Jin added the comment: I have just one more PR - one that converts genericalias nested lists to tuples by default. It'll simplify the code a little bit and prepare 3.9.x for PEP 612. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 04:02:56 2021 From: report at bugs.python.org (Berry Schoenmakers) Date: Sat, 02 Jan 2021 09:02:56 +0000 Subject: [issue42557] Make asyncio.__main__ reusable, also adding a preamble feature. In-Reply-To: <1607009685.51.0.588770537577.issue42557@roundup.psfhosted.org> Message-ID: <1609578176.52.0.96168114671.issue42557@roundup.psfhosted.org> Change by Berry Schoenmakers : ---------- keywords: +patch pull_requests: +22889 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 04:45:37 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 02 Jan 2021 09:45:37 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1609580737.72.0.334121834027.issue41559@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +22890 pull_request: https://github.com/python/cpython/pull/24056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 04:54:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 09:54:12 +0000 Subject: [issue42425] Possible leak in initialization of errmap for OSError In-Reply-To: <1605970873.69.0.937757784906.issue42425@roundup.psfhosted.org> Message-ID: <1609581252.13.0.142656213001.issue42425@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22891 pull_request: https://github.com/python/cpython/pull/24057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:00:06 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 02 Jan 2021 10:00:06 +0000 Subject: [issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance Message-ID: <1609581606.85.0.894764244692.issue42808@roundup.psfhosted.org> New submission from Dennis Sweeney : # common case .\python.bat -m pyperf timeit "type(17)" Master: 49.9 ns +- 1.8 ns ---> PR: 33.3 ns +- 1.4 ns # uncommon case .\python.bat -m pyperf timeit "type('A', (object, ), {})" Master: 5.14 us +- 0.04 us ---> PR: 5.43 us +- 0.06 us ---------- components: Interpreter Core messages: 384218 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add PyType_Type.tp_vectorcall for type(obj) performance type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:04:18 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 02 Jan 2021 10:04:18 +0000 Subject: [issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance In-Reply-To: <1609581606.85.0.894764244692.issue42808@roundup.psfhosted.org> Message-ID: <1609581858.08.0.882062814361.issue42808@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +22892 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:19:15 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 02 Jan 2021 10:19:15 +0000 Subject: [issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable In-Reply-To: <1603974319.88.0.166786801787.issue42195@roundup.psfhosted.org> Message-ID: <1609582755.15.0.224486316788.issue42195@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +22893 pull_request: https://github.com/python/cpython/pull/24059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:24:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 10:24:30 +0000 Subject: [issue42425] Possible leak in initialization of errmap for OSError In-Reply-To: <1605970873.69.0.937757784906.issue42425@roundup.psfhosted.org> Message-ID: <1609583070.86.0.496885647353.issue42425@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 7695d832565914efcedcc885feb129f5102aec90 by Serhiy Storchaka in branch '3.9': [3.9] bpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446). (GH-24057) https://github.com/python/cpython/commit/7695d832565914efcedcc885feb129f5102aec90 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:37:37 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 02 Jan 2021 10:37:37 +0000 Subject: [issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance In-Reply-To: <1609581606.85.0.894764244692.issue42808@roundup.psfhosted.org> Message-ID: <1609583857.54.0.0128983703916.issue42808@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:47:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 10:47:46 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609584466.05.0.345614999487.issue42809@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:47:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 10:47:08 +0000 Subject: [issue42809] Improve pickle tests for recursive data Message-ID: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR extends tests for pickling recursive structures. The code is now more generic and covers more corner cases (found during work on issue36694). ---------- components: Tests messages: 384220 nosy: alexandre.vassalotti, serhiy.storchaka priority: normal severity: normal status: open title: Improve pickle tests for recursive data type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 05:59:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 10:59:37 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609585177.14.0.482102173959.issue42809@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +22894 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 06:05:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 11:05:39 +0000 Subject: [issue42425] Possible leak in initialization of errmap for OSError In-Reply-To: <1605970873.69.0.937757784906.issue42425@roundup.psfhosted.org> Message-ID: <1609585539.65.0.856896182991.issue42425@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 08:21:57 2021 From: report at bugs.python.org (karl) Date: Sat, 02 Jan 2021 13:21:57 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609593717.62.0.433147344984.issue4643@roundup.psfhosted.org> karl added the comment: > The getattr call here has a default value, so it should not raise AttributeError. It should also not raise any other exception because a valid implementation of __getattr__ should raise only AttributeError: but probably the intent of the patch here is to surface a meaningful error with regards to the script, more than an error on the cgitb python lib itself as this is a traceback tool. A bit like an HTML validator which continue to process things to give some kind of meaning. Diving into previous issues about scanvars https://bugs.python.org/issue966992 Similar https://bugs.python.org/issue1047397 The last comment is basically this issue here. There is a patch which is lot better for this bug and which addresses the issues here. https://github.com/python/cpython/pull/15094 It has not been merged yet. Not sure why or if there is anything missing. Probably this bug could be closed as a duplicate of https://bugs.python.org/issue966992 And someone needs to push to push the latest bits for https://github.com/python/cpython/pull/15094 What do you think @iritkatriel ? I will close my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 09:01:58 2021 From: report at bugs.python.org (Matej Cepl) Date: Sat, 02 Jan 2021 14:01:58 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1609596118.13.0.827953672355.issue40059@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 10:09:25 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 02 Jan 2021 15:09:25 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) Message-ID: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> New submission from Ned Batchelder : (Using CPython commit 6b1ac809b9) This program never executes line 6, but tracing it claims that it does: a = b = x = y = z = 1 if a == 1: if b == 1: x = 4 else: y = 6 else: z = 8 assert (a, b, x, y, z) == (1, 1, 4, 1, 1) Using a simple trace program (https://github.com/nedbat/coveragepy/blob/master/lab/run_trace.py), it produces this output: call 1 @-1 line 1 @0 line 2 @20 line 3 @28 line 4 @36 line 6 @40 line 9 @52 return 9 @76 ---------- components: Interpreter Core messages: 384222 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Nested if/else gets phantom else trace (3.10) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 10:19:20 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 02 Jan 2021 15:19:20 +0000 Subject: [issue42803] Traced line number is wrong for "if not __debug__" In-Reply-To: <1609512183.17.0.454209386156.issue42803@roundup.psfhosted.org> Message-ID: <1609600760.97.0.299729368916.issue42803@roundup.psfhosted.org> Ned Batchelder added the comment: This might be the same problem as #42810. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 10:19:36 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 02 Jan 2021 15:19:36 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609600776.57.0.297899247634.issue42810@roundup.psfhosted.org> Ned Batchelder added the comment: This might be the same problem as #42803. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 10:42:45 2021 From: report at bugs.python.org (hai shi) Date: Sat, 02 Jan 2021 15:42:45 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609602165.12.0.596008780563.issue41798@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +22895 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 11:08:47 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 02 Jan 2021 16:08:47 +0000 Subject: [issue42257] platform.libc_ver() doesn't consider in case of executable is empty string In-Reply-To: <1604469715.55.0.889552705694.issue42257@roundup.psfhosted.org> Message-ID: <1609603727.38.0.39813010211.issue42257@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: https://github.com/python/cpython/pull/23140 merged. Thanks for the patch, Kurochan. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 11:10:14 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 02 Jan 2021 16:10:14 +0000 Subject: [issue42257] platform.libc_ver() doesn't consider in case of executable is empty string In-Reply-To: <1604469715.55.0.889552705694.issue42257@roundup.psfhosted.org> Message-ID: <1609603814.09.0.946859150634.issue42257@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: Note: I did not request a backport, since this really is a new feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 11:19:18 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 02 Jan 2021 16:19:18 +0000 Subject: [issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable In-Reply-To: <1603974319.88.0.166786801787.issue42195@roundup.psfhosted.org> Message-ID: <1609604358.92.0.890282379381.issue42195@roundup.psfhosted.org> miss-islington added the comment: New changeset 49cd68fb1ed4cbaf109308c0a7c8c1efcf6f3775 by Ken Jin in branch 'master': bpo-42195: Disallow isinstance/issubclass for subclasses of genericaliases in Union (GH-24059) https://github.com/python/cpython/commit/49cd68fb1ed4cbaf109308c0a7c8c1efcf6f3775 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 11:38:59 2021 From: report at bugs.python.org (Petr Viktorin) Date: Sat, 02 Jan 2021 16:38:59 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609605539.93.0.943757502981.issue40077@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 75bf107c62fbdc00af51ee4f6ab69df4bd201104 by Erlend Egeberg Aasland in branch 'master': bpo-40077: Convert arraymodule to use heap types and establish module state (GH-23124) https://github.com/python/cpython/commit/75bf107c62fbdc00af51ee4f6ab69df4bd201104 ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 11:53:03 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 02 Jan 2021 16:53:03 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609606383.71.0.942409301396.issue42806@roundup.psfhosted.org> Anthony Sottile added the comment: by the way, here's a much smaller case which has a similar problem ``` x = ( f" {test(t)}" ) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:32:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 17:32:56 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609608776.91.0.921454033883.issue42809@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a25011be8c6f62cb3333903befe6295d57f0bd30 by Serhiy Storchaka in branch 'master': bpo-42809: Improve pickle tests for recursive data. (GH-24060) https://github.com/python/cpython/commit/a25011be8c6f62cb3333903befe6295d57f0bd30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:33:46 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 02 Jan 2021 17:33:46 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609608826.05.0.761638778864.issue42809@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +22896 pull_request: https://github.com/python/cpython/pull/24062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:33:56 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 02 Jan 2021 17:33:56 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609608836.5.0.747496188213.issue42809@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22897 pull_request: https://github.com/python/cpython/pull/24063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:35:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 17:35:18 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609608918.78.0.385649454466.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 607501abb488fb37e33cf9d35260ab7baefa192f by Serhiy Storchaka in branch 'master': bpo-42789: Don't skip curses tests on non-tty. (GH-24009) https://github.com/python/cpython/commit/607501abb488fb37e33cf9d35260ab7baefa192f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:36:27 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 02 Jan 2021 17:36:27 +0000 Subject: [issue42803] Traced line number is wrong for "if not __debug__" In-Reply-To: <1609512183.17.0.454209386156.issue42803@roundup.psfhosted.org> Message-ID: <1609608987.33.0.949157795007.issue42803@roundup.psfhosted.org> Ned Batchelder added the comment: I think I am finding more examples of the same problem, so I will just add it here: x = "hello" try: 3/0 except ZeroDivisionError: if x == 'raise': raise ValueError() # line 6 f = 7 This shows a trace for line 6, which is never excecuted: call 1 @-1 line 1 @0 line 2 @4 line 3 @6 exception 3 @10 line 4 @24 line 5 @36 line 6 @50 line 7 @52 return 7 @58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:50:45 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 02 Jan 2021 17:50:45 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609609845.38.0.750836326348.issue42809@roundup.psfhosted.org> miss-islington added the comment: New changeset 2e8b1c9e9b2d2e011bf35f77cd611843bac7f3dd by Miss Islington (bot) in branch '3.8': bpo-42809: Improve pickle tests for recursive data. (GH-24060) https://github.com/python/cpython/commit/2e8b1c9e9b2d2e011bf35f77cd611843bac7f3dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 12:53:55 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 02 Jan 2021 17:53:55 +0000 Subject: [issue42809] Improve pickle tests for recursive data In-Reply-To: <1609584428.87.0.716102907179.issue42809@roundup.psfhosted.org> Message-ID: <1609610035.52.0.517171694786.issue42809@roundup.psfhosted.org> miss-islington added the comment: New changeset 39a7578186d2f5eaa112a5854c46f84eae401522 by Miss Islington (bot) in branch '3.9': bpo-42809: Improve pickle tests for recursive data. (GH-24060) https://github.com/python/cpython/commit/39a7578186d2f5eaa112a5854c46f84eae401522 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 13:24:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Jan 2021 18:24:58 +0000 Subject: [issue42772] randrange() mishandles step when stop is None In-Reply-To: <1609183417.92.0.845527263557.issue42772@roundup.psfhosted.org> Message-ID: <1609611898.56.0.16838871535.issue42772@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 768fa145cfec2a0599802b74fc31d2bc2812ed96 by Raymond Hettinger in branch 'master': bpo-42772: Step argument ignored when stop is None. (GH-24018) https://github.com/python/cpython/commit/768fa145cfec2a0599802b74fc31d2bc2812ed96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 13:25:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Jan 2021 18:25:13 +0000 Subject: [issue42772] randrange() mishandles step when stop is None In-Reply-To: <1609183417.92.0.845527263557.issue42772@roundup.psfhosted.org> Message-ID: <1609611913.76.0.706743922887.issue42772@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 14:11:56 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 02 Jan 2021 19:11:56 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609614716.76.0.950961698607.issue40077@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Should Modules/_testcapimodule.c stay untouched? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 14:28:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 02 Jan 2021 19:28:42 +0000 Subject: [issue4643] cgitb.html fails if getattr call raises exception In-Reply-To: <1229093313.68.0.275889144486.issue4643@psf.upfronthosting.co.za> Message-ID: <1609615722.57.0.862099064131.issue4643@roundup.psfhosted.org> Irit Katriel added the comment: I agree that this can be closed as duplicate. Thanks, Karl, for the research. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> cgitb failures _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 15:27:59 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 02 Jan 2021 20:27:59 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__ Message-ID: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> New submission from Brett Cannon : Since importlib now prefers `__spec__` over `__package__`, https://docs.python.org/3/library/importlib.html#importlib.util.resolve_name should be updated to use `__spec__.parent` instead in the. example. ---------- assignee: brett.cannon components: Documentation keywords: easy messages: 384238 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 15:28:34 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 02 Jan 2021 20:28:34 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1609619314.61.0.0436054962517.issue40059@roundup.psfhosted.org> Change by Brett Cannon : ---------- versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 16:11:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jan 2021 21:11:43 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609621903.72.0.165857942184.issue40636@roundup.psfhosted.org> Serhiy Storchaka added the comment: Tests test_zip_pickle_stability and test_zip_pickle_strict_stability look excessively strict. Why did we need them if there are other pickle tests? They prevent implementing optimizations like in issue36694. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 16:58:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Jan 2021 21:58:23 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609624703.16.0.75765394861.issue42810@roundup.psfhosted.org> Raymond Hettinger added the comment: Confirmed. This regression happened between 3.10 alpha 2 and today's build: $ python3.10 --version Python 3.10.0a2 $ python3.10 -m trace --trace tmp19.py --- modulename: tmp19, funcname: tmp19.py(1): a = b = x = y = z = 1 tmp19.py(2): if a == 1: tmp19.py(3): if b == 1: tmp19.py(4): x = 4 tmp19.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1) $ py --version Python 3.10.0a3+ $ py -m trace --trace tmp19.py --- modulename: tmp19, funcname: tmp19.py(1): a = b = x = y = z = 1 tmp19.py(2): if a == 1: tmp19.py(3): if b == 1: tmp19.py(4): x = 4 tmp19.py(6): y = 6 tmp19.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1) ---------- nosy: +pablogsal, rhettinger priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 17:01:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Jan 2021 22:01:11 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609624871.82.0.507637331238.issue42789@roundup.psfhosted.org> STINNER Victor added the comment: Buildbot failure: ARM Raspbian 3.x: https://buildbot.python.org/all/#/builders/424/builds/658 Tests are run with env var TERM=screen.xterm-256color. ====================================================================== ERROR: test_colors_funcs (test.test_curses.TestCurses) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_curses.py", line 316, in test_colors_funcs curses.pair_content(curses.COLOR_PAIRS - 1) _curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 17:03:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Jan 2021 22:03:55 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609625035.63.0.564340936489.issue42789@roundup.psfhosted.org> STINNER Victor added the comment: s390x RHEL8 3.x: https://buildbot.python.org/all/#/builders/509/builds/601 Tests run with TERM=xterm-256color. ====================================================================== ERROR: test_colors_funcs (test.test_curses.TestCurses) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z/build/Lib/test/test_curses.py", line 316, in test_colors_funcs curses.pair_content(curses.COLOR_PAIRS - 1) _curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1) -- test.pythoninfo doesn't log anything about curses. I expected to find _curses.ncurses_version there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 17:04:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Jan 2021 22:04:59 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609625099.89.0.740237593067.issue40636@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 17:07:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Jan 2021 22:07:25 +0000 Subject: [issue42557] Make asyncio.__main__ reusable, also adding a preamble feature. In-Reply-To: <1607009685.51.0.588770537577.issue42557@roundup.psfhosted.org> Message-ID: <1609625245.83.0.326272135965.issue42557@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 17:45:50 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 02 Jan 2021 22:45:50 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609627550.8.0.0466169466089.issue40636@roundup.psfhosted.org> Guido van Rossum added the comment: That's fair. How do other builtins validate their pickling implementation? Since the pickling goes through __reduce__/__reduce_ex__ we could instead test that those methods return the expected results, that pickling roundtrips, and that unpickling those exact byte strings produces the expected value? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 18:13:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 02 Jan 2021 23:13:48 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609629228.15.0.368849492107.issue40077@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22898 pull_request: https://github.com/python/cpython/pull/24065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 18:14:28 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sat, 02 Jan 2021 23:14:28 +0000 Subject: [issue40631] PEG Parser: Cannot used starred expression in parenthesised expr In-Reply-To: <1589544267.84.0.231872596395.issue40631@roundup.psfhosted.org> Message-ID: <1609629268.11.0.421365127807.issue40631@roundup.psfhosted.org> Lysandros Nikolaou added the comment: New changeset 2ea320dddd553298038bb7d6789e50e199332f66 by Lysandros Nikolaou in branch 'master': bpo-40631: Disallow single parenthesized star target (GH-24027) https://github.com/python/cpython/commit/2ea320dddd553298038bb7d6789e50e199332f66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 18:23:21 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 02 Jan 2021 23:23:21 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609629801.55.0.289914583499.issue40077@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22899 pull_request: https://github.com/python/cpython/pull/24066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 18:24:50 2021 From: report at bugs.python.org (Marco Atzeri) Date: Sat, 02 Jan 2021 23:24:50 +0000 Subject: [issue41374] socket.TCP_* no longer available with cygwin 3.1.6+ In-Reply-To: <1595490704.07.0.649120374256.issue41374@roundup.psfhosted.org> Message-ID: <1609629890.48.0.148710780499.issue41374@roundup.psfhosted.org> Marco Atzeri added the comment: The Analysis is correct. Removing the test for CYGWIN and always include the solved the problem building all python (3.6,3.7,3.8) packages https://sourceware.org/pipermail/cygwin-apps/2020-December/040845.html https://sourceware.org/pipermail/cygwin-announce/2020-December/009853.html attached patch used on the build. Similar one was applied to the rebuild of 2.7.18 ---------- nosy: +matzeri versions: +Python 3.6, Python 3.7 Added file: https://bugs.python.org/file49717/3.6.12-socketmodule.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 19:02:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 00:02:11 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609632131.53.0.216713821107.issue42806@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +22900 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 19:19:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 00:19:23 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609633163.51.0.552592806521.issue42806@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that I also found this weird behaviour in the old parser: import ast code = """\ x = ( 'PERL_MM_OPT', ( f'wat' f'INSTALL-BASE={shlex.quote(venv)} ' f'wat' ), ) """ elem = ast.parse(code).body[0].value.elts[1].values[1].value print(elem) print(code.split("\n")[elem.lineno-1][elem.col_offset:elem.end_col_offset]) In Python3.8 this prints: <_ast.Call object at 0x7f7484393a00> 'wat' which is wrong as the code for that call is certainly not "wat". This happens in the oldparser in 3.9: ? ../3.9/python -Xoldparser lel.py 'wat' And something wrong happens in the current master with the new parser: ? ../3.9/python lel.py STALL-BASE={shlex But with PR24067: shlex.quote(venv) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 19:38:00 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sun, 03 Jan 2021 00:38:00 +0000 Subject: [issue40631] PEG Parser: Cannot used starred expression in parenthesised expr In-Reply-To: <1589544267.84.0.231872596395.issue40631@roundup.psfhosted.org> Message-ID: <1609634280.2.0.682938284333.issue40631@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- pull_requests: +22901 pull_request: https://github.com/python/cpython/pull/24068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 19:59:56 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 03 Jan 2021 00:59:56 +0000 Subject: [issue40631] PEG Parser: Cannot used starred expression in parenthesised expr In-Reply-To: <1589544267.84.0.231872596395.issue40631@roundup.psfhosted.org> Message-ID: <1609635596.09.0.436730151989.issue40631@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a608ac17c284008d3c2986a4a8b194f84488e56 by Lysandros Nikolaou in branch '3.9': [3.9] bpo-40631: Disallow single parenthesized star target (GH-24027) (GH-24068) https://github.com/python/cpython/commit/9a608ac17c284008d3c2986a4a8b194f84488e56 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:06:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 03 Jan 2021 01:06:44 +0000 Subject: [issue15106] Potential Bug in errors.c In-Reply-To: <1340120572.84.0.94173614856.issue15106@psf.upfronthosting.co.za> Message-ID: <1609636004.29.0.12059357414.issue15106@roundup.psfhosted.org> Irit Katriel added the comment: The code is not really cloned - note that PyErr_Restore is operating on tstate->curexc (the exception currently being handled) while PyErr_SetExcInfo is operating on tstate->exc_info (the earliest exception currently on the exception stack). If there is a bug here, I think it is the silent conversion of traceback to NULL in the case where it is neither NULL nor Py_None. (The case in PyErr_Restore that the comment says should not happen). Otherwise, the difference is that PyErr_Restore transforms Py_None to NULL for the traceback, and PyErr_SetExcInfo doesn't. That conversion seems neither necessary nor wrong. ---------- nosy: +iritkatriel versions: +Python 3.10 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:12:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 01:12:11 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609636331.43.0.854741815373.issue42806@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f by Pablo Galindo in branch 'master': bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067) https://github.com/python/cpython/commit/bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:13:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 01:13:04 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609636384.97.0.43160522115.issue42806@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +22902 pull_request: https://github.com/python/cpython/pull/24069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:32:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 01:32:51 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609637571.57.0.209640928502.issue42806@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:33:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 01:33:09 +0000 Subject: [issue42806] Incorrect offsets in new parser for f-string substitutions In-Reply-To: <1609545622.39.0.162230247041.issue42806@roundup.psfhosted.org> Message-ID: <1609637589.17.0.563399702071.issue42806@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bfc413ce4fa37ccb889757388102c7755e057bf5 by Pablo Galindo in branch '3.9': [3.9] bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067) (GH-24069) https://github.com/python/cpython/commit/bfc413ce4fa37ccb889757388102c7755e057bf5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 20:57:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 01:57:55 +0000 Subject: [issue15106] Potential Bug in errors.c In-Reply-To: <1340120572.84.0.94173614856.issue15106@psf.upfronthosting.co.za> Message-ID: <1609639075.48.0.309752656386.issue15106@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Adding extra checks to PyErr_SetExcInfo doesn't have a lot of value because is already out of of contract. If you pass an invalid object (let's say a list) to any of the specific APIs (like PyDict_GetItem) it will crash anyway. We could add some assert, though. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 21:01:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 02:01:34 +0000 Subject: [issue40631] PEG Parser: Cannot used starred expression in parenthesised expr In-Reply-To: <1589544267.84.0.231872596395.issue40631@roundup.psfhosted.org> Message-ID: <1609639294.48.0.252405261907.issue40631@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 21:01:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 02:01:22 +0000 Subject: [issue15106] Potential Bug in errors.c In-Reply-To: <1340120572.84.0.94173614856.issue15106@psf.upfronthosting.co.za> Message-ID: <1609639282.75.0.616132040655.issue15106@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 21:15:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 02:15:39 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609640139.47.0.0115401338329.issue42810@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Bisecting points at this commit as the culprit: 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a is the first bad commit commit 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a Author: Mark Shannon Date: Wed Dec 23 11:43:10 2020 +0000 bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896) Lib/test/test_dis.py | 169 +- Lib/test/test_sys_settrace.py | 64 + .../2020-12-22-20-30-11.bpo-42246.7BrPLg.rst | 1 + Python/compile.c | 135 +- Python/importlib.h | 1531 +++--- Python/importlib_external.h | 4884 ++++++++++---------- Python/importlib_zipimport.h | 1796 +++---- 7 files changed, 4341 insertions(+), 4239 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst bisect run success ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 21:37:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 02:37:42 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609641462.41.0.55872840958.issue42810@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: There is something wrong elsewhere as well because even if reverting that commit fix the problem: ? git reset --hard upstream/master HEAD is now at bd2728b1e8 bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067) ~/github/python/master master* ? git revert 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a Removing Misc/NEWS.d/next/Core and Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst mak[master 444e7e11a8] Revert "bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)" 7 files changed, 4605 insertions(+), 4707 deletions(-) delete mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst rewrite Python/importlib_external.h (87%) rewrite Python/importlib_zipimport.h (85%) e ~/github/python/master master* ? ? make -j -s CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-g -Og -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py -q build The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time ~/github/python/master master* ? ? ./python -m trace --trace ./lel.py --- modulename: lel, funcname: lel.py(1): a = b = x = y = z = 1 lel.py(2): if a == 1: lel.py(3): if b == 1: lel.py(4): x = 4 lel.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1) Not running the optimize_basic_block function: diff --git a/Python/compile.c b/Python/compile.c index 6698b55000..30a0305ef1 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -6074,6 +6074,7 @@ fold_tuple_on_constants(struct instr *inst, static int optimize_basic_block(basicblock *bb, PyObject *consts) { + return 0; assert(PyList_CheckExact(consts)); struct instr nop; nop.i_opcode = NOP; makes the problem appear again: ? make -j -s CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-g -Og -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py -q build The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time ~/github/python/master master* ? ? ./python -m trace --trace ./lel.py --- modulename: lel, funcname: lel.py(1): a = b = x = y = z = 1 lel.py(2): if a == 1: lel.py(3): if b == 1: lel.py(4): x = 4 lel.py(6): y = 6 lel.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 21:53:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 02:53:43 +0000 Subject: [issue42093] Add opcode cache for LOAD_ATTR In-Reply-To: <1603163916.18.0.528007796853.issue42093@roundup.psfhosted.org> Message-ID: <1609642423.78.0.478710689338.issue42093@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +22903 pull_request: https://github.com/python/cpython/pull/24070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 2 23:38:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 04:38:11 +0000 Subject: [issue42093] Add opcode cache for LOAD_ATTR In-Reply-To: <1603163916.18.0.528007796853.issue42093@roundup.psfhosted.org> Message-ID: <1609648691.62.0.913962483928.issue42093@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9e8fe1986cb4205fb9f883c89b9d5d76a9847e0b by Pablo Galindo in branch 'master': bpo-42093: Tweak the what's new message about the new LOAD_ATTR opcode cache (GH-24070) https://github.com/python/cpython/commit/9e8fe1986cb4205fb9f883c89b9d5d76a9847e0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 00:37:51 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 03 Jan 2021 05:37:51 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1609652271.06.0.263524528058.issue7946@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 00:51:32 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 05:51:32 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation Message-ID: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> New submission from Chaim Gewirtz : Why should @overload need to be followed by an implementation when an implementation already exists in the parent class? Illustrative example: class Parent: def foo(**kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload foo(a, b): ... Raises: "NotImplementedError: You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed." ---------- messages: 384255 nosy: chaim422 priority: normal severity: normal status: open title: @overload-ing method of parent class without actual implementation type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:22:14 2021 From: report at bugs.python.org (karl) Date: Sun, 03 Jan 2021 08:22:14 +0000 Subject: [issue41748] HTMLParser: parsing error In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1609662134.54.0.633908039041.issue41748@roundup.psfhosted.org> karl added the comment: Ezio, TL,DR: Testing in browsers and adding two tests for this issue. Should I create a PR just for the tests? https://github.com/python/cpython/blame/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Lib/test/test_htmlparser.py#L479-L485 A: comma without spaces ----------------------- Tests for browsers: data:text/html,
text
Serializations: * Firefox, Gecko (86.0a1 (2020-12-28) (64-bit)) * Edge, Blink (Version 89.0.752.0 (Version officielle) Canary (64 bits)) * Safari, WebKit (Release 117 (Safari 14.1, WebKit 16611.1.7.2)) Same serialization in these 3 rendering engines
text
Adding: def test_comma_between_unquoted_attributes(self): # bpo 41748 self._run_check('
', [('starttag', 'div', [('class', 'bar,baz=asd')])]) ? ./python.exe -m test -v test_htmlparser ? test_comma_between_unquoted_attributes (test.test_htmlparser.HTMLParserTestCase) ... ok ? Ran 47 tests in 0.168s OK == Tests result: SUCCESS == 1 test OK. Total duration: 369 ms Tests result: SUCCESS So this is working as expected for the first test. B: comma with spaces -------------------- Tests for browsers: data:text/html,
text
Serializations: * Firefox, Gecko (86.0a1 (2020-12-28) (64-bit)) * Edge, Blink (Version 89.0.752.0 (Version officielle) Canary (64 bits)) * Safari, WebKit (Release 117 (Safari 14.1, WebKit 16611.1.7.2)) Same serialization in these 3 rendering engines
text
Adding def test_comma_with_space_between_unquoted_attributes(self): # bpo 41748 self._run_check('
', [('starttag', 'div', [ ('class', 'bar'), (',baz', 'asd')])]) ? ./python.exe -m test -v test_htmlparser This is failing. ====================================================================== FAIL: test_comma_with_space_between_unquoted_attributes (test.test_htmlparser.HTMLParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karl/code/cpython/Lib/test/test_htmlparser.py", line 493, in test_comma_with_space_between_unquoted_attributes self._run_check('
', File "/Users/karl/code/cpython/Lib/test/test_htmlparser.py", line 95, in _run_check self.fail("received events did not match expected events" + AssertionError: received events did not match expected events Source: '
' Expected: [('starttag', 'div', [('class', 'bar'), (',baz', 'asd')])] Received: [('data', '
')] ---------------------------------------------------------------------- I started to look into the code of parser.py which I'm not familiar (yet) with. https://github.com/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Lib/html/parser.py#L42-L52 Do you have a suggestion to fix it? ---------- nosy: +karlcow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:26:58 2021 From: report at bugs.python.org (karl) Date: Sun, 03 Jan 2021 08:26:58 +0000 Subject: [issue41748] HTMLParser: comma in attribute values with/without space In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1609662418.62.0.772363781542.issue41748@roundup.psfhosted.org> Change by karl : ---------- title: HTMLParser: parsing error -> HTMLParser: comma in attribute values with/without space _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:33:08 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Sun, 03 Jan 2021 08:33:08 +0000 Subject: [issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single" Message-ID: <1609662788.81.0.389452774776.issue42813@roundup.psfhosted.org> New submission from Xinmeng Xia : Running the following program will lead to an unexpected EOF error. If we delete the space before triple-quotation mark("""), the error will gone. If we replace the content of snippet with "a = 1", the program will work well. However, if we replace the content of snippet with "if a:pass" in a single line, the program cause an error again. This is weird. Spaces in the end of a statement should not affect the compilation of program in "single" mode. Besides, the error messages are different in Python2 and Python3. Indentation error are reported in Python 2 for snippet" if a:pass" while SyntaxError are reported in Python 3. ====================================================== import math def check_stack_size( code): # To assert that the alleged stack size is not O(N), we # check that it is smaller than log(N). if isinstance(code, str): code = compile(code, "", "single") max_size = math.ceil(math.log(len(code.co_code))) # self.assertLessEqual(code.co_stacksize, max_size) def test_if_else(): snippet =""" if x: a elif y: b else: c """ check_stack_size(snippet) test_if_else() ===================================================== Behavior in Python 3.10: Traceback (most recent call last): File "/home/xxm/Desktop/nameChanging/report/temp.py", line 30, in test_if_else() File "/home/xxm/Desktop/nameChanging/report/temp.py", line 20, in test_if_else check_stack_size(snippet) File "/home/xxm/Desktop/nameChanging/report/temp.py", line 6, in check_stack_size code = compile(code, "", "single") File "", line 8 SyntaxError: unexpected EOF while parsing Behaviors in Python2: Traceback (most recent call last): File "/home/xxm/Desktop/nameChanging/report/temp.py", line 30, in test_if_else() File "/home/xxm/Desktop/nameChanging/report/temp.py", line 27, in test_if_else check_stack_size(snippet) File "/home/xxm/Desktop/nameChanging/report/temp.py", line 6, in check_stack_size code = compile(code, "", "single") File "", line 3 ^ IndentationError: unexpected indent ---------- components: Interpreter Core messages: 384257 nosy: xxm priority: normal severity: normal status: open title: Extra spaces cause unexpected EOF error in "compile" function with mode "single" type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:49:01 2021 From: report at bugs.python.org (karl) Date: Sun, 03 Jan 2021 08:49:01 +0000 Subject: [issue41748] HTMLParser: comma in attribute values with/without space In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1609663741.05.0.47042034978.issue41748@roundup.psfhosted.org> karl added the comment: Ah! This is fixing it diff --git a/Lib/html/parser.py b/Lib/html/parser.py index 6083077981..ffff790666 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -44,7 +44,7 @@ (?:\s*=+\s* # value indicator (?:'[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value - |(?!['"])[^>\s]* # bare value + |(?!['"])[^>]* # bare value ) (?:\s*,)* # possibly followed by a comma )?(?:\s|/(?!>))* Ran 48 tests in 0.175s OK == Tests result: SUCCESS == ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:49:49 2021 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Jan 2021 08:49:49 +0000 Subject: [issue41748] HTMLParser: comma in attribute values with/without space In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1609663789.45.0.809660769829.issue41748@roundup.psfhosted.org> Ezio Melotti added the comment: Writing tests that verify the expected behavior is a great first step. The expected output in the tests should match the behavior described by the HTML 5 specs (which should also correspond to the browsers' behavior), and should initially fail. You can start creating a PR with only the tests, clarifying that it's a work in progress, or wait until you have the fix too. The next step would be tweaking the regex and the code until both the new tests and all the other ones work (excluding the one with the commas you are fixing). You can then commit the fix in the same branch and push it -- GitHub will automatically update the PR. > Do you have a suggestion to fix it? If you are familiar enough with regexes, you could try to figure out whether it matches the invalid attributes or not, and if not why (I took a quick look and I didn't see anything immediately wrong in the regexes). Since the output of the failing test is [('data', '
')], it's likely that the parser doesn't know how to handle it and passes it to one of the handle_data() in the goahead() method. You can figure out which one is being called and see which are the if-conditions that are leading the interpreter down this path rather than the usual path where the attributes are parsed correctly. If you have other questions let me know :) ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 03:52:13 2021 From: report at bugs.python.org (karl) Date: Sun, 03 Jan 2021 08:52:13 +0000 Subject: [issue41748] HTMLParser: comma in attribute values with/without space In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1609663933.36.0.107337903735.issue41748@roundup.psfhosted.org> Change by karl : ---------- keywords: +patch pull_requests: +22904 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/24072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 05:32:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 10:32:05 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609669925.03.0.264094923085.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: I guess I should merge a PR for issue42681 first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:40:24 2021 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 03 Jan 2021 11:40:24 +0000 Subject: [issue42814] Undefined behavior in Objects/genericaliasobject.c Message-ID: <1609674024.61.0.74243567004.issue42814@roundup.psfhosted.org> New submission from Zackery Spytz : In is_typing_name(), va_end() is not always called before the function returns. It is undefined behavior to call va_start() without also calling va_end(). ---------- components: Interpreter Core messages: 384261 nosy: ZackerySpytz priority: normal severity: normal status: open title: Undefined behavior in Objects/genericaliasobject.c versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:42:49 2021 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 03 Jan 2021 11:42:49 +0000 Subject: [issue42814] Undefined behavior in Objects/genericaliasobject.c In-Reply-To: <1609674024.61.0.74243567004.issue42814@roundup.psfhosted.org> Message-ID: <1609674169.44.0.326141097716.issue42814@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +22906 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:43:34 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 11:43:34 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread Message-ID: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: New thread doesn't copy context of the parent thread. The minimal example to reproduce the issue: ``` from threading import Thread from contextvars import ContextVar foo: ContextVar[str] = ContextVar("foo") def temp(): print(foo.get()) foo.set("bar") t = Thread(target=temp) t.start() t.join() ``` Is it expected behavior? PEP 567 I didn't find anything regarding this case. ---------- components: Library (Lib) messages: 384262 nosy: uriyyo priority: normal severity: normal status: open title: new thread doesn't copy context of the parent thread type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:46:40 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 11:46:40 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread In-Reply-To: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> Message-ID: <1609674400.18.0.748238578637.issue42815@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +22907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:48:13 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 11:48:13 +0000 Subject: [issue42455] Add decorator_factory function to functools module In-Reply-To: <1606250077.84.0.747907374749.issue42455@roundup.psfhosted.org> Message-ID: <1609674493.76.0.276113833025.issue42455@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: What we should do with this issue? There was no much discussion at python-ideas. I have received only one -1 opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:52:22 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 03 Jan 2021 11:52:22 +0000 Subject: [issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched In-Reply-To: <1575141041.2.0.751349559914.issue38946@roundup.psfhosted.org> Message-ID: <1609674742.81.0.686748880164.issue38946@roundup.psfhosted.org> Ronald Oussoren added the comment: As another datapoint: This works for me on macOS 11.1 with the universal2 installer for Python 3.9.1 (which includes Tk 8.6.10). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 06:53:09 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 11:53:09 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609674789.93.0.0707728209379.issue42812@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: The purpose of `@overload` is quite different. I believe you thought that this is smth like `@override` in Java world but it different. Basically, the correct usage of `@overaload` is: ``` @overload def process(response: None) -> None: ... @overload def process(response: int) -> tuple[int, str]: ... @overload def process(response: bytes) -> str: ... def process(response): ``` Please, follow this link for more information https://docs.python.org/3/library/typing.html#typing.overload ---------- nosy: +uriyyo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 07:16:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 12:16:30 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread In-Reply-To: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> Message-ID: <1609676190.39.0.892703007861.issue42815@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 07:18:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 12:18:30 +0000 Subject: [issue42814] Undefined behavior in Objects/genericaliasobject.c In-Reply-To: <1609674024.61.0.74243567004.issue42814@roundup.psfhosted.org> Message-ID: <1609676310.79.0.137539417149.issue42814@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5d3553b0a8959e7505bbec4de03077dbf135ee4b by Zackery Spytz in branch 'master': bpo-42814: Fix undefined behavior in Objects/genericaliasobject.c (GH-24073) https://github.com/python/cpython/commit/5d3553b0a8959e7505bbec4de03077dbf135ee4b ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 07:22:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 12:22:16 +0000 Subject: [issue42814] Undefined behavior in Objects/genericaliasobject.c In-Reply-To: <1609674024.61.0.74243567004.issue42814@roundup.psfhosted.org> Message-ID: <1609676536.03.0.341041457642.issue42814@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 07:35:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 12:35:30 +0000 Subject: [issue38308] Add optional weighting to statistics.harmonic_mean() In-Reply-To: <1569695295.83.0.838130885601.issue38308@roundup.psfhosted.org> Message-ID: <1609677330.0.0.579231286061.issue38308@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 66136768615472a8d1a18b5018095b9737dbab8c by Zackery Spytz in branch 'master': bpo-38308: Fix the "versionchanged" for the *weights* of harmonic_mean() (GH-23919) https://github.com/python/cpython/commit/66136768615472a8d1a18b5018095b9737dbab8c ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:09:40 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 03 Jan 2021 13:09:40 +0000 Subject: [issue42455] Add decorator_factory function to functools module In-Reply-To: <1606250077.84.0.747907374749.issue42455@roundup.psfhosted.org> Message-ID: <1609679380.66.0.471292767864.issue42455@roundup.psfhosted.org> Batuhan Taskaya added the comment: I also agree with Raymond's opinion, and from the point that it didn't get much attention I'd assume not many people need it. So count me as -1 ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:09:42 2021 From: report at bugs.python.org (Martin Winks) Date: Sun, 03 Jan 2021 13:09:42 +0000 Subject: [issue42816] Add str.split_iter function Message-ID: <1609679382.47.0.0845431201313.issue42816@roundup.psfhosted.org> New submission from Martin Winks : Split string by given separator and return iterator as a result. The naive and not very efficient solution would be using current str.split: def split_iter(self: str, sep: str) -> 'Iterator[str]': return iter(self.split(sep)) Probably, need we'll some better solution without allocating new list. ---------- components: Unicode messages: 384270 nosy: ezio.melotti, uwinx, vstinner priority: normal severity: normal status: open title: Add str.split_iter function type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:11:33 2021 From: report at bugs.python.org (Petr Viktorin) Date: Sun, 03 Jan 2021 13:11:33 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609679493.33.0.831271629173.issue40077@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset b8eb3765908c0063f0739595ba4b296cc8863d19 by Erlend Egeberg Aasland in branch 'master': bpo-40077: Add traverse/clear/free to arraymodule (GH-24066) https://github.com/python/cpython/commit/b8eb3765908c0063f0739595ba4b296cc8863d19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:18:17 2021 From: report at bugs.python.org (Petr Viktorin) Date: Sun, 03 Jan 2021 13:18:17 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609679897.36.0.134805142171.issue40077@roundup.psfhosted.org> Petr Viktorin added the comment: Yes, please keep _testcapimodule.c as it is. Static types are still supported and need to be tested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:19:56 2021 From: report at bugs.python.org (Kevin Rasmussen) Date: Sun, 03 Jan 2021 13:19:56 +0000 Subject: [issue42817] timedelta zeropadding hh Message-ID: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 3 08:23:48 2021 From: report at bugs.python.org (Kevin Rasmussen) Date: Sun, 03 Jan 2021 13:23:48 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609680228.39.0.3136623058.issue42817@roundup.psfhosted.org> Change by Kevin Rasmussen : ---------- keywords: +patch pull_requests: +22908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:40:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 03 Jan 2021 13:40:58 +0000 Subject: [issue42816] Add str.split_iter function In-Reply-To: <1609679382.47.0.0845431201313.issue42816@roundup.psfhosted.org> Message-ID: <1609681258.66.0.62269398911.issue42816@roundup.psfhosted.org> Steven D'Aprano added the comment: I am pretty sure this has been discussed and rejected on the Python-Ideas mailing list before. If not rejected, the idea didn't go very far. You may wish to search the mailing list archives for previous discussions. Either way, I think this should be discussed on Python-Ideas, to see if there is a consensus on this, and whether or not this is a large enough change that it needs a PEP. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:43:14 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 03 Jan 2021 13:43:14 +0000 Subject: [issue42816] Add str.split_iter function In-Reply-To: <1609679382.47.0.0845431201313.issue42816@roundup.psfhosted.org> Message-ID: <1609681394.55.0.422489340401.issue42816@roundup.psfhosted.org> Steven D'Aprano added the comment: See also discussion here: #17343 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:58:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 13:58:27 +0000 Subject: [issue42816] Add str.split_iter function In-Reply-To: <1609679382.47.0.0845431201313.issue42816@roundup.psfhosted.org> Message-ID: <1609682307.81.0.0799805733074.issue42816@roundup.psfhosted.org> Serhiy Storchaka added the comment: Issue17343 mentions also a separate method str.itersplit, so I close this issue as a duplicate. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add a version of str.split which returns an iterator _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 08:58:55 2021 From: report at bugs.python.org (Kevin Rasmussen) Date: Sun, 03 Jan 2021 13:58:55 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609682335.25.0.08544907835.issue42817@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 3 09:00:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 14:00:57 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609682457.73.0.575896754351.issue42817@roundup.psfhosted.org> Serhiy Storchaka added the comment: Why should it be zeropadded to 2? It is likely this option was considered when that code was added, and rejected. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 09:09:35 2021 From: report at bugs.python.org (Klaus Ethgen) Date: Sun, 03 Jan 2021 14:09:35 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' Message-ID: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> New submission from Klaus Ethgen : I encountered the bug when installing a package with `python3 setup.py install --user`. After that, a second installation failed with this stack trace: ``` Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2191, in _handle_ns loader = importer.find_spec(packageName).loader AttributeError: 'zipimporter' object has no attribute 'find_spec' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/klaus/devel/upstream/pass-git-helper/setup.py", line 1, in from setuptools import setup File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 16, in import setuptools.version File "/usr/lib/python3/dist-packages/setuptools/version.py", line 1, in import pkg_resources File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3239, in def _initialize_master_working_set(): File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3222, in _call_aside f(*args, **kwargs) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set tuple( File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3265, in dist.activate(replace=False) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2780, in activate declare_namespace(pkg) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2279, in declare_namespace _handle_ns(packageName, path_item) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2196, in _handle_ns loader = importer.find_spec(packageName) AttributeError: 'zipimporter' object has no attribute 'find_spec' ``` This error happens now also with different tools. Solution is to `rm -fr ~/.local/lib`. But the next installation triggers the bug again. The only solution is to install via `python3 setup.py install --user --old-and-unmanageable`. When I look into the code of zipimport(er), I do not see any find_spec only the old find_loader. Despite it is a core library, this must be fixed! And with that the name should match the name of the py file to make it able to find the relevant file. ---------- components: Library (Lib) messages: 384279 nosy: mowgli priority: normal severity: normal status: open title: AttributeError: 'zipimporter' object has no attribute 'find_spec' type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 09:15:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 14:15:06 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609683306.45.0.485116456546.issue42789@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22910 pull_request: https://github.com/python/cpython/pull/24076 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 09:23:20 2021 From: report at bugs.python.org (Martin Winks) Date: Sun, 03 Jan 2021 14:23:20 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1609683800.95.0.352498603587.issue17343@roundup.psfhosted.org> Martin Winks added the comment: > Perhaps the use case is already served by re.finditer() def split_whitespace_ascii(s: str): return (pt.group(0) for pt in re.finditer(r"[A-Za-z']+", s)) solution above does not cover all possible data and is incorrect for bytes-like objects. writing regular expressions for different separators/data would be a quite overheadish, so the idea of one-case solution doesn't seem to go very far and requires a bigger change in code for different separators. let's try to revive this one :) ---------- nosy: +uwinx _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 10:48:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 15:48:06 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609688886.71.0.342304658844.issue41798@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7c83eaa536d2f436ae46211ca48692f576c732f0 by Hai Shi in branch 'master': bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061) https://github.com/python/cpython/commit/7c83eaa536d2f436ae46211ca48692f576c732f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 11:22:35 2021 From: report at bugs.python.org (Kevin Rasmussen) Date: Sun, 03 Jan 2021 16:22:35 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609690955.6.0.704010811981.issue42817@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 3 11:33:16 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 16:33:16 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609691596.39.0.86490176656.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: "The purpose of `@overload` is quite different." So, this would overload the @overload decorator. Hmmm... Is there a better way to accomplish this goal? What would you suggest, a new decorator? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 11:40:47 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 16:40:47 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609692047.56.0.674000366147.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: To clarify, this is how it's being done now a dozen times in actual production code: class Child(Parent): @overload foo(a, b): ... def overload(**kwargs): return super().foo(**kwargs) The goal of this proposed enhancement is to remove two extra lines of code per Child class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:18:04 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 17:18:04 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609694284.85.0.734642051513.issue42812@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: `mypy` will produce an error on such code: ``` class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload def foo(self, a, b): pass def foo(self, **kwargs): return super().foo(**kwargs) ``` Result ``` temp.py:10: error: Single overload definition, multiple required temp.py:10: error: Signature of "foo" incompatible with supertype "Parent" Found 2 errors in 1 file (checked 1 source file) ``` In case if you want to add an overload for method I would recommend to use such pattern: ``` class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload def foo(self, a, b): pass @overload def foo(self, **kwargs): pass def foo(self, **kwargs): return super().foo(**kwargs) ``` So signature of `foo` will still match to parent class signature, but it will also have an overloaded variant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:25:06 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 17:25:06 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609694706.2.0.24560227029.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: Interesting. PyCharm has no problem with this code. It also autocompletes the argument names for me, which is very useful, especially since there a dozen different Child classes. Isn't "Simple is better than complex", and doesn't "...practicality beat purity"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:31:20 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 17:31:20 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609695080.71.0.60842479793.issue42812@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: I think the simplest solution in your case is not to use `@overload`, as far as I understand you want to override the signature of base method. This code won't produce any error when used with `mypy`: ``` class Parent: def foo(**kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): def foo(self, a, b): pass `` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:43:20 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 17:43:20 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609695800.5.0.915222075343.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: What is better? A. Keeping Python as is, with four separate signature declarations (1x Parent, 2x @overload Child, and 1x actual signature in Child), and a second method call overhead at runtime (to satisfy mypy as it exists now). --or-- B. Simplify Python to allow just two signature declarations and no extra overhead? --or-- C. Something else? Please specify. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:47:35 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 17:47:35 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609696055.95.0.267838284993.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: In your example, does Child foo call Parent foo? Because the intent is to use the parent's foo method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 12:55:40 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sun, 03 Jan 2021 17:55:40 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609696540.65.0.855863567187.issue42812@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: > What is better? Sorry, I can't answer this question. I am a regular python user and I just tried to help with your issue. I believe we should wait for someone from core team to answer this question. > In your example, does Child foo call Parent foo? Because the intent is to use the parent's foo method. Sorry, I made a mistake, it definitely should call a parent method. A correct example will look like this: ``` class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): def foo(self, a, b): super().foo(a=a, b=b) ``` But, the example above require more code to write, so a better option will be: ``` class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload def foo(self, a, b): pass @overload def foo(self, **kwargs): pass def foo(self, **kwargs): return super().foo(**kwargs) ``` I am not sure is it the perfect solution to solve your issue. Let's wait for someone from core team, so we can hear their opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 13:11:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 03 Jan 2021 18:11:18 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609697478.9.0.428587049046.issue42817@roundup.psfhosted.org> Eric V. Smith added the comment: I don't think zero padding makes sense. For example: >>> td = datetime.timedelta(hours=100) >>> str(td) '4 days, 4:00:00' I think '4 days, 04:00:00' would not be very user friendly. In any event, backward compatibility would prevent us from changing this. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 13:26:27 2021 From: report at bugs.python.org (Chaim Gewirtz) Date: Sun, 03 Jan 2021 18:26:27 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1609698387.19.0.750228321522.issue42812@roundup.psfhosted.org> Chaim Gewirtz added the comment: Thanks for your perspective. To summarize here is how my proposed enhancement might look in practice: class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload def foo(self, a, b): pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 14:00:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 03 Jan 2021 19:00:39 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1609700439.66.0.296712949519.issue40077@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ok, perhaps we should leave a comment about that? It already has a comment about multi-phase init. What about Modules/_testbuffer.c and the xx-modules? $ grep -E 'static PyTypeObject .* =' $(find . -name "*.c"|grep -vE '(Doc/|Modules/_testcapimodule)') | wc -l 94 $ grep -E 'PyType_Spec .* =' $(find . -name "*.c")|wc -l (master)cpython.git 95 We're almost halfway there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 14:28:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 03 Jan 2021 19:28:21 +0000 Subject: [issue41463] Avoid duplicating jump information from opcode.py in compile.c In-Reply-To: <1596452415.91.0.969194719265.issue41463@roundup.psfhosted.org> Message-ID: <1609702101.48.0.430062029394.issue41463@roundup.psfhosted.org> Irit Katriel added the comment: This seems complete, unless you still want to backport? ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 14:57:41 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 03 Jan 2021 19:57:41 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609703861.46.0.134020840201.issue42817@roundup.psfhosted.org> Andrei Kulakov added the comment: In a date, hours are zero-padded probably because that's a common standard for military time dates. But there is no such standard for time periods, therefore timedelta don't have to match date display in respect to zero-padding, in my opinion. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 15:51:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 20:51:18 +0000 Subject: [issue42681] mistake in curses documentation In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609707078.81.0.334132371568.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1470edd6131c29b8a09ce012cdfee3afa269d553 by Serhiy Storchaka in branch 'master': bpo-42681: Fix range checks for color and pair numbers in curses (GH-23874) https://github.com/python/cpython/commit/1470edd6131c29b8a09ce012cdfee3afa269d553 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 15:52:35 2021 From: report at bugs.python.org (Dustin Rodrigues) Date: Sun, 03 Jan 2021 20:52:35 +0000 Subject: [issue42819] readline 8.1 bracketed paste Message-ID: <1609707155.89.0.22999518491.issue42819@roundup.psfhosted.org> New submission from Dustin Rodrigues : Readline 8.1 enables bracketed paste by default. Package managers like Homebrew for macOS and distributions like Arch Linux which use the latest version of readline (released December 2020) now have new behavior when pasting multiline strings into the python REPL. Disabling bracketed paste on 8.1 reverts to the expected behavior, and enabling bracketed paste on 8.0 also reproduces the behavior. Further information in https://github.com/Homebrew/homebrew-core/issues/68193 Example with bracketed paste on: $ cat in 1+2 3+4 5+6 $ pbcopy < in $ /usr/local/Cellar/python\@3.9/3.9.1_3/bin/python3 Python 3.9.1 (default, Dec 28 2020, 11:22:14) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> 1+2 3+4 5+6 File "", line 1 1+2 3+4 5+6 ^ SyntaxError: multiple statements found while compiling a single statement >>> Example with it off: $ /usr/local/bin/python3 Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> 1+2 3 >>> 3+4 7 >>> 5+6 11 >>> ---------- messages: 384297 nosy: dtrodrigues priority: normal severity: normal status: open title: readline 8.1 bracketed paste type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 15:54:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 20:54:49 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609707289.58.0.784454648738.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 0303008ebceb6ac6035cd9722d1393267304171d by Serhiy Storchaka in branch '3.9': [3.9] bpo-42789: Don't skip curses tests on non-tty. (GH-24009) (GH-24076) https://github.com/python/cpython/commit/0303008ebceb6ac6035cd9722d1393267304171d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 16:33:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 21:33:50 +0000 Subject: [issue42681] mistake in curses documentation In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609709630.69.0.450650243927.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22911 pull_request: https://github.com/python/cpython/pull/24077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 16:43:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 21:43:00 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609710180.57.0.980938413243.issue42789@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22912 pull_request: https://github.com/python/cpython/pull/24078 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 16:46:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 21:46:49 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609710409.29.0.836880242335.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: mistake in curses documentation -> Incorrect range checks/documentation in curses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 17:48:02 2021 From: report at bugs.python.org (Kevin Rasmussen) Date: Sun, 03 Jan 2021 22:48:02 +0000 Subject: [issue42817] timedelta zeropadding hh In-Reply-To: <1609679996.96.0.581038745817.issue42817@roundup.psfhosted.org> Message-ID: <1609714082.91.0.445217739966.issue42817@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 3 17:54:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 22:54:27 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609714467.07.0.171007782357.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 645174abe0d13cce2cb339cc80b095ad484428ea by Serhiy Storchaka in branch '3.8': [3.8] [3.9] bpo-42789: Don't skip curses tests on non-tty. (GH-24009) (GH-24076) (GH-24078) https://github.com/python/cpython/commit/645174abe0d13cce2cb339cc80b095ad484428ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 17:55:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 22:55:26 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609714526.29.0.302854685949.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b0ee2b492dbf550fbd2a63b82de0a4dc9d67f32e by Serhiy Storchaka in branch '3.9': [3.9] bpo-42681: Fix range checks for color and pair numbers in curses (GH-23874). (GH-24077) https://github.com/python/cpython/commit/b0ee2b492dbf550fbd2a63b82de0a4dc9d67f32e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 17:58:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jan 2021 22:58:10 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609714690.96.0.115304474966.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22913 pull_request: https://github.com/python/cpython/pull/24079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 18:51:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 03 Jan 2021 23:51:07 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609717867.29.0.496843941879.issue42681@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This change seems to broke some buildbots. For instance: https://buildbot.python.org/all/#/builders/119/builds/153 ====================================================================== ERROR: test_colors_funcs (test.test_curses.TestCurses) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.8.edelsohn-rhel8-z/build/Lib/test/test_curses.py", line 310, in test_colors_funcs curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff)) _curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1) ---------------------------------------------------------------------- Ran 28 tests in 0.337s FAILED (errors=1) 1 test failed again: test_curses == Tests result: FAILURE then FAILURE == ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 18:55:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 23:55:10 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609718110.8.0.559916626346.issue42789@roundup.psfhosted.org> STINNER Victor added the comment: > Buildbot failure: ARM Raspbian 3.x: (...) As expected, the 3.8 and 3.9 change also broke 11 buildbots (3.8 and 3.8) ;-) I understand that bpo-42681 will fix buildbots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 18:57:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Jan 2021 23:57:30 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609718250.68.0.91151940104.issue42681@roundup.psfhosted.org> STINNER Victor added the comment: > This change seems to broke some buildbots. Yep, see also bpo-42789. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 20:28:14 2021 From: report at bugs.python.org (Tim Hoffmann) Date: Mon, 04 Jan 2021 01:28:14 +0000 Subject: [issue42820] Sphinx conf.py needs_version entry is outdated Message-ID: <1609723694.82.0.961390909546.issue42820@roundup.psfhosted.org> New submission from Tim Hoffmann : The sphinx conf.py entry `needs_version=1.8` (https://github.com/python/cpython/blob/1470edd6131c29b8a09ce012cdfee3afa269d553/Doc/conf.py#L48) is not in sync with the doc build requirements (https://github.com/python/cpython/blob/1470edd6131c29b8a09ce012cdfee3afa269d553/Doc/requirements.txt#L6) Possible solutions: a) Drop the `needs_version` config value. It's optional. b) Make sure to update both places. c) Or at minimum add a comment that `needs_version` is only a safeguard against very old sphinx versions but is not necessarily sufficient to build. ---------- assignee: docs at python components: Documentation messages: 384305 nosy: docs at python, timhoffm priority: normal severity: normal status: open title: Sphinx conf.py needs_version entry is outdated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 21:06:27 2021 From: report at bugs.python.org (karl) Date: Mon, 04 Jan 2021 02:06:27 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1609725987.69.0.709856572783.issue28937@roundup.psfhosted.org> Change by karl : ---------- nosy: +karlcow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 21:21:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 02:21:42 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1609725987.73.0.335617121775.issue28937@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: This issue probably needs a new champion. There is broad agreement but some bike shedding, so a PEP isn?t needed.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 22:37:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Jan 2021 03:37:27 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1609731447.04.0.244521924677.issue28937@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: -rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 3 23:48:30 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 04:48:30 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609735710.83.0.791376738106.issue42584@roundup.psfhosted.org> Ned Deily added the comment: New changeset c94ee13ad596d26d1859078bc09806aa59bb0000 by Erlend Egeberg Aasland in branch 'master': bpo-42584: Update macOS installer to use SQLite 3.34.0 (GH-23674) https://github.com/python/cpython/commit/c94ee13ad596d26d1859078bc09806aa59bb0000 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 03:00:54 2021 From: report at bugs.python.org (karl) Date: Mon, 04 Jan 2021 08:00:54 +0000 Subject: [issue42821] HTMLParser: subsequent duplicate attributes should be ignored Message-ID: <1609747254.8.0.505282394857.issue42821@roundup.psfhosted.org> New submission from karl : This comes up while working on issue 41748 browser input data:text/html,
text
browser output
text
Actual HTMLParser output see https://github.com/python/cpython/pull/24072#discussion_r551158342 ('starttag', 'div', [('class', 'bar'), ('class', 'foo')])] Expected HTMLParser output ('starttag', 'div', [('class', 'bar')])] ---------- components: Library (Lib) messages: 384308 nosy: karlcow priority: normal severity: normal status: open title: HTMLParser: subsequent duplicate attributes should be ignored versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 03:58:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 08:58:29 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609750709.35.0.158064018831.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 82794cacc6073af9bc2b792a5ee21397f4c9037f by Serhiy Storchaka in branch '3.8': [3.8] [3.9] bpo-42681: Fix range checks for color and pair numbers in curses (GH-23874). (GH-24077) (GH-24079) https://github.com/python/cpython/commit/82794cacc6073af9bc2b792a5ee21397f4c9037f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:18:10 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 09:18:10 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1h In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609751890.46.0.654278181779.issue41837@roundup.psfhosted.org> Change by Ned Deily : ---------- keywords: +patch pull_requests: +22914 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:20:28 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 09:20:28 +0000 Subject: [issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS In-Reply-To: <1605443356.85.0.637246166587.issue42361@roundup.psfhosted.org> Message-ID: <1609752028.51.0.376963804614.issue42361@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +22915 pull_request: https://github.com/python/cpython/pull/24081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:38:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 09:38:14 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609753094.16.0.975831791952.issue40636@roundup.psfhosted.org> Serhiy Storchaka added the comment: For other types we do not have such strict tests. We just test that pickling roundtrips (it is already tested for zip() in other tests). There are few tests that unpickling some exact byte strings produces the expected value, but these tests are in pickletester.py, because they test the unpickling machinery. If unpickling of some type depends on some private constructor (like re._compile), that constructor can be tested separately. So I think that these tests can be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:39:50 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 09:39:50 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1h In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609753190.25.0.708363081763.issue41837@roundup.psfhosted.org> Ned Deily added the comment: New changeset 14097a2785414c728d41d8d730a469a8c46ecdb9 by Ned Deily in branch 'master': bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i. (GH-24080) https://github.com/python/cpython/commit/14097a2785414c728d41d8d730a469a8c46ecdb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:40:06 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 09:40:06 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1h In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609753206.38.0.0132534567308.issue41837@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +22916 pull_request: https://github.com/python/cpython/pull/24083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:40:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 09:40:18 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1h In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609753218.0.0.902389079549.issue41837@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22917 pull_request: https://github.com/python/cpython/pull/24084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:41:11 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 09:41:11 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609753271.33.0.765035503357.issue41837@roundup.psfhosted.org> Change by Ned Deily : ---------- title: Upgrade installers to OpenSSL 1.1.1h -> Upgrade installers to OpenSSL 1.1.1i _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:41:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 09:41:21 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609753281.93.0.630024160824.issue42789@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22918 pull_request: https://github.com/python/cpython/pull/24085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:43:19 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 09:43:19 +0000 Subject: [issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS In-Reply-To: <1605443356.85.0.637246166587.issue42361@roundup.psfhosted.org> Message-ID: <1609753399.93.0.408547546381.issue42361@roundup.psfhosted.org> Ned Deily added the comment: New changeset a38e04b566879a5040ea97428d7ee4331d76513f by Ned Deily in branch 'master': bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (GH-24081) https://github.com/python/cpython/commit/a38e04b566879a5040ea97428d7ee4331d76513f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:43:25 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 09:43:25 +0000 Subject: [issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS In-Reply-To: <1605443356.85.0.637246166587.issue42361@roundup.psfhosted.org> Message-ID: <1609753405.13.0.610083071281.issue42361@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22919 pull_request: https://github.com/python/cpython/pull/24086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:47:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 09:47:09 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609753629.77.0.156556628706.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: On other hand, it was impossible to write correct tests for issue42681 while tests were skipped on buildbots. I spent the whole day yesterday debugging and backporting that changes (some tests failed only on one particular builtbot). So it was right to enable tests first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:54:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 09:54:12 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609754052.84.0.766670012356.issue42584@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : Removed file: https://bugs.python.org/file49694/0001-Add-simple-validation-CI.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 04:54:24 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 09:54:24 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609754064.7.0.856938243898.issue42584@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : Added file: https://bugs.python.org/file49718/0001-Add-simple-validation-CI.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:17:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 10:17:38 +0000 Subject: [issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS In-Reply-To: <1605443356.85.0.637246166587.issue42361@roundup.psfhosted.org> Message-ID: <1609755458.47.0.239667677821.issue42361@roundup.psfhosted.org> miss-islington added the comment: New changeset cb882f97bc142380460ea519829dc4baf0eb01f2 by Miss Islington (bot) in branch '3.9': bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (GH-24081) https://github.com/python/cpython/commit/cb882f97bc142380460ea519829dc4baf0eb01f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:27:26 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 10:27:26 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609756046.81.0.784319482421.issue41837@roundup.psfhosted.org> Ned Deily added the comment: New changeset f24ac455521e46bf9f6c7971aec0e4abec4451c4 by Miss Islington (bot) in branch '3.8': bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i. (GH-24080) (#24084) https://github.com/python/cpython/commit/f24ac455521e46bf9f6c7971aec0e4abec4451c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:28:36 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 10:28:36 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609756116.48.0.936809121964.issue41837@roundup.psfhosted.org> Ned Deily added the comment: New changeset 76489dd2998ac70ffb300d612792a7238c03438c by Miss Islington (bot) in branch '3.9': bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i. (GH-24080) (GH-24083) https://github.com/python/cpython/commit/76489dd2998ac70ffb300d612792a7238c03438c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:30:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 10:30:24 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609756224.13.0.776429481775.issue42789@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b6fc0c406e6b4b86f59b1390142f35da0e364927 by Serhiy Storchaka in branch 'master': bpo-42789: Enable using /dev/tty in test_curses. (GH-24085) https://github.com/python/cpython/commit/b6fc0c406e6b4b86f59b1390142f35da0e364927 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:30:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 10:30:55 +0000 Subject: [issue42789] Do not skip test_curses on non-tty In-Reply-To: <1609355195.18.0.84938555409.issue42789@roundup.psfhosted.org> Message-ID: <1609756255.33.0.636134787036.issue42789@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:34:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 10:34:54 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609756494.87.0.624100686217.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22920 pull_request: https://github.com/python/cpython/pull/24089 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:37:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 10:37:05 +0000 Subject: [issue42692] Build fails on macOS when compiler doesn't define __has_builtin In-Reply-To: <1608488860.71.0.844167332987.issue42692@roundup.psfhosted.org> Message-ID: <1609756625.41.0.373349092118.issue42692@roundup.psfhosted.org> miss-islington added the comment: New changeset df21f502fdccec234282bf0a211af979fd23def4 by Joshua Root in branch 'master': bpo-42692: fix __builtin_available check on older compilers (GH-23873) https://github.com/python/cpython/commit/df21f502fdccec234282bf0a211af979fd23def4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 05:37:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 10:37:14 +0000 Subject: [issue42692] Build fails on macOS when compiler doesn't define __has_builtin In-Reply-To: <1608488860.71.0.844167332987.issue42692@roundup.psfhosted.org> Message-ID: <1609756634.72.0.522848932071.issue42692@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22921 pull_request: https://github.com/python/cpython/pull/24090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:00:49 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 11:00:49 +0000 Subject: [issue42692] Build fails on macOS when compiler doesn't define __has_builtin In-Reply-To: <1608488860.71.0.844167332987.issue42692@roundup.psfhosted.org> Message-ID: <1609758049.79.0.375556222774.issue42692@roundup.psfhosted.org> Ned Deily added the comment: New changeset eedeaef1f22d27264ce9b031da80fe2485e85e69 by Miss Islington (bot) in branch '3.9': bpo-42692: fix __builtin_available check on older compilers (GH-23873) (GH-24090) https://github.com/python/cpython/commit/eedeaef1f22d27264ce9b031da80fe2485e85e69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:01:55 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 11:01:55 +0000 Subject: [issue42692] Build fails on macOS when compiler doesn't define __has_builtin In-Reply-To: <1608488860.71.0.844167332987.issue42692@roundup.psfhosted.org> Message-ID: <1609758115.93.0.192007952792.issue42692@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:15:53 2021 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 04 Jan 2021 11:15:53 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1609758953.83.0.998298203003.issue28937@roundup.psfhosted.org> Zackery Spytz added the comment: I am working on this issue. ---------- assignee: -> ZackerySpytz nosy: +ZackerySpytz versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:52:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 11:52:05 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609761125.63.0.122904067211.issue42810@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +22922 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:55:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 11:55:51 +0000 Subject: [issue42587] memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11) In-Reply-To: <1607353221.74.0.500162368406.issue42587@roundup.psfhosted.org> Message-ID: <1609761351.59.0.49708629426.issue42587@roundup.psfhosted.org> STINNER Victor added the comment: The Fedora package gcc-11.0.0-0.11 includes https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3e60ddeb8220ed388819bb3f14e8caa9309fd3c2 fix for the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98190 bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 06:58:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 11:58:06 +0000 Subject: [issue42587] memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11) In-Reply-To: <1607353221.74.0.500162368406.issue42587@roundup.psfhosted.org> Message-ID: <1609761486.91.0.13723659574.issue42587@roundup.psfhosted.org> STINNER Victor added the comment: "PPC64LE Fedora Rawhide LTO 3.x" buildbot is back to green. test.pythoninfo now says: CC.version: gcc (GCC) 11.0.0 20201223 (Red Hat 11.0.0-0) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 08:01:07 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 13:01:07 +0000 Subject: [issue42246] Implement PEP 626 -- Precise line numbers for debugging In-Reply-To: <1604331162.26.0.596873070589.issue42246@roundup.psfhosted.org> Message-ID: <1609765267.67.0.910783571076.issue42246@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +22923 pull_request: https://github.com/python/cpython/pull/24094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 08:03:56 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 04 Jan 2021 13:03:56 +0000 Subject: [issue42822] Missing backslashes in documentation for 3.8 and 3.9 In-Reply-To: <1609765422.49.0.483236804978.issue42822@roundup.psfhosted.org> Message-ID: <1609765436.31.0.631622232538.issue42822@roundup.psfhosted.org> Change by Julien Palard : ---------- keywords: +patch pull_requests: +22924 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/24093 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 08:03:42 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 04 Jan 2021 13:03:42 +0000 Subject: [issue42822] Missing backslashes in documentation for 3.8 and 3.9 Message-ID: <1609765422.49.0.483236804978.issue42822@roundup.psfhosted.org> New submission from Julien Palard : This is just to track the issue, initially reported here: https://github.com/python/python-docs-theme/issues/63 Then discussed here: https://github.com/python/cpython/pull/23827#issuecomment-753598860 Then reverted: - in 3.8 https://github.com/python/cpython/pull/24093 - in 3.9 https://github.com/python/cpython/pull/24092 I edited the revert to keep only relevant parts, as only a few bits of the commit were causing troubles. Issue is: Sphinx 2 and Sphinx 3 have incompatible handling of backslahes, fixing them for Sphinx 3 in Python 3.10, then backporting to 3.8 and 3.9 which use Sphinx 2 caused an issue: `\n` for example are rendered as `n`, easy to notice in the documentaion of print: print(*objects, sep=' ', end='n', file=sys.stdout, flush=False)? As migration to Sphinx 3 was hard (done for Python 3.10 documentation), it won't be backported to 3.8 and 3.9, which will still be built using Sphinx 2, so some bits had to be reverted for the doc to display the backslash of `\n`. ---------- assignee: mdk components: Documentation messages: 384324 nosy: adelfino, mdk priority: normal severity: normal stage: commit review status: open title: Missing backslashes in documentation for 3.8 and 3.9 versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 08:04:22 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 04 Jan 2021 13:04:22 +0000 Subject: [issue42822] Missing backslashes in documentation for 3.8 and 3.9 In-Reply-To: <1609765422.49.0.483236804978.issue42822@roundup.psfhosted.org> Message-ID: <1609765462.33.0.219243649416.issue42822@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +22925 pull_request: https://github.com/python/cpython/pull/24092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 09:29:42 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 14:29:42 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1609770582.87.0.843001893092.issue1635741@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22926 pull_request: https://github.com/python/cpython/pull/24095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 09:31:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 14:31:20 +0000 Subject: [issue42739] Crash when try to disassemble bogus code object In-Reply-To: <1608897358.97.0.834158885511.issue42739@roundup.psfhosted.org> Message-ID: <1609770680.79.0.959405453476.issue42739@roundup.psfhosted.org> Mark Shannon added the comment: dis is able to handle code with no line numbers. >>> def f(): pass ... >>> co = f.__code__.replace(co_linetable=b'\xff') >>> list(co.co_lines()) [] >>> import dis >>> dis.dis(co) 0 LOAD_CONST 0 (None) 2 RETURN_VALUE The problem with the example Serhiy gives is that the line number table does not end in a sentinel value. You shouldn't be creating code objects unless you really know what you are doing. I.e. never. For manually created code objects that don't respect the invariants, any behavior is acceptable IMO. ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 09:34:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 14:34:37 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1609770877.01.0.718057327319.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c8a87addb1fa35dec79ed8f227eba3694fc36234 by Mohamed Koubaa in branch 'master': bpo-1635741: Port pyexpat to multi-phase init (PEP 489) (GH-22222) https://github.com/python/cpython/commit/c8a87addb1fa35dec79ed8f227eba3694fc36234 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 10:14:25 2021 From: report at bugs.python.org (David Steele) Date: Mon, 04 Jan 2021 15:14:25 +0000 Subject: [issue12806] argparse: Hybrid help text formatter In-Reply-To: <1313973978.37.0.422477813424.issue12806@psf.upfronthosting.co.za> Message-ID: <1609773265.58.0.988054217179.issue12806@roundup.psfhosted.org> David Steele added the comment: For those looking for a solution now, see https://pypi.org/project/argparse-formatter/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 10:24:37 2021 From: report at bugs.python.org (hai shi) Date: Mon, 04 Jan 2021 15:24:37 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609773877.45.0.186452065328.issue41798@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +22927 pull_request: https://github.com/python/cpython/pull/24096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 10:27:57 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 04 Jan 2021 15:27:57 +0000 Subject: [issue42541] Tkinter colours wrong on MacOS universal2 In-Reply-To: <1606920595.63.0.665509072103.issue42541@roundup.psfhosted.org> Message-ID: <1609774077.19.0.765537711109.issue42541@roundup.psfhosted.org> E. Paine added the comment: Note: Tcl/Tk 8.6.11 was released a few days ago (thanks Kevin/Marc!). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 10:31:07 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 04 Jan 2021 15:31:07 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609774267.71.0.779705181257.issue42584@roundup.psfhosted.org> Steve Dower added the comment: Honestly, keeping a CI run alive is more work than just doing the extract and push myself. I know this means it feels like you can't do as much yourself to speed up the integration, but it really isn't going to slow it down that much. FWIW, any core dev can merge SQLite updates for Windows (if they're satisfied there are no issues). It's only OpenSSL that relies on running a signed build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 10:34:30 2021 From: report at bugs.python.org (FX Coudert) Date: Mon, 04 Jan 2021 15:34:30 +0000 Subject: [issue42819] readline 8.1 bracketed paste In-Reply-To: <1609707155.89.0.22999518491.issue42819@roundup.psfhosted.org> Message-ID: <1609774470.67.0.533688444092.issue42819@roundup.psfhosted.org> FX Coudert added the comment: This bug is present in all versions since the 3.6 branch at least, but was only triggered when users' readline settings explicitly enabled bracketed-paste. Previous reports: https://bugs.python.org/issue32019 and https://bugs.python.org/issue39820 Longer discussion (on a more extensive feature request) at https://bugs.python.org/issue38747 The new factor is that readline 8.1 now enables bracketed-paste by default. So the broken behaviour is seen for Python built with the latest readline, with no specific setting. Python should probably in the long term be improved to handle bracketed-paste, which will make a nicer user experience. But in the short term, it should communication with readline to disable bracketed-paste at runtime, and restore the previous behaviour. ---------- nosy: +fxcoudert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 11:32:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 16:32:45 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set Message-ID: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> New submission from Mark Shannon : The logic for frame.f_lineno assumes that the internal C field will be updated when f_trace is set, but that is incorrect. Consequently, the following code import sys def print_line(): print(sys._getframe(1).f_lineno) def test(): print_line() sys._getframe(0).f_trace = True print_line() print_line() test() prints 7 8 8 it should print 7 9 10 Fixing this is required by PEP 626, but it should be fixed anyway. ---------- assignee: Mark.Shannon messages: 384331 nosy: Mark.Shannon priority: normal severity: normal status: open title: Incorrect frame.f_lineno when frame.f_trace is set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 11:55:18 2021 From: report at bugs.python.org (Fabian.M) Date: Mon, 04 Jan 2021 16:55:18 +0000 Subject: [issue42824] get_type_hints throws for local class reference Message-ID: <1609779318.04.0.39059957238.issue42824@roundup.psfhosted.org> New submission from Fabian.M : The following code throws with "NameError: name 'Nested' is not defined". For reference, it works well when moving class definitions out of the local scope. import typing T = typing.TypeVar('T') def test(): class Nested(typing.Generic[T]): pass class Test(typing.Generic[T]): nested: Nested[T] typing.get_type_hints(Test) # this throws test() ---------- components: Library (Lib) messages: 384332 nosy: Fabian.M priority: normal severity: normal status: open title: get_type_hints throws for local class reference type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:42:40 2021 From: report at bugs.python.org (Austin Lamb) Date: Mon, 04 Jan 2021 17:42:40 +0000 Subject: [issue42825] Optimization opportunity on Windows Message-ID: <1609782160.13.0.0224895080942.issue42825@roundup.psfhosted.org> New submission from Austin Lamb : I noticed that CPython and the various libraries built out of the repo aren't using the "/OPT:REF" linker optimization on Windows. This optimization allows the linker to throw away dead/unreachable code, resulting in a substantial decrease in binary size. That in turn also reduces the amount of Disk I/O that must be done to get these binaries in memory (which can be meaningful on spinning hard drives that are still rather common), and the reference set of applications using Python. I'll send a PR for this shortly, just filing the issue to be able to reference it in the PR. ---------- components: Windows messages: 384333 nosy: Austin-Lamb, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Optimization opportunity on Windows type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:47:07 2021 From: report at bugs.python.org (=?utf-8?q?Peter_Pavlini=C4=8D?=) Date: Mon, 04 Jan 2021 17:47:07 +0000 Subject: [issue42826] typing.Iterable does not need__getitem__() method Message-ID: <1609782427.22.0.495333991832.issue42826@roundup.psfhosted.org> New submission from Peter Pavlini? : https://docs.python.org/3.10/glossary.html#term-iterable ---------- assignee: docs at python components: Documentation messages: 384334 nosy: docs at python, peter.pavlinic priority: normal severity: normal status: open title: typing.Iterable does not need__getitem__() method type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:49:15 2021 From: report at bugs.python.org (=?utf-8?q?Peter_Pavlini=C4=8D?=) Date: Mon, 04 Jan 2021 17:49:15 +0000 Subject: [issue42826] typing.Iterable does not need __getitem__() method In-Reply-To: <1609782427.22.0.495333991832.issue42826@roundup.psfhosted.org> Message-ID: <1609782555.29.0.538092017864.issue42826@roundup.psfhosted.org> Peter Pavlini? added the comment: In documentation it is written that typing.Iterable can be implemented with __getitem__() method that implements Sequence semantics. That is not correct. link: https://docs.python.org/3.79/glossary.html#term-iterable ---------- title: typing.Iterable does not need__getitem__() method -> typing.Iterable does not need __getitem__() method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:49:40 2021 From: report at bugs.python.org (=?utf-8?q?Peter_Pavlini=C4=8D?=) Date: Mon, 04 Jan 2021 17:49:40 +0000 Subject: [issue42826] typing.Iterable does not need __getitem__() method In-Reply-To: <1609782427.22.0.495333991832.issue42826@roundup.psfhosted.org> Message-ID: <1609782580.26.0.683634883727.issue42826@roundup.psfhosted.org> Peter Pavlini? added the comment: In documentation it is written that typing.Iterable can be implemented with __getitem__() method that implements Sequence semantics. That is not correct. link: /glossary.html#term-iterable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:50:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 17:50:49 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1609758953.83.0.998298203003.issue28937@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Excellent! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:51:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 17:51:37 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1609753094.16.0.975831791952.issue40636@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Sounds good, go for it. I assume @brandtbucher won't mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 12:59:34 2021 From: report at bugs.python.org (Austin Lamb) Date: Mon, 04 Jan 2021 17:59:34 +0000 Subject: [issue42825] Optimization opportunity on Windows In-Reply-To: <1609782160.13.0.0224895080942.issue42825@roundup.psfhosted.org> Message-ID: <1609783174.32.0.991472260171.issue42825@roundup.psfhosted.org> Change by Austin Lamb : ---------- keywords: +patch pull_requests: +22928 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:04:36 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 04 Jan 2021 18:04:36 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609783476.41.0.0736236576955.issue40636@roundup.psfhosted.org> Brandt Bucher added the comment: Yep, fine by me. I can remove them later today (unless Serhiy beats me to it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:07:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 18:07:05 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609783625.65.0.526369512891.issue42810@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 127dde591686816e379d1add015304e6b9fb6954 by Mark Shannon in branch 'master': bpo-42810: Mark jumps at end of if and try statements as artificial. (GH-24091) https://github.com/python/cpython/commit/127dde591686816e379d1add015304e6b9fb6954 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:20:57 2021 From: report at bugs.python.org (Marc Culler) Date: Mon, 04 Jan 2021 18:20:57 +0000 Subject: [issue42541] Tkinter colours wrong on MacOS universal2 In-Reply-To: <1606920595.63.0.665509072103.issue42541@roundup.psfhosted.org> Message-ID: <1609784457.12.0.446196473398.issue42541@roundup.psfhosted.org> Marc Culler added the comment: Well, actually the release was announced today. There was one bug fix which did not make it into the release but could possibly affect Python, due to the fact that Python is installed as a framework, and frameworks to not have icons. I can supply a (1-line) patch if needed. To test, import tkinter, create a tkinter.Tk object and open the "About Python" menu. If the icon displayed on the About dialog looks like a folder then you need the patch. Please let me know what happens when switching to dark mode. My concern arises from my understanding that python is being built with a macOS 10.9 SDK, which does not understand dark mode. I don't know what will happen when running that code on a system which does support dark mode. Since Tk can be build on Big Sur with a minimum target of 10.9 (and I recommend doing so) I think it should be OK. There may be warnings when linking _tkinter.so though. I do not understand why the 10.9 SDK is needed, since I recently built Python 3.9.0 on Big Sur, with a minimum target of 10.9, and did not see any significant issues. (Well, maybe A few warnings from the posix module need investigation.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:21:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 18:21:30 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609784490.96.0.305276678962.issue42823@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +22930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:25:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 18:25:00 +0000 Subject: [issue42803] Traced line number is wrong for "if not __debug__" In-Reply-To: <1609512183.17.0.454209386156.issue42803@roundup.psfhosted.org> Message-ID: <1609784700.52.0.0977630575646.issue42803@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:24:50 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 18:24:50 +0000 Subject: [issue42810] Nested if/else gets phantom else trace (3.10) In-Reply-To: <1609600165.12.0.126191975832.issue42810@roundup.psfhosted.org> Message-ID: <1609784690.43.0.0452320786269.issue42810@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:27:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 04 Jan 2021 18:27:08 +0000 Subject: [issue41463] Avoid duplicating jump information from opcode.py in compile.c In-Reply-To: <1596452415.91.0.969194719265.issue41463@roundup.psfhosted.org> Message-ID: <1609784828.48.0.782161818898.issue41463@roundup.psfhosted.org> Mark Shannon added the comment: I don't think we want to backport it ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 13:41:33 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 04 Jan 2021 18:41:33 +0000 Subject: [issue42541] Tkinter colours wrong on MacOS universal2 In-Reply-To: <1606920595.63.0.665509072103.issue42541@roundup.psfhosted.org> Message-ID: <1609785693.76.0.987306659254.issue42541@roundup.psfhosted.org> Ronald Oussoren added the comment: W.r.t. building on 10.9: until very recently (trunk and 3.9.1) Python didn?t check for symbol availability at runtime. Building on 10.9 is basically a workaround for that. The, for now experimental, ?universal2? installer for 3.9.1 is build on Big Sur and includes Tk 8.6.10 (and we?ll track Tk releases now that we have a more modern build system). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 14:53:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Jan 2021 19:53:19 +0000 Subject: [issue42826] typing.Iterable does not need __getitem__() method In-Reply-To: <1609782427.22.0.495333991832.issue42826@roundup.psfhosted.org> Message-ID: <1609789999.43.0.645410892685.issue42826@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not know how is it related to typing.Iterable and I have not found any mention of typing.Iterable on the provided link, but an iterable object can be implemented with __getitem__ method. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 14:58:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 19:58:43 +0000 Subject: [issue42824] get_type_hints throws for local class reference In-Reply-To: <1609779318.04.0.39059957238.issue42824@roundup.psfhosted.org> Message-ID: <1609790323.17.0.0717513976284.issue42824@roundup.psfhosted.org> Guido van Rossum added the comment: This is a known limitation. To get this to work you have to pass globals() and locals(): typing.get_type_hints(Test, globals(), locals()) ---------- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:10:30 2021 From: report at bugs.python.org (Yair Frid) Date: Mon, 04 Jan 2021 20:10:30 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1609791030.35.0.18722974854.issue42811@roundup.psfhosted.org> Change by Yair Frid : ---------- keywords: +patch nosy: +Fongeme nosy_count: 1.0 -> 2.0 pull_requests: +22931 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/24100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:21:06 2021 From: report at bugs.python.org (Florian Bruhin) Date: Mon, 04 Jan 2021 20:21:06 +0000 Subject: [issue1043134] Add preferred extensions for MIME types Message-ID: <1609791666.61.0.283313894323.issue1043134@roundup.psfhosted.org> Florian Bruhin added the comment: I think this has been fixed in Python 3.7+ via https://github.com/python/cpython/pull/14375 - at least for a couple of types. Comparing Python 3.6 with the current state, the following changed (which can be used as an "override" dict before calling mimetypes.guess_extension): "application/manifest+json": ".webmanifest", # not None "application/octet-stream": ".bin", # not .a "application/postscript": ".ps", # not .ai "application/vnd.ms-excel": ".xls", # not .xlb "application/vnd.ms-powerpoint": ".ppt", # not .pot "application/wasm": ".wasm", # not None "application/x-hdf5": ".h5", # not None "application/xml": ".xsl", # not .rdf "audio/mpeg": ".mp3", # not .mp2 "image/jpeg": ".jpg", # not .jpe "image/tiff": ".tiff", # not .tif "text/html": ".html", # not .htm "text/plain": ".txt", # not .bat "video/mpeg": ".mpeg", # not .m1v ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:33:45 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Jan 2021 20:33:45 +0000 Subject: [issue42541] Tkinter colours wrong on MacOS universal2 In-Reply-To: <1606920595.63.0.665509072103.issue42541@roundup.psfhosted.org> Message-ID: <1609792425.63.0.017417825285.issue42541@roundup.psfhosted.org> Ned Deily added the comment: As Ronald notes, as of 3.9.1, we are for the immediate future providing two macOS installer variants: the traditional 10.9+ Intel-64 variant that is built on 10.9 and includes Tk 8.6.8 and the new "experimental" 10.9+ "universal2" (Apple Silicon and Intel-64) variant built on macOS 11 which included Tk 8.6.10. As the new universal2 variant gains more exposure over the next releases of 3.9.x, we hope to migrate to that being the recommended variant and start to deprecate the traditional 10.9 variant for 3.9.x. For 3.10 pre-releases, we are now only providing the "universal2" variant; the next alpha release. 3.10.0a4, should be available very shortly and its macOS installer is built with the just released Tk 8.6.11. I have only run some preliminary tests at the moment and there do seem to be some changes and possible regressions in our tests when using 8.6.11 instead of 8.6.10 but I will investigate further over the next day or so and open issues as needed. Feel free to download 3.10.0a4 and test away! I did not see any issues with missing icons; with a Python framework build, Python and IDLE both run under app bundles with supplied icons amd that still seems to be working. Things may well be different for non-framework builds but they were before, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:48:09 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 04 Jan 2021 20:48:09 +0000 Subject: [issue42827] Multiline eval with assignment to function call segfaults Message-ID: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> New submission from Julien Palard : Tested in 3.9.0 and master (127dde5916): $ cat test.py eval( """[file for str(file) in [] ] """ ) $ ./python test.py python: Parser/pegen.c:149: byte_offset_to_character_offset: Assertion `col_offset >= 0 && (unsigned long)col_offset <= strlen(str)' failed. Fatal Python error: Aborted Current thread 0x00007f6454cfe280 (most recent call first): File "/home/mdk/clones/python/cpython/test.py", line 1 in Aborted (core dumped) (Adding Guido and Pablo to nosy as, IIRC, you're interested in parser things :)) ---------- messages: 384348 nosy: gvanrossum, mdk, pablogsal priority: normal severity: normal status: open title: Multiline eval with assignment to function call segfaults type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:53:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 20:53:07 +0000 Subject: [issue42827] Multiline eval with assignment to function call segfaults In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609793587.9.0.768268944125.issue42827@roundup.psfhosted.org> STINNER Victor added the comment: Reproducer as a single line: compile("[file for str(file) in []\n]", "string", "exec") ---------- components: +Interpreter Core keywords: +3.9regression nosy: +lys.nikolaou, vstinner versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 15:54:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 20:54:00 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609793640.53.0.539072127032.issue42827@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Multiline eval with assignment to function call segfaults -> pegen parser: Multiline eval with assignment to function call: assertion failed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 16:12:16 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 04 Jan 2021 21:12:16 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1609794736.74.0.515979211318.issue29708@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 16:13:16 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 04 Jan 2021 21:13:16 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1609794796.64.0.495237976701.issue17343@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 16:19:46 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 04 Jan 2021 21:19:46 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609795186.11.0.626969675474.issue42827@roundup.psfhosted.org> Julien Palard added the comment: According to git bisect it come from 01ece63d42b830df106948db0aefa6c1ba24416a, thanks Victor for adding Lysandros, you had a good feeling :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 16:26:52 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 21:26:52 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609795612.88.0.479107343764.issue42584@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > FWIW, any core dev can merge SQLite updates for Windows (if they're satisfied there are no issues). A CI check would indicate that there are no issues. The PoC CI is just a short bash script wrapped in GitHub's workflow syntax. I'd be happy to maintain it, FWIW. On the other hand, adding a CI check is not super important for me :) https://sqlite.org/versionnumbers.html: "[?] the current tarball naming conventions only reserve two digits for the Y and so the naming format for downloads will need to be revised in about 2030." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 16:33:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jan 2021 21:33:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1609796033.54.0.0423735146758.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0b858cdd5d114f0890b11b6c4d6559d0ceb468ab by Erlend Egeberg Aasland in branch 'master': bpo-1635741: Convert _multibytecodec to multi-phase init (GH-24095) https://github.com/python/cpython/commit/0b858cdd5d114f0890b11b6c4d6559d0ceb468ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:05:30 2021 From: report at bugs.python.org (J.D. Rudie) Date: Mon, 04 Jan 2021 23:05:30 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' In-Reply-To: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> Message-ID: <1609801530.95.0.357816829381.issue42818@roundup.psfhosted.org> J.D. Rudie added the comment: Is this an issue with zipimporter, or an issue with a version of setuptools? On the latest version of setuptools, find_spec reverts to find_module, which should be implemented in the 3.9 version of zipimporter unless I'm misunderstanding the issue. ---------- nosy: +rudiejd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:05:56 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 23:05:56 +0000 Subject: [issue42093] Add opcode cache for LOAD_ATTR In-Reply-To: <1603163916.18.0.528007796853.issue42093@roundup.psfhosted.org> Message-ID: <1609801556.26.0.0575921522692.issue42093@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks! Do you have any plans for further inline caches? I was wondering if we could reverse the situation for slots again by adding slots support to the LOAD_ATTR opcode inline cache... ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:16:47 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 23:16:47 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609802207.53.0.209619314554.issue40810@roundup.psfhosted.org> miss-islington added the comment: New changeset f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4 by Erlend Egeberg Aasland in branch 'master': bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530) https://github.com/python/cpython/commit/f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:17:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 23:17:10 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609802230.01.0.779122977587.issue40810@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22933 pull_request: https://github.com/python/cpython/pull/24104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:17:23 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 23:17:23 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609802243.0.0.21518436679.issue40810@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22934 pull_request: https://github.com/python/cpython/pull/24105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:18:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 04 Jan 2021 23:18:26 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609802306.63.0.40963546912.issue40810@roundup.psfhosted.org> Guido van Rossum added the comment: Please ping this issue if the backports don't auto-merge after the tests pass, or if the tests fail. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:20:18 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 23:20:18 +0000 Subject: [issue40822] Drop support for SQLite pre 3.7.15 In-Reply-To: <1590829305.32.0.448529686599.issue40822@roundup.psfhosted.org> Message-ID: <1609802418.41.0.677917672983.issue40822@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:31:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 23:31:39 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609803099.91.0.43735410998.issue40810@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22935 pull_request: https://github.com/python/cpython/pull/24106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:33:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 04 Jan 2021 23:33:39 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609803219.93.0.379431555045.issue40810@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > +1 for dropping support for < 3.7.15 in master. We should fix or skip tests in maintenance branches. PR's for fixing the tests in 3.9 and 3.8 are now awaiting merge. PR for dropping support for SQLite pre 3.7.15 in master is opened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:36:45 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 23:36:45 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609803405.53.0.118433467636.issue40810@roundup.psfhosted.org> miss-islington added the comment: New changeset 0ccac5ff587d7637854e5d3e75f0f9a8f5528e59 by Miss Islington (bot) in branch '3.8': bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530) https://github.com/python/cpython/commit/0ccac5ff587d7637854e5d3e75f0f9a8f5528e59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:41:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 04 Jan 2021 23:41:18 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609803678.43.0.498693577341.issue40810@roundup.psfhosted.org> miss-islington added the comment: New changeset 80e5732d31bb7362c7b647acc618df701b3ae951 by Miss Islington (bot) in branch '3.9': bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530) https://github.com/python/cpython/commit/80e5732d31bb7362c7b647acc618df701b3ae951 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 18:42:31 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Mon, 04 Jan 2021 23:42:31 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609803751.69.0.861075960847.issue42827@roundup.psfhosted.org> Lysandros Nikolaou added the comment: Thanks for letting us know, Julien! I've identified the bug and where it comes from and I'll probably work on it tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 19:10:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 05 Jan 2021 00:10:45 +0000 Subject: [issue4714] print opcode stats at the end of pybench runs In-Reply-To: <1229895457.43.0.758313096043.issue4714@psf.upfronthosting.co.za> Message-ID: <1609805445.64.0.414037383372.issue4714@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> out of date stage: patch review -> resolved status: languishing -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 19:42:35 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 05 Jan 2021 00:42:35 +0000 Subject: [issue36675] Doctest directives and comments missing from code samples In-Reply-To: <1555757030.56.0.8094269644.issue36675@roundup.psfhosted.org> Message-ID: <1609807355.44.0.833214595396.issue36675@roundup.psfhosted.org> Anthony Sottile added the comment: should the minimum sphinx version be bumped and/or this reverted: https://github.com/python/cpython/blob/f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4/Doc/conf.py#L48 this change breaks, for example, sphinx 1.8.5 while building for ubuntu 20.04 The directive used here requires sphinx>=3.2.0 I notice some other attempts have been made to make the docs more compatible with sphinx 1.x in this release as well so there might be conflicting directions here: https://github.com/python/cpython/commit/b63a620014b67a6e63d10783149c41baaf59def8 ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 20:29:11 2021 From: report at bugs.python.org (karl) Date: Tue, 05 Jan 2021 01:29:11 +0000 Subject: [issue25258] HtmlParser doesn't handle void element tags correctly In-Reply-To: <1443468394.25.0.617953373069.issue25258@psf.upfronthosting.co.za> Message-ID: <1609810151.63.0.309866375619.issue25258@roundup.psfhosted.org> karl added the comment: The parsing rules for tokenization of html are at https://html.spec.whatwg.org/multipage/parsing.html#tokenization In the stack of open elements, there are specific rules for certain elements. https://html.spec.whatwg.org/multipage/parsing.html#special from a DOM point of view, there is indeed no difference in between https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cimg%20src%3D%22somewhere%22%3E%3Cimg%20src%3D%22somewhere%22%2F%3E ---------- nosy: +karlcow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 20:32:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 05 Jan 2021 01:32:55 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609810375.06.0.0747191760811.issue42827@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +22936 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 20:34:11 2021 From: report at bugs.python.org (karl) Date: Tue, 05 Jan 2021 01:34:11 +0000 Subject: [issue25258] HtmlParser doesn't handle void element tags correctly In-Reply-To: <1443468394.25.0.617953373069.issue25258@psf.upfronthosting.co.za> Message-ID: <1609810451.87.0.355834457827.issue25258@roundup.psfhosted.org> karl added the comment: I wonder if the confusion comes from the name. The HTMLParser is kind of a tokenizer more than a full HTML parser, but that's probably a detail. It doesn't create a DOM Tree which you can access, but could help you to build a DOM Tree (!= DOM Document object) https://html.spec.whatwg.org/multipage/parsing.html#overview-of-the-parsing-model > Implementations that do not support scripting do not have to actually create a DOM Document object, but the DOM tree in such cases is still used as the model for the rest of the specification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 21:19:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 05 Jan 2021 02:19:54 +0000 Subject: [issue42093] Add opcode cache for LOAD_ATTR In-Reply-To: <1603163916.18.0.528007796853.issue42093@roundup.psfhosted.org> Message-ID: <1609813194.07.0.457129178836.issue42093@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Thanks! Do you have any plans for further inline caches? Yeah, we are experimenting with some ideas here: https://bugs.python.org/issue42115. > I was wondering if we could reverse the situation for slots again by adding slots support to the LOAD_ATTR opcode inline cache... I think we can do it as long as we can detect easily if a given descriptor is immutable. The problem of mutability is this code: class Descriptor: pass class C: def __init__(self): self.x = 1 x = Descriptor() def f(o): return o.x o = C() for i in range(10000): assert f(o) == 1 Descriptor.__get__ = lambda self, instance, value: 2 Descriptor.__set__ = lambda *args: None print(f(o)) In this case, if we do not skip the cache for mutable descriptors, the code will not reflect the new result (2 instead of 1). __slots__ are immutable descriptors so we should be good as long as we can detect them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 21:45:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 05 Jan 2021 02:45:02 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609814702.44.0.221439270909.issue42115@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 21:52:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 02:52:40 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609815160.47.0.699516758353.issue42804@roundup.psfhosted.org> Terry J. Reedy added the comment: >From the evidence presented, the problem building 3.8 on Win 10 is not with our build code. I therefore believe that this should be closed as '3rd-party' and that Sunny should inquire on python-list about the permission problem. However, I marked this for 'Window' and will give our Windows experts a few days to add something before closing. ---------- components: +Windows nosy: +paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 22:57:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 05 Jan 2021 03:57:20 +0000 Subject: [issue42093] Add opcode cache for LOAD_ATTR In-Reply-To: <1603163916.18.0.528007796853.issue42093@roundup.psfhosted.org> Message-ID: <1609819040.53.0.977677271891.issue42093@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, I was thinking to recognize the specific type of descriptor used by slots and cache only that. Though we would still have to consider updates to C.__dict__ (that's handled by looking at the dict version right?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 4 23:52:33 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 05 Jan 2021 04:52:33 +0000 Subject: [issue42826] typing.Iterable does not need __getitem__() method In-Reply-To: <1609782427.22.0.495333991832.issue42826@roundup.psfhosted.org> Message-ID: <1609822353.88.0.362980035256.issue42826@roundup.psfhosted.org> Josh Rosenberg added the comment: As Serhiy says, the glossary term for an iterable is not the same as the documentation for typing.Iterable (which at this point is largely defined in terms of collections.abc.Iterable). True, collections.abc.Iterable does not detect classes that iterate via __getitem__, only via __iter__ (the docs are quite clear on this), but such __getitem__ based classes are still iterable in the broad sense of the term used in the glossary. ---------- nosy: +josh.r resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 00:06:20 2021 From: report at bugs.python.org (Dustin Rodrigues) Date: Tue, 05 Jan 2021 05:06:20 +0000 Subject: [issue42819] readline 8.1 bracketed paste In-Reply-To: <1609707155.89.0.22999518491.issue42819@roundup.psfhosted.org> Message-ID: <1609823180.83.0.783110055901.issue42819@roundup.psfhosted.org> Change by Dustin Rodrigues : ---------- keywords: +patch pull_requests: +22937 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24108 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 00:25:32 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 05 Jan 2021 05:25:32 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609824332.42.0.171180312394.issue40636@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +22938 pull_request: https://github.com/python/cpython/pull/24109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 01:37:22 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Tue, 05 Jan 2021 06:37:22 +0000 Subject: [issue27820] Possible bug in smtplib when initial_response_ok=False In-Reply-To: <1471739698.94.0.271523306415.issue27820@psf.upfronthosting.co.za> Message-ID: <1609828642.48.0.0746069230003.issue27820@roundup.psfhosted.org> Pandu E POLUAN added the comment: Okay, I finally figured out what's wrong. This piece of code in `test_smtplib.py`: if self.smtp_state == self.AUTH: line = self._emptystring.join(self.received_lines) print('Data:', repr(line), file=smtpd.DEBUGSTREAM) self.received_lines = [] try: self.auth_object(line) except ResponseException as e: self.smtp_state = self.COMMAND self.push('%s %s' % (e.smtp_code, e.smtp_error)) return The last "return" is over-indented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 01:38:39 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 05 Jan 2021 06:38:39 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609828719.16.0.578433903531.issue40810@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher nosy_count: 6.0 -> 7.0 pull_requests: +22939 pull_request: https://github.com/python/cpython/pull/24110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 01:39:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 05 Jan 2021 06:39:56 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609828796.7.0.105468506892.issue40810@roundup.psfhosted.org> Brandt Bucher added the comment: It looks like the markup in the NEWS entry broke Travis on master. I guess that's one downside of Travis not being a required job anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 01:57:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 05 Jan 2021 06:57:25 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609829845.72.0.411432565642.issue40810@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22940 pull_request: https://github.com/python/cpython/pull/24111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 01:57:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 05 Jan 2021 06:57:43 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609829863.11.0.61897694476.issue40810@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22941 pull_request: https://github.com/python/cpython/pull/24112 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:05:37 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 05 Jan 2021 07:05:37 +0000 Subject: [issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs In-Reply-To: <1589570739.4.0.582573486837.issue40636@roundup.psfhosted.org> Message-ID: <1609830337.57.0.294141818119.issue40636@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 27f9dafc2ba51864a9bc2fe5d6293eb4fd887bce by Brandt Bucher in branch 'master': bpo-40636: Remove overly-strict zip pickling tests (GH-24109) https://github.com/python/cpython/commit/27f9dafc2ba51864a9bc2fe5d6293eb4fd887bce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:13:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 07:13:22 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609830802.63.0.106333018822.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 59f9b4e4509be67494f3d45489fa55523175ff69 by Serhiy Storchaka in branch 'master': bpo-42681: Fix test_curses failures related to color pairs (GH-24089) https://github.com/python/cpython/commit/59f9b4e4509be67494f3d45489fa55523175ff69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:24:40 2021 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 05 Jan 2021 07:24:40 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609831480.23.0.613496708679.issue40810@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +cheryl.sabella nosy_count: 7.0 -> 8.0 pull_requests: +22942 pull_request: https://github.com/python/cpython/pull/14491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:26:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 07:26:50 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609831610.8.0.357150497344.issue32631@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset e40e2a2cc94c554e7e245a8ca5a7432d31a95766 by Cheryl Sabella in branch 'master': bpo-32631: IDLE: Enable zzdummy example extension module (GH-14491) https://github.com/python/cpython/commit/e40e2a2cc94c554e7e245a8ca5a7432d31a95766 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:43:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 07:43:39 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609832619.81.0.598062207326.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22943 pull_request: https://github.com/python/cpython/pull/24113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 02:46:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 07:46:21 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609832781.2.0.526058583418.issue32631@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +22944 pull_request: https://github.com/python/cpython/pull/24114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:03:18 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Tue, 05 Jan 2021 08:03:18 +0000 Subject: [issue42498] smtplib is glitchy after receive server code 500 In-Reply-To: <1606627835.9.0.185077481862.issue42498@roundup.psfhosted.org> Message-ID: <1609833798.02.0.70578529849.issue42498@roundup.psfhosted.org> Pandu E POLUAN added the comment: The "problem" is that smtplib.SMTP does the following, in essence: 1. Open connection to server 2. Send EHLO 3. Read server response The PROXY injection causes a response from the server, but the response gets "cached" in the incoming TCP buffer. The injection script likely does not consume this buffer, resulting in Step 3 above reading this "cached" response. So from the point of view of smtplib.SMTP, the "503" message arrives _after_ EHLO is sent, while in actuality the "503" arrives before EHLO is sent. I suggest rewriting the port forwarding script so that it consumes the response from the server first before transferring to smtplib.SMTP ---------- nosy: +pepoluan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:09:38 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 08:09:38 +0000 Subject: [issue42508] macOS IDLE with Tk 8.6.10 in 3.9.1rc1 universal2 installer fails smoke test In-Reply-To: <1606706274.22.0.163331071262.issue42508@roundup.psfhosted.org> Message-ID: <1609834178.71.0.411712241495.issue42508@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset d05b470d6ad6dfe0d4933ffc3c5c1e2c03b390bd by Miss Islington (bot) in branch '3.8': bpo-42508: Keep IDLE running on macOS (GH-23577) (#23670) https://github.com/python/cpython/commit/d05b470d6ad6dfe0d4933ffc3c5c1e2c03b390bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:10:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 08:10:47 +0000 Subject: [issue42508] macOS IDLE with Tk 8.6.10 in 3.9.1rc1 universal2 installer fails smoke test In-Reply-To: <1606706274.22.0.163331071262.issue42508@roundup.psfhosted.org> Message-ID: <1609834247.85.0.0372818678445.issue42508@roundup.psfhosted.org> Terry J. Reedy added the comment: I believe that this issue is done. Please open a new one if more is needed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:26:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 08:26:05 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609835165.84.0.219999315982.issue32631@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset d82392facefe0564dd55aa2adf04bf21c704858d by Terry Jan Reedy in branch '3.9': [3.9] bpo-32631: IDLE: Enable zzdummy example extension module (GH-14491) https://github.com/python/cpython/commit/d82392facefe0564dd55aa2adf04bf21c704858d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:35:48 2021 From: report at bugs.python.org (Julien Palard) Date: Tue, 05 Jan 2021 08:35:48 +0000 Subject: [issue42822] Missing backslashes in documentation for 3.8 and 3.9 In-Reply-To: <1609765422.49.0.483236804978.issue42822@roundup.psfhosted.org> Message-ID: <1609835748.97.0.250937280764.issue42822@roundup.psfhosted.org> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:36:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 08:36:43 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609835803.01.0.324096082186.issue32631@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +22945 pull_request: https://github.com/python/cpython/pull/24115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 03:42:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 08:42:02 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609836122.03.0.508845492115.issue32631@roundup.psfhosted.org> Terry J. Reedy added the comment: https://stackoverflow.com/questions/65567057/how-can-i-get-started-developing-extensions-for-python-idle prompted me to finish this enough to merge it. My intention was that in the absence of a selection, all lines should be prefixed, not just the current one. My impression is that some other formatters do this, but maybe not. In any case, it does not matter exactly what this dummy example does, as long as it works as documented. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 04:18:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 09:18:11 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609838291.71.0.41340704229.issue32631@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset a087a97438e922fcace357ff4c29806ff65838d8 by Terry Jan Reedy in branch '3.8': [3.8] bpo-32631: IDLE: Enable zzdummy example extension module (GH-14491) https://github.com/python/cpython/commit/a087a97438e922fcace357ff4c29806ff65838d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 04:18:33 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 09:18:33 +0000 Subject: [issue32631] IDLE: revise zzdummy.py In-Reply-To: <1516690644.63.0.467229070634.issue32631@psf.upfronthosting.co.za> Message-ID: <1609838313.27.0.781969106683.issue32631@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 05:12:30 2021 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Tue, 05 Jan 2021 10:12:30 +0000 Subject: [issue33944] Deprecate and remove code execution in pth files In-Reply-To: <1529688140.44.0.56676864532.issue33944@psf.upfronthosting.co.za> Message-ID: <1609841550.58.0.275073616062.issue33944@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 05:19:01 2021 From: report at bugs.python.org (Marco Franzo) Date: Tue, 05 Jan 2021 10:19:01 +0000 Subject: [issue42828] Python readline module Message-ID: <1609841941.92.0.341483279239.issue42828@roundup.psfhosted.org> New submission from Marco Franzo : It would be better to write at the end of the program this: os.system('stty sane') because when you import readline, at the end of program, the console remains unusable ---------- assignee: docs at python components: Documentation messages: 384379 nosy: docs at python, frenzisys priority: normal severity: normal status: open title: Python readline module type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 05:38:02 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 05 Jan 2021 10:38:02 +0000 Subject: [issue42828] Python readline module In-Reply-To: <1609841941.92.0.341483279239.issue42828@roundup.psfhosted.org> Message-ID: <1609843082.67.0.640359451576.issue42828@roundup.psfhosted.org> Steven D'Aprano added the comment: > when you import readline, at the end of program, the console remains unusable I cannot replicate that. I've been using readline in versions of Python starting from 2.4 to 3.9 and it has not left the console in an unusual state. Can you give an example of how to reproduce that? What OS and shell are you using? Which terminal application? Can you show an example of this bug? Preferably by coping and pasting text, but if necessary a screen shot. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:18:32 2021 From: report at bugs.python.org (Svyatoslav) Date: Tue, 05 Jan 2021 11:18:32 +0000 Subject: [issue42829] get_type_hints throws for nested class with __future__ annotations Message-ID: <1609845512.57.0.0433631135188.issue42829@roundup.psfhosted.org> New submission from Svyatoslav : If a class X has nested class Y and class X has annotation Y AFTER the definition of Y, get_type_hints(X) throws NameError if import from future annotations is present. This is because get_type_hints looks only at mro of the class. Its namespace must be included too as locals. ---------- files: annotations.py messages: 384381 nosy: Prometheus3375 priority: normal severity: normal status: open title: get_type_hints throws for nested class with __future__ annotations versions: Python 3.9 Added file: https://bugs.python.org/file49719/annotations.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:24:00 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 05 Jan 2021 11:24:00 +0000 Subject: [issue42455] Add decorator_factory function to functools module In-Reply-To: <1606250077.84.0.747907374749.issue42455@roundup.psfhosted.org> Message-ID: <1609845840.55.0.170831240592.issue42455@roundup.psfhosted.org> Nick Coghlan added the comment: I think the idea is a plausible and well-presented suggestion, but I'm afraid I'm still going to agree with the view that we shouldn't add this. >From a maintainability point of view, *generically* detecting the difference between "applied without parentheses as a decorator" and "called with parameters to produce a partial function to be used as a decorator" isn't quite as simple as just calling "callable(args[0])", since it's entirely possible for decorator factories to accept callables as parameters. We could try to document our way around that problem, but we wouldn't be able to eliminate it entirely. Given the relative rarity of the use case, and the potential for subtle issues when the assumptions of the decorator_factory decorator aren't met, I'm happy to leave this task to inline mostly-but-not-completely-boilerplate code rather than trying to abstract it away. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:27:54 2021 From: report at bugs.python.org (James Oldfield) Date: Tue, 05 Jan 2021 11:27:54 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609846074.99.0.876112006766.issue39457@roundup.psfhosted.org> James Oldfield added the comment: If this ever gets implemented, "autocommit" would be a terrible name for it. That word has a very specific meaning in SQLite, which is essentially the same as "not in a transaction started with BEGIN ...". At the moment, if you want to explicitly control when transactions start (a good idea considering how confusing the current behaviour is) then you would set isolation_mode to None and manually start a transaction with `execute("BEGIN")` - at which point you are NOT in autocommit mode, until you commit or rollback. According to this proposal, if I want manual control over transactions, I would set `conn.autocommit = True`, even though I *don't* want autocommit mode (according to SQLite's definition)! ---------- nosy: +james.oldfield _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:28:47 2021 From: report at bugs.python.org (=?utf-8?b?TWllY3p5c8WCYXcgVG9yY2hhxYJh?=) Date: Tue, 05 Jan 2021 11:28:47 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called Message-ID: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> New submission from Mieczys?aw Torcha?a : tempfile mkstemp() documentation says: "Unlike TemporaryFile(), the user of mkstemp() is responsible for deleting the temporary file when done with it." mkstemp() returns a tuple: file_descriptor, file_path = mkstemp() Calling only os.unlink(file_path) removes the file, but causes leaking file descriptors and when the number of temporary files created is higher than `ulimit -n`, the process crashes (see /proc/$pid/fd in real time until crash). The solution I found is to also call on descriptor: os.close(file_descriptor) but the documentation doesn't mention that (i.e. releasing file descriptor in addition to removing temporary file). For many users it doesn't matter as they create a few files and when the process finishes, leaking file descriptors are released. However, when a lot of files is created during the execution, it will finally crash (unless someone has a huge ulimit -n setting). If this is not a bug, at least the documentation should mention that both the temp file needs to be removed and the file descriptor released. However, this means calling two commands when only one command was used to create the temporary file. Therefore, maybe adding a function to tempfile library to fully remove a file without a leaking file descriptor is a solution. ---------- components: Library (Lib) messages: 384384 nosy: mieczyslaw.torchala priority: normal severity: normal status: open title: tempfile mkstemp() leaks file descriptors if os.close() is not called type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:34:43 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 05 Jan 2021 11:34:43 +0000 Subject: [issue42455] Add decorator_factory function to functools module In-Reply-To: <1606250077.84.0.747907374749.issue42455@roundup.psfhosted.org> Message-ID: <1609846483.03.0.29673297122.issue42455@roundup.psfhosted.org> Nick Coghlan added the comment: Sorry, I meant to include this comment as well: The other filter I applied here was "Could someone figure out the boilerplate code themselves in less time than it would take them to find, read, and understand the documentation for the new helper function?" I'm not sure the answer to that question is "Yes" when writing a decorator factory for the first time, but I am confident it is "Yes" when reading a decorator factory, and for anyone writing their second and subsequent factory (especially if they use the "def factory(decorated=None, /, *, keyword="only", params=True)" idiom the way dataclass and _tp_cache do). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 06:40:50 2021 From: report at bugs.python.org (Svyatoslav) Date: Tue, 05 Jan 2021 11:40:50 +0000 Subject: [issue42829] get_type_hints throws for nested class with __future__ annotations In-Reply-To: <1609845512.57.0.0433631135188.issue42829@roundup.psfhosted.org> Message-ID: <1609846850.9.0.929067149865.issue42829@roundup.psfhosted.org> Svyatoslav added the comment: > This is because get_type_hints looks only at mro of the class. Its namespace must be included too as locals < I'll correct myself. get_type_hints() looks at all entites of mro of a class. If globals are not defined, globals of an entity module are used. But if locals are not defined, then no action is taken. Actually, class namespace must be used as locals in that case. This is also supported by the case when a class and its module have classes with the same name. See same_classes.py for an example. ---------- Added file: https://bugs.python.org/file49720/same_classes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:04:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 05 Jan 2021 12:04:20 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609848260.13.0.596826173931.issue42823@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ee9f98d9f4b881ee15868a836a2b99271df1bc0e by Mark Shannon in branch 'master': bpo-42823: Fix frame lineno when frame.f_trace is set (GH-24099) https://github.com/python/cpython/commit/ee9f98d9f4b881ee15868a836a2b99271df1bc0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:07:07 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 05 Jan 2021 12:07:07 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609848427.27.0.704549522731.issue42823@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:23:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 12:23:47 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609849427.52.0.636941824381.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 9b3a53a8264d4c469a3f3d8c037e74c010be3e5c by Serhiy Storchaka in branch '3.9': [3.9] bpo-42681: Fix test_curses failures related to color pairs (GH-24089) (GH-24113) https://github.com/python/cpython/commit/9b3a53a8264d4c469a3f3d8c037e74c010be3e5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:38:50 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 12:38:50 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609850330.7.0.762172131185.issue41798@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Hai Shi, do you mind if I have a go at the socket module CAPI capsule? ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:42:52 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 12:42:52 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609850572.11.0.602035180832.issue36543@roundup.psfhosted.org> Petr Viktorin added the comment: Let me just point out there's an official process for making incompatible changes now: https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes A warning must be emitted (not just mentioned in docs) for two releases before a feature is removed. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:49:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 12:49:20 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609850960.16.0.550311058365.issue42681@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22946 pull_request: https://github.com/python/cpython/pull/24116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:54:54 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 05 Jan 2021 12:54:54 +0000 Subject: [issue42831] IDLE fix colours for MacOS dark mode Message-ID: <1609851294.14.0.191191657845.issue42831@roundup.psfhosted.org> New submission from E. Paine : Currently IDLE, in some places, uses predefined colours which assume it is in light mode. However, on the new Universal2 installers (I tested using 3.10.0a4) this causes issues, where this can no longer be assumed. Taking the "About IDLE" dialogue as an example, it appears in a light theme and most notably makes button text very hard to read (as this is changed to white). I propose, on macOS systems running Tk >=8.6.10, we try to switch these colours to the system colours described in https://github.com/tcltk/tk/blob/main/macosx/README (IMO, we would test colour availability and catch a TclError rather than specifying conditions ourselves). For the about dialogue I think we would, for example, replace `#bbbbbb` with one of the `systemWindowBackgroundColor`s. ---------- assignee: terry.reedy components: IDLE messages: 384391 nosy: epaine, taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE fix colours for MacOS dark mode versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 07:59:08 2021 From: report at bugs.python.org (hai shi) Date: Tue, 05 Jan 2021 12:59:08 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609851548.87.0.969431250989.issue41798@roundup.psfhosted.org> hai shi added the comment: > Hai Shi, do you mind if I have a go at the socket module CAPI capsule? Welcome to join this bpo, you can enhance those extension modules if you like :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 08:03:43 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 13:03:43 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609851823.25.0.217340148359.issue41798@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Welcome to join this bpo, you can enhance those extension modules if you like :) Thanks :) I'll take a look at socket first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 08:12:21 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Jan 2021 13:12:21 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609852341.13.0.0729415864038.issue41798@roundup.psfhosted.org> Christian Heimes added the comment: PySocketModuleAPI.timeout_error now points to builtin TimeoutError exception. I'm also in the process of removing PySocketModuleAPI from _ssl.c. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 08:17:02 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 13:17:02 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609852622.54.0.931418189859.issue41798@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > I'm also in the process of removing PySocketModuleAPI from _ssl.c. That's the only user of the API, right? In that case, I'll target _decimal instead. Hai Shi is working on _curses and _datetime, AFAIK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 08:37:15 2021 From: report at bugs.python.org (cptpcrd) Date: Tue, 05 Jan 2021 13:37:15 +0000 Subject: [issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux In-Reply-To: <1609262318.62.0.976413615492.issue42780@roundup.psfhosted.org> Message-ID: <1609853835.73.0.282657395341.issue42780@roundup.psfhosted.org> cptpcrd added the comment: I've put together some tests (patch attached). Should I PR this to python/cpython? ---------- Added file: https://bugs.python.org/file49721/set-inheritable-test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:00:17 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 05 Jan 2021 14:00:17 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609855217.87.0.438533412119.issue39457@roundup.psfhosted.org> G?ry added the comment: > If this ever gets implemented, "autocommit" would be a terrible name for it. That word has a very specific meaning in SQLite, which is essentially the same as "not in a transaction started with BEGIN ...". Yes if you are talking about SQLite, the database ENGINE: the SQL statements inside BEGIN and COMMIT are said to be in manual commit mode, while SQL statements outside are said to be in autocommit mode. So the autocommit mode is the default mode for database ENGINES. But here I am talking about SQLite3, the Python database DRIVER. You do not issue BEGIN statements with database DRIVERS, they are issued implicitly, so that the manual mode is the default mode for database DRIVERS. Cf. this Stack Overflow answer for more details: https://stackoverflow.com/a/48391535/2326961 > At the moment, if you want to explicitly control when transactions start (a good idea considering how confusing the current behaviour is) No, you do not want that at the database DRIVER level. Because like Mike Bayer explained in issue #9924, this is not what other database DRIVERS do, and this is not PEP 249 compliant (Python Database API Specification v2.0), as its author Marc-Andr? Lemburg explained (cf. https://mail.python.org/pipermail/db-sig/2010-September/005645.html): > Randall Nortman wrote: > # PEP 249 says that transactions end on commit() or rollback(), but it > # doesn't explicitly state when transactions should begin, and there is > # no begin() method. > > Transactions start implicitly after you connect and after you call .commit() or .rollback(). They are not started for each statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:01:07 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 14:01:07 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609855267.92.0.339249170872.issue41798@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22947 pull_request: https://github.com/python/cpython/pull/24117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:04:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 14:04:32 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609855472.06.0.901379526282.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e2c847e0c518dd6c63a898b8265ba54b71548bd6 by Serhiy Storchaka in branch '3.8': [3.8] [3.9] bpo-42681: Fix test_curses failures related to color pairs (GH-24089) (GH-24113) (GH-24116) https://github.com/python/cpython/commit/e2c847e0c518dd6c63a898b8265ba54b71548bd6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:06:11 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Tue, 05 Jan 2021 14:06:11 +0000 Subject: [issue27820] Possible bug in smtplib when initial_response_ok=False In-Reply-To: <1471739698.94.0.271523306415.issue27820@psf.upfronthosting.co.za> Message-ID: <1609855571.81.0.853133508625.issue27820@roundup.psfhosted.org> Change by Pandu E POLUAN : ---------- keywords: +patch pull_requests: +22948 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24118 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:11:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 14:11:18 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609855878.38.0.0517494415996.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: This process is not new. The problem is that in this particular case warning will do more harm than removing the module. If we cannot just remove it, we should not introduce warning. It will be kept forever. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:14:48 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 14:14:48 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609856088.01.0.0384796201019.issue36543@roundup.psfhosted.org> Petr Viktorin added the comment: Should the process be changed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:16:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Jan 2021 14:16:48 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609856208.9.0.349430785394.issue36543@roundup.psfhosted.org> Christian Heimes added the comment: The process is fine. A deprecation warning will give users time to update code before it hits production. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:33:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 14:33:37 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609857217.32.0.988374798024.issue42681@roundup.psfhosted.org> Serhiy Storchaka added the comment: Well, a simple documentation issue has grown into large and complex changes that fix several bugs. * Incorrect parameter name in color_pair(). * Incorrectly documented ranges for color and pair numbers. * Based on incorrect documentation, incorrect checks was implemented in the code. * It was not caught earlier because most tests were skipped on buildbots. * BTW ncurses accepts some values outside of the documented ranges. * But ncurses 6.1 does not accept all values in the documented ranges. * There were other minor bugs introduced in issue36982. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:41:00 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 05 Jan 2021 14:41:00 +0000 Subject: [issue42637] Python macos11.0 release note tkinter problems in news In-Reply-To: <1607942339.24.0.547653054528.issue42637@roundup.psfhosted.org> Message-ID: <1609857660.79.0.49785902431.issue42637@roundup.psfhosted.org> Change by E. Paine : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 09:50:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 05 Jan 2021 14:50:55 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609858255.65.0.969994428098.issue42681@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks a lot Serhiy for the fantastic work! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:07:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 05 Jan 2021 15:07:33 +0000 Subject: [issue42832] classmethod change in 3.9 needs better documentation Message-ID: <1609859253.42.0.13260337218.issue42832@roundup.psfhosted.org> New submission from Irit Katriel : The change in issue 19072 broke our code where a decorator assumes that __get__ is only called for instance methods. It might be worth adding this to What's new in 3.9. Also in the documentation: https://docs.python.org/3/library/functions.html#classmethod It implies that before 3.9 it was not possible to wrap, but it was possible, it just behaved differently. ---------- assignee: docs at python components: Documentation messages: 384404 nosy: docs at python, iritkatriel priority: normal severity: normal status: open title: classmethod change in 3.9 needs better documentation type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:13:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 05 Jan 2021 15:13:15 +0000 Subject: [issue19072] classmethod doesn't honour descriptor protocol of wrapped callable In-Reply-To: <1379856164.11.0.6368818134.issue19072@psf.upfronthosting.co.za> Message-ID: <1609859595.22.0.867378963116.issue19072@roundup.psfhosted.org> Irit Katriel added the comment: I've created a followup issue re documentation of this change: issue42832 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:28:34 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 05 Jan 2021 15:28:34 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609860514.68.0.265936242606.issue42804@roundup.psfhosted.org> Zachary Ware added the comment: It seems possible that the fetch of the Tcl/Tk binaries failed somehow; you can try removing the entire `externals` directory (or just anything in it that includes `tcl` or `tk`); you can use `PCbuild\get_externals.bat --clean` to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:29:23 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 15:29:23 +0000 Subject: [issue42804] Unable to compile the cpython code x86 windows In-Reply-To: <1609524007.28.0.23660757957.issue42804@roundup.psfhosted.org> Message-ID: <1609860563.24.0.176364415717.issue42804@roundup.psfhosted.org> Steve Dower added the comment: If we can solve it, that would be better. The access denied error looks a bit like a build process (or previous Python build?) is still running that has locked one of the files. Restarting the PC is the easiest way to make sure nothing is using them, or you could try renaming the directory in your Externals folder and running get_externals again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:32:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 15:32:37 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1609860757.8.0.962261314742.issue41818@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 11.0 -> 12.0 pull_requests: +22949 pull_request: https://github.com/python/cpython/pull/24119 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:34:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 15:34:38 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1609860878.95.0.859523112707.issue41818@roundup.psfhosted.org> Petr Viktorin added the comment: I noticed an issue in one of the newly added tests; see GH-24119 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:35:06 2021 From: report at bugs.python.org (Pierre Tardy) Date: Tue, 05 Jan 2021 15:35:06 +0000 Subject: [issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive Message-ID: <1609860906.08.0.978981588338.issue42833@roundup.psfhosted.org> New submission from Pierre Tardy : original bug report: https://github.com/buildbot/buildbot/issues/5743 Twisted by default advertises its algorithm in lowercase, which is uncommon, but allowed by the spec. https://tools.ietf.org/html/rfc3230#section-4.1.1 python's request.py is only supporting MD5 or SHA as algorithm, and not lowercase equivalent. This is an easy and harmless fix. ---------- messages: 384409 nosy: Pierre.Tardy priority: normal severity: normal status: open title: Lib/urllib/request.py: digest algorithm should be case insensitive type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:35:32 2021 From: report at bugs.python.org (Pierre Tardy) Date: Tue, 05 Jan 2021 15:35:32 +0000 Subject: [issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive In-Reply-To: <1609860906.08.0.978981588338.issue42833@roundup.psfhosted.org> Message-ID: <1609860932.26.0.307841950287.issue42833@roundup.psfhosted.org> Change by Pierre Tardy : ---------- components: +Library (Lib) status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:35:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 15:35:44 +0000 Subject: [issue42794] test_nntplib fails on CI In-Reply-To: <1609407398.52.0.195663540983.issue42794@roundup.psfhosted.org> Message-ID: <1609860944.65.0.642953095493.issue42794@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +22950 pull_request: https://github.com/python/cpython/pull/22632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:47:22 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 15:47:22 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1609861642.39.0.0618972051099.issue40052@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 6e72ab909de58e89b5a7cd6899587e203cf129a3 by Miss Islington (bot) in branch '3.9': [3.9] bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999) (GH-24005) https://github.com/python/cpython/commit/6e72ab909de58e89b5a7cd6899587e203cf129a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:54:05 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 05 Jan 2021 15:54:05 +0000 Subject: [issue42834] [subinterpreters] Convert "global" static variable caches in _json to heap variables Message-ID: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> New submission from Ken Jin : _json currently uses a few static locals for caching of PyUnicode and one Exception object. This patch aims to move them to the heap. Apologies if this isn't the right way to track subinterpreter issues, I took a look at issue36876 but it seemed like a meta issue to me. ---------- components: Library (Lib), Subinterpreters messages: 384411 nosy: eric.snow, kj, vstinner priority: normal severity: normal status: open title: [subinterpreters] Convert "global" static variable caches in _json to heap variables versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:54:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 05 Jan 2021 15:54:25 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1609862065.35.0.0311961555108.issue40052@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +22951 pull_request: https://github.com/python/cpython/pull/24120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 10:59:21 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 05 Jan 2021 15:59:21 +0000 Subject: [issue42834] [subinterpreters] Convert "global" static variable caches in _json to heap variables In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1609862361.84.0.871756556961.issue42834@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +22952 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 11:00:08 2021 From: report at bugs.python.org (Pierre Tardy) Date: Tue, 05 Jan 2021 16:00:08 +0000 Subject: [issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive In-Reply-To: <1609860906.08.0.978981588338.issue42833@roundup.psfhosted.org> Message-ID: <1609862408.38.0.313801087241.issue42833@roundup.psfhosted.org> Change by Pierre Tardy : ---------- pull_requests: +22953 status: pending -> open pull_request: https://github.com/python/cpython/pull/24122 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 11:05:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 16:05:12 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609862712.49.0.960853747131.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: Deprecation warning may help users of old lower-quality code at the cost of harming users of old higher-quality code. It does not look right to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 11:28:34 2021 From: report at bugs.python.org (Soumendra Ganguly) Date: Tue, 05 Jan 2021 16:28:34 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1609864114.33.0.300373331672.issue41818@roundup.psfhosted.org> Soumendra Ganguly added the comment: Thank you for the fix. That test was created by modifying an existing test which already had that issue; it is documented in a comment by user nnorwitz in the file. If your solution resolves the problem for all the tests in "class PtyTest", then can you please also remove that comment? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 11:40:59 2021 From: report at bugs.python.org (James Oldfield) Date: Tue, 05 Jan 2021 16:40:59 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609864859.65.0.886771185809.issue39457@roundup.psfhosted.org> James Oldfield added the comment: > Yes if you are talking about SQLite, the database ENGINE I sure was! In this comment I will stick to saying either "SQLite engine" or "sqlite3 driver" as appropriate, hopefully that will be clearer. > But here I am talking about SQLite3, the Python database DRIVER Yep, I was aware of that. I was trying to say, please don't use the word "autocommit" in the sqlite3 driver when that word has a related but different meaning in the SQLite engine. > You do not issue BEGIN statements with database DRIVERS, they are issued implicitly, so that the manual mode is the default mode for database DRIVERS. This sentence isn't literally true for several reasons (you say "you do not" but I certainly do, you use of "with database drivers" is dubious, and you seem to have causality in the wrong direction). I think there might be a bit of a language barrier here, so I hope you don't mind if I leave this to one side. > Cf. this Stack Overflow answer for more details: https://stackoverflow.com/a/48391535/2326961 I am fully, and painfully, aware of when the sqlite3 driver code will automatically issue BEGIN statements to the engine. I have no need to read StackOverflow answers about it, I have read the C source code to sqlite3 (and pysqlite) directly. I spent more time than I care to admit recently doing that! In fact that happened as a result of reading several confusing StackOverflow answers about transactions (maybe I'll write my own and add to the confusion...) What that answer doesn't mention is that, even with even with isolation_mode=None, it's perfectly possible to start a transaction, which takes the SQLite engine out of autocommit mode. This is fully and intentionally supported by the sqlite3 driver, and the original author has said so and even recommended. For example, let's look at this code: conn = sqlite3.connect(path, isolation_mode=None) conn.execute("INSERT INTO test (i) VALUES (?)", (1,)) # stmt 1 foo = conn.execute("SELECT * FROM test").fetchall() # stmt 2 conn.execute("BEGIN") # stmt 3 conn.execute("INSERT INTO test (i) VALUES (?)", (4,)) # stmt 4 bar = conn.execute("SELECT * FROM test").fetchall() # stmt 5 conn.execute("COMMIT") # stmt 6 Statement 1 and statement 2 execute using the SQLite engine's autocommit mode. Statements 3 through to 5 execute in a single transaction and do *not* use the SQLite engine's autocommit mode. (Technically statement 6 actually does use autocommit because COMMIT uses the autocommit mechanism under the hood ... but let's forget about that!) Under your proposal, the first line would be changed to say "autocommit=True", even though not all the code below is in autocommit mode (according to the SQLite engine's definition). What's more, I could insert this line of code between statements 3 and 6: print("Autocommit mode?", conn.autocommit) And it would print True even though autocommit mode is off! Now, maybe your reaction is that "autocommit mode *in the driver*" can have a different meaning from "autocommit mode *in the engine*". Yes, it can, but that doesn't mean it should! Please, just pick a different name! For example, say "manual mode" (instead of autocommit=True) or "auto-start-transaction mode" (instead of autocommit=False). > No, you do not want that at the database DRIVER level. Because like Mike Bayer explained in issue #9924, this is not what other database DRIVERS do, and this is not PEP 249 compliant The "that" you are referring to here was when I said that I prefer to set isolation_level = None, like the above code snippet. Do not tell me that it is not what I want; it certainly IS what I want! I do not want the sqlite3 driver getting in the way between me and the SQLite engine. Many future users of the sqlite3 driver are likely to feel the same way, and the API should allow that to happen clearly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:06:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Jan 2021 17:06:18 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609866378.44.0.336535475485.issue36543@roundup.psfhosted.org> Christian Heimes added the comment: Apparently my defusedxml package is low-quality code... Anyhow PEP 387 has clear rules how to handle incompatible changes. Every core dev has to follow these rules. You cannot simply ignore the rule, because you don't like it. If you want to change the rules or get an exception for a special case, please open a discussion, lobby for an amendment to PEP 387, and get approval from the SC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:16:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 17:16:29 +0000 Subject: [issue42831] IDLE fix colours for MacOS dark mode In-Reply-To: <1609851294.14.0.191191657845.issue42831@roundup.psfhosted.org> Message-ID: <1609866989.49.0.0481752270692.issue42831@roundup.psfhosted.org> Terry J. Reedy added the comment: This might be related to #7949, about KDE/GTK dark themes. In general, IDLE only controls colors for Shell and editor windows, leaving dialogs to system default. This appears to be true for the settings and search dialogs. 'About' is unusual in having some colors specified. I had nothing to do with that. Would it work to just remove those specifications? Otherwise, every widget should specify both foreground and background color. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:25:16 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 05 Jan 2021 17:25:16 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1609864859.65.0.886771185809.issue39457@roundup.psfhosted.org> Message-ID: <1a4f9c52-61ba-cd43-7bc5-3dfa0c8062fa@egenix.com> Marc-Andre Lemburg added the comment: I think there's a bit of a misunderstanding here. When relying on a DB-API driver's transaction API, you are not allowed to issue separate transaction commands to the DB backend via the .execute() methods. You have to use conn.commit() and conn.rollback(). The DB-API wants drivers to have connections default to transactional behavior and implicitly start transactions when opening the connection as well as when ending one (via .commit() or .rollback()) - provided the backend does support transactions. It also suggests that a method may be used to set the transactional behavior. Now, historically, many drivers have not always used methods for this, but instead (or in addition) provide a property connection.autocommit to allow setting or querying the current state. Over time, this has become more or less a standard. Aside: This is a bit unfortunate, since users would not expect exceptions from such properties (e.g. network errors), but this where things have moved and it's hard to change. I guess the SQLite driver does not start a new transaction for SELECTs, since these are usually read-only, but don't know whether this still holds today (e.g. think of UDFs running INSERTs or UPDATEs). For the same reason, removing the SELECT "optimization" may cause a backwards incompatible change, which can be tricky to identify and cause corruption of data (in this case, data not written to the database, where it previously was written). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:30:19 2021 From: report at bugs.python.org (William Schwartz) Date: Tue, 05 Jan 2021 17:30:19 +0000 Subject: [issue42531] importlib.resources.path() raises TypeError for packages without __file__ In-Reply-To: <1606890702.39.0.177441013455.issue42531@roundup.psfhosted.org> Message-ID: <1609867819.22.0.249657071802.issue42531@roundup.psfhosted.org> William Schwartz added the comment: @jaraco Did you have any other questions after my comments in msg382423? Do you think you or someone else could review PR 23611? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:46:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Jan 2021 17:46:42 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1609868801.99.0.7809610661.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not understand what this discussion in a long-closed article is about. If you propose to add warning, I am against it. You are against removing the module. Well, the module will not be removed, the warning is no longer needed. The issue is closed. I do not propose to change the rule. I say that the procedure cannot be executed in this case, because it will cause more harm than benefit. If we cannot follow the procedure for removing module, we cannot remove that module. It is fine to me. If you want to change this, propose changes to the procedure, but it should be discussed not here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 12:55:57 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 05 Jan 2021 17:55:57 +0000 Subject: [issue42831] IDLE fix colours for MacOS dark mode In-Reply-To: <1609851294.14.0.191191657845.issue42831@roundup.psfhosted.org> Message-ID: <1609869357.72.0.864727031484.issue42831@roundup.psfhosted.org> E. Paine added the comment: I have also done a grep and believe the other affected parts from the user's perspective are the debugger (I haven't checked if Mark's version also suffers), the help dialog and hover tip (e.g. over the squeezer button). > Would it work to just remove those specifications? Almost certainly for the about dialog, though we would probably need to explicitly give the foreground colour for others (similar to what you did in PR 12262, I think) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 13:04:58 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 05 Jan 2021 18:04:58 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609869898.76.0.596674766427.issue39457@roundup.psfhosted.org> G?ry added the comment: @james.oldfield > What that answer doesn't mention is that, even with even with isolation_mode=None, it's perfectly possible to start a transaction, which takes the SQLite engine out of autocommit mode. Exactly, so since autocommit=True is equivalent to isolation_mode=None I do not see why you the name ?autocommit? would be a problem. As you said, when you issue BEGIN, you leave autocommit mode. > Under your proposal, the first line would be changed to say "autocommit=True", even though not all the code below is in autocommit mode (according to the SQLite engine's definition). What is the difference with isolation_mode=None which also means autocommit mode? > What's more, I could insert this line of code between statements 3 and 6: > print("Autocommit mode?", conn.autocommit) > And it would print True even though autocommit mode is off! No, because the autocommit property would be automatically updated to False at conn.execute("BEGIN"), which is the standard behaviour as @lemburg explained. @lemburg > I guess the SQLite driver does not start a new transaction for SELECTs, since these are usually read-only Nor for DDL statements (CREATE, DROP). > For the same reason, removing the SELECT "optimization" may cause > a backwards incompatible change, which can be tricky to identify > and cause corruption of data (in this case, data not written to > the database, where it previously was written). Since DQL statements (SELECT) are read-only, maybe we could keep the optimization and start transactions implicitly only for DDL statements (CREATE, DROP)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 13:12:00 2021 From: report at bugs.python.org (John Beeler) Date: Tue, 05 Jan 2021 18:12:00 +0000 Subject: [issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM In-Reply-To: <1569499511.98.0.234005447809.issue38285@roundup.psfhosted.org> Message-ID: <1609870320.38.0.366320054635.issue38285@roundup.psfhosted.org> John Beeler added the comment: For what it's worth, a library I use currently hacks in this functionality by accessing the private method _create_connection_transport directly. This is done to allow a SOCK_RAW to be passed (which is itself required to then enable asyncio to be used for handling BLE). This works, but as it requires the use of a private method, it's not ideal. ---------- nosy: +jbeeler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 13:41:01 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 05 Jan 2021 18:41:01 +0000 Subject: [issue42829] get_type_hints throws for nested class with __future__ annotations In-Reply-To: <1609845512.57.0.0433631135188.issue42829@roundup.psfhosted.org> Message-ID: <1609872061.76.0.147698277604.issue42829@roundup.psfhosted.org> Guido van Rossum added the comment: If you want this to work you have to pass the namespace where B is defined as locals to get_type_hint(). The recommended approach is to make B a global class; where that is not possible (as in your second example) you should chose a different name. We're not going to guess additional namespaces to add to the lookup, so I will close this as won't fix. PS. For short code snippets like your examples, I prefer pasting the code inline. ---------- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 13:42:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 05 Jan 2021 18:42:18 +0000 Subject: [issue42828] Python readline module In-Reply-To: <1609841941.92.0.341483279239.issue42828@roundup.psfhosted.org> Message-ID: <1609872138.7.0.919032366588.issue42828@roundup.psfhosted.org> Guido van Rossum added the comment: This should be discussed on a user forum, not in our bug tracker. ---------- nosy: +gvanrossum resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 13:58:08 2021 From: report at bugs.python.org (mike bayer) Date: Tue, 05 Jan 2021 18:58:08 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609873088.98.0.489133104494.issue39457@roundup.psfhosted.org> mike bayer added the comment: > Under your proposal, the first line would be changed to say "autocommit=True", even though not all the code below is in autocommit mode (according to the SQLite engine's definition). What's more, I could insert this line of code between statements 3 and 6: > print("Autocommit mode?", conn.autocommit) As Marc-Andre indicated, this is in fact how "autocommit" behaves on other drivers, including: psycopg2 - uses either connection.autocommit, or extensions.ISOLATION_LEVEL_AUTOCOMMIT pymysql - uses conn.autocommit(True|False) mysqldb - uses conn.autocommit(True|False) cx_Oracle - uses conn.autocommit pyodbc - uses conn.autocommit With all of the above drivers, one can emit "BEGIN" and "COMMIT" using connection.execute(), and within the scope of that BEGIN/COMMIT pair, the database "engine" itself is in a transaction. The "driver" however remains in "autocommit" mode. This mode specifically means the driver is not getting involved in starting and stopping transactions. As Marc mentions, we're not supposed to be emitting "BEGIN" and "COMMIT" on the driver, but none of them get in the way of us doing so, and additionally most databases support additional options for the "BEGIN/START TRANSACTION" phase that aren't available in the DBAPIs so sometimes we don't have much choice at least for the "BEGIN" command. Here's an example using psycopg2, where the timestamp now() will freeze when we're in a transaction started using manual "BEGIN"/ "COMMIT", while .autocommit stays True, and otherwise match statement execution time if we're not: >>> import psycopg2 >>> conn = psycopg2.connect(user="scott", password="tiger", host="localhost", database="test") >>> conn.autocommit = True >>> cursor = conn.cursor() >>> cursor.execute("SELECT 1") >>> cursor.execute("select now() = statement_timestamp()") >>> cursor.fetchall() [(True,)] >>> cursor.execute("BEGIN") >>> cursor.execute("select now() = statement_timestamp();") >>> cursor.fetchall() [(False,)] # we're in a transaction >>> conn.autocommit # still in driver-level autocommit True >>> cursor.execute("COMMIT") >>> cursor.execute("select now() = statement_timestamp();") >>> cursor.fetchall() [(True,)] For SQLAlchemy we already support pysqlite's "isolation_level=None" to implement "autocommit" so this issue does not affect us much, but the meaning of the term "autocommit" at the driver level shouldn't be controversial at this point as there's a lot of precedent. "connection.autocommit" does not refer to the current transactional state of the database, just the current preference set upon the driver itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 14:01:17 2021 From: report at bugs.python.org (izomiac) Date: Tue, 05 Jan 2021 19:01:17 +0000 Subject: [issue42498] smtplib is glitchy after receive server code 500 In-Reply-To: <1606627835.9.0.185077481862.issue42498@roundup.psfhosted.org> Message-ID: <1609873277.67.0.530531961814.issue42498@roundup.psfhosted.org> izomiac added the comment: I agree, it's my suspicion that the server's error message and python's outbound command are sent so close to each other that buffering ensures they disagree about the exact sequence of commands/responses. As for my server, it was HAProxy doing the injection and I rewrote the server to both ignore PROXY commands and to listen on multiple ports so a proxy is not necessary. So this issue no longer exists for me, but I know that I'm not the only one who uses HAProxy to forward SMTP requests (residential ISPs block port 25), and Python was relatively unique in its intolerance of this behavior. (Python uses lower case commands, which are easy to recognize on server logs to determine which clients are using it.) It's certainly not a critical issue affecting thousands, but in my experience glitchy behavior is a good indicator that the code is buggy in general. Plus, buffering errors scare me because there are so many potential security exploits associated with them (on top of being a pain to debug.) But, yeah, this is more of a courtesy bug to let you know about a tricky glitch I encountered. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 14:30:16 2021 From: report at bugs.python.org (=?utf-8?q?Malvers=C3=A1n?=) Date: Tue, 05 Jan 2021 19:30:16 +0000 Subject: [issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM In-Reply-To: <1569499511.98.0.234005447809.issue38285@roundup.psfhosted.org> Message-ID: <1609875016.92.0.902742591442.issue38285@roundup.psfhosted.org> Malvers?n added the comment: That means the core code also works for SOCK_RAW sockets. It's only limited by explicit socket type checks at a higher level. As a curious note (not related to the issue), I'm also using the SOCK_SEQPACKET connection created with BaseEventLoop to access a custom daemon related to BLE functionality. ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:03:09 2021 From: report at bugs.python.org (Marco Franzo) Date: Tue, 05 Jan 2021 20:03:09 +0000 Subject: [issue42828] Python readline module In-Reply-To: <1609841941.92.0.341483279239.issue42828@roundup.psfhosted.org> Message-ID: <1609876989.8.0.902247285674.issue42828@roundup.psfhosted.org> Marco Franzo added the comment: So, I use Ubuntu 20.10 and the terminal is the one distributed with the system. I think this problem born in my code here: def generate_input(): while True: str = input().strip() yield helloworld_pb2.Operazione(operazione = str) I think the string os.system('stty sane') it can be very useful for those who have the shell unusable at the end of the program. If i remove import readline, I no longer have any problems, but i need the features of readline ---------- Added file: https://bugs.python.org/file49722/io_console.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:17:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 20:17:12 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609877832.63.0.0593417140524.issue41798@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > I'm also in the process of removing PySocketModuleAPI from _ssl.c. BTW, do we still want to keep the socket CAPI for external users? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:21:14 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Jan 2021 20:21:14 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609878074.21.0.555978082654.issue41798@roundup.psfhosted.org> Christian Heimes added the comment: > BTW, do we still want to keep the socket CAPI for external users? Yes, at least for a while. socket.h is not part of the public include headers. It's still possible that the CAPI is used by an external project. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:24:01 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 05 Jan 2021 20:24:01 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609878241.56.0.483855160325.issue42827@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- pull_requests: +22954 pull_request: https://github.com/python/cpython/pull/24124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:46:04 2021 From: report at bugs.python.org (Klaus Ethgen) Date: Tue, 05 Jan 2021 20:46:04 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' In-Reply-To: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> Message-ID: <1609879564.98.0.489260020796.issue42818@roundup.psfhosted.org> Klaus Ethgen added the comment: I don't know if that is an issue with zipimporter or an issue with a version of setuptools. My knowledge of python is very limited. But from what I can see in the backtrace it is missing find_spec. How ever that reverting is or should be implemented, it seams to be obviously that it is not working. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 15:54:04 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 20:54:04 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609880044.68.0.918725351592.issue41837@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +22955 pull_request: https://github.com/python/cpython/pull/24125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 16:18:40 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 21:18:40 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609881520.48.0.380300864404.issue41798@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22956 pull_request: https://github.com/python/cpython/pull/24126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 16:20:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 21:20:39 +0000 Subject: [issue42746] python3.7.3 - ssl.SSLContext() - "Killed" In-Reply-To: <1608939379.31.0.291479274657.issue42746@roundup.psfhosted.org> Message-ID: <1609881639.71.0.105215737643.issue42746@roundup.psfhosted.org> Terry J. Reedy added the comment: 3.7.3 is an old release of an old version. It has already been patched a few times. If you cannot upgrade to at least the last bugfix release of 3.7, you are somewhat on your own. The word 'Killed' in not in the ssl module, so I presume it comes from the LibreSSL, which on your system is what is imported as _ssl. On Win 10, 'import ssl' prints nothing (normal for most imports) and ssl.SSLContext returns an instance of class SSLContext. You question would be better asked on a help forum, such as python-list or stackoverflow. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 16:23:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 05 Jan 2021 21:23:10 +0000 Subject: [issue42712] Segmentation fault in running ast.literal_eval() with large expression size. In-Reply-To: <1608632245.06.0.0184110305677.issue42712@roundup.psfhosted.org> Message-ID: <1609881790.83.0.568107295092.issue42712@roundup.psfhosted.org> Terry J. Reedy added the comment: I closed the following by Xinmeng as duplicates of this: #42713 eval(...) #42714 compile(...) #42715 exec(...) #42716 ast.parse(...) This is probably a duplicate of #42609, and should likely be closed also. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 16:35:11 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 21:35:11 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609882511.4.0.440018354165.issue41837@roundup.psfhosted.org> Steve Dower added the comment: New changeset afb71443788a7b20f9104243b3d8d37e3d12cfe2 by Steve Dower in branch 'master': bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i (GH-24125) https://github.com/python/cpython/commit/afb71443788a7b20f9104243b3d8d37e3d12cfe2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 16:42:09 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 21:42:09 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609882929.84.0.26469073467.issue41837@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +22957 pull_request: https://github.com/python/cpython/pull/24127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:02:13 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 22:02:13 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609884133.3.0.772146222641.issue42584@roundup.psfhosted.org> Steve Dower added the comment: New changeset dd74c01d3bd2833f72ffe400a1d10b8583c0ba6a by Erlend Egeberg Aasland in branch 'master': bpo-42584: Update Windows installer to use SQLite 3.34.0 (GH-23675) https://github.com/python/cpython/commit/dd74c01d3bd2833f72ffe400a1d10b8583c0ba6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:04:41 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 05 Jan 2021 22:04:41 +0000 Subject: [issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched In-Reply-To: <1575141041.2.0.751349559914.issue38946@roundup.psfhosted.org> Message-ID: <1609884281.82.0.445868928795.issue38946@roundup.psfhosted.org> Ned Deily added the comment: Thanks, Ronald and others. I have done some testing now with macOS 11 Big Sur and retested on 10.15 Catalina and with various versions of Tk and what I am seeing is as follows. - On macOS 11.1 Big Sur with IDLE.app from the python.org 3.9.1 universal2 installer set as the user default for .py files, double-clicking on a .py file causes IDLE 3.10 to launch and the .py file to open in an edit window as expected. Double-clicking on additional .py files in the Finder while IDLE is already launched does cause the files to be opened in the active IDLE.app also as expected. Performing the same sequence with the same 3.9.1 installer on macOS 10.15.7 Catalina, double-clicking on additional files do not cause them to be opened in the active IDLE.app as reported in this issue. - I also verified that the same behavior is seen with IDLE.app from a couple of other python.org installers, for example, 3.8.7: double-clicking on additional .py files does not cause them to be opened in an active IDLE.ap on 10.15.7 but does on 11.1. So, it looks like this really is an operating system (Launch Services?) issue in macOS 10.15 that has been changed/fixed in macOS 11. While there *might* be a way to programmatically workaround this within IDLE, Python, or Tk on 10.15, so far we haven't found one. And there is a fairly simple workaround on 10.15: just use the IDLE File -> Open menu item or keyboard shortcut (cmd-O). It's not as elegant if you are used to double-clicking but it works and realistically we are not going to see a change in 10.15 behavior from Apple. I would appreciate any other confirmations of this behavior or any ideas for a workaround. Barring the latter, I think we should probably just close this issue, unfortunately, as an OS bug. Now just to make things a bit more complicated - sigh: I also tested with the recent python.org installer for the 3.10.0a4 pre-release. The principal difference between the 3.9.1 and 3.10.0a4 versions I tested with is that the 3.9.1 is linked with Tk 8.6.10 while 3.10.0a4 is linked with the just-released Tk 8.6.11. On macOS 11 Big Sur, there is one noticeable difference in behavior between the two. With the macOS 11 Big Sur / 3.10.0a4 / 8.6.11 combo, when double-clicking on a .py file without IDLE.app being active, a message window appears saying that the application cannot open Python Script files but does launch IDLE.app. With IDLE.app now active, double-clicking again on the same file then does cause the file to be opened in an edit window of the active IDLE as expected and double-clicking on other .py files then open edit windows for them as expected. Without more detailed investigation, this appears to be a minor problem (possibly a change in Tk) unrelated to those in this issue other than that it involves double-clicking on .py files but I thought I should mention it here in case someone runs into it before it is resolved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:05:18 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 22:05:18 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609884318.53.0.969419292241.issue42584@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ned Deily, can you fix the macOS backports? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:06:43 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 22:06:43 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609884403.18.0.554055493937.issue41798@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22958 pull_request: https://github.com/python/cpython/pull/24128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:27:57 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 22:27:57 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609885677.75.0.760947054442.issue42584@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22959 pull_request: https://github.com/python/cpython/pull/24129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:30:15 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 22:30:15 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609885815.57.0.373712383641.issue42584@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22960 pull_request: https://github.com/python/cpython/pull/24130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:37:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 05 Jan 2021 22:37:12 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609886232.56.0.231040287552.issue42584@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Steve Dower, do you mind if I create backports for the Windows build as well? ---------- resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:46:44 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 05 Jan 2021 22:46:44 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609886804.92.0.548901007684.issue42584@roundup.psfhosted.org> miss-islington added the comment: New changeset f27451dc35f1c69be0c26e8aeafee7ba6771039a by Erlend Egeberg Aasland in branch '3.8': [3.8] bpo-42584: Update macOS installer to use SQLite 3.34.0 (GH-23674). (GH-24129) https://github.com/python/cpython/commit/f27451dc35f1c69be0c26e8aeafee7ba6771039a ---------- nosy: +miss-islington status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:48:22 2021 From: report at bugs.python.org (Andrew Brunner) Date: Tue, 05 Jan 2021 22:48:22 +0000 Subject: [issue22213] Make pyvenv style virtual environments easier to configure when embedding Python In-Reply-To: <1408275761.36.0.915361061447.issue22213@psf.upfronthosting.co.za> Message-ID: <1609886902.06.0.283135034985.issue22213@roundup.psfhosted.org> Change by Andrew Brunner : ---------- nosy: +abrunner73 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:53:12 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 05 Jan 2021 22:53:12 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609887192.08.0.174708916653.issue42584@roundup.psfhosted.org> miss-islington added the comment: New changeset e9a71dab094c0467f07d13cce4324c8a93727863 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-42584: Update macOS installer to use SQLite 3.34.0 (GH-23674) (GH-24130) https://github.com/python/cpython/commit/e9a71dab094c0467f07d13cce4324c8a93727863 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 17:58:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Jan 2021 22:58:00 +0000 Subject: [issue42746] python3.7.3 - ssl.SSLContext() - "Killed" In-Reply-To: <1608939379.31.0.291479274657.issue42746@roundup.psfhosted.org> Message-ID: <1609887480.45.0.123855540067.issue42746@roundup.psfhosted.org> Christian Heimes added the comment: What exactly happens when you try to instantiate an SSLContext() object? Does it just print the string "Killed" or does the process stop and segfault immediately? If it's a segfault then it is likely caused by an incompatibility between recent LibreSSL and old Python 3.7.3. Can you switch to OpenSSL? LibreSSL isn't well supported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 18:37:38 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 23:37:38 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609889858.33.0.995073092595.issue41837@roundup.psfhosted.org> Steve Dower added the comment: New changeset c8333931434389ae72da9eb0471054f4393249db by Steve Dower in branch '3.9': bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i (GH-24125) https://github.com/python/cpython/commit/c8333931434389ae72da9eb0471054f4393249db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 18:42:05 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 23:42:05 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609890125.98.0.512417597122.issue41837@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +22961 pull_request: https://github.com/python/cpython/pull/24131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 18:45:41 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 05 Jan 2021 23:45:41 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609890341.61.0.81479119353.issue42584@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +22962 pull_request: https://github.com/python/cpython/pull/24132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 18:53:31 2021 From: report at bugs.python.org (Michael L. Boom) Date: Tue, 05 Jan 2021 23:53:31 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x Message-ID: <1609890811.68.0.419297459642.issue42835@roundup.psfhosted.org> New submission from Michael L. Boom : When building libxml2 using Python 3.9.0 or Python 3.9.1 and gcc 10.2.0 I get the below error. Others are having this problem according to my Google search. make[4]: Entering directory '/local/users/michael.l.boom/gits/scoring_engine/git/aae_tmp_dir/libxml2-2.9.10/python' CC libxml.lo CC libxml2-py.lo CC types.lo In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/pytime.h:6, from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:85, from libxml_wrap.h:1, from types.c:9: types.c: In function ?libxml_xmlXPathObjectPtrConvert?: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/object.h:633:41: error: expected ?(? before ?PyType_HasFeature? 633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) | ^~~~~~~~~~~~~~~~~ /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/longobject.h:15:9: note: in expansion of macro ?PyType_FastSubclass? 15 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS) | ^~~~~~~~~~~~~~~~~~~ types.c:607:15: note: in expansion of macro ?PyLong_Check? 607 | } else if PyLong_Check(obj) { | ^~~~~~~~~~~~ types.c:607:33: error: expected ?;? before ?{? token 607 | } else if PyLong_Check(obj) { | ^ libxml.c: In function ?xmlPythonFileCloseRaw?: libxml.c:259:5: warning: ?PyEval_CallMethod? is deprecated [-Wdeprecated-declarations] 259 | ret = PyEval_CallMethod(file, (char *) "close", (char *) "()"); | ^~~ In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:145, from libxml.c:14: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/ceval.h:28:43: note: declared here 28 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( | ^~~~~~~~~~~~~~~~~ libxml.c: In function ?xmlPythonFileReadRaw?: libxml.c:289:5: warning: ?PyEval_CallMethod? is deprecated [-Wdeprecated-declarations] 289 | ret = PyEval_CallMethod(file, (char *) "read", (char *) "(i)", len); | ^~~ In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:145, from libxml.c:14: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/ceval.h:28:43: note: declared here 28 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( | ^~~~~~~~~~~~~~~~~ In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/pytime.h:6, from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:85, from libxml.c:14: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/object.h:633:41: error: expected ?(? before ?PyType_HasFeature? 633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) | ^~~~~~~~~~~~~~~~~ /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/unicodeobject.h:115:18: note: in expansion of macro ?PyType_FastSubclass? 115 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) | ^~~~~~~~~~~~~~~~~~~ libxml.c:297:15: note: in expansion of macro ?PyUnicode_Check? 297 | } else if PyUnicode_Check (ret) { | ^~~~~~~~~~~~~~~ libxml.c:297:37: error: expected ?;? before ?{? token 297 | } else if PyUnicode_Check (ret) { | ^ libxml.c: In function ?xmlPythonFileRead?: libxml.c:354:5: warning: ?PyEval_CallMethod? is deprecated [-Wdeprecated-declarations] 354 | ret = PyEval_CallMethod(file, (char *) "io_read", (char *) "(i)", len); | ^~~ In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:145, from libxml.c:14: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/ceval.h:28:43: note: declared here 28 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( | ^~~~~~~~~~~~~~~~~ In file included from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/pytime.h:6, from /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/Python.h:85, from libxml.c:14: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/object.h:633:41: error: expected ?(? before ?PyType_HasFeature? 633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) | ^~~~~~~~~~~~~~~~~ /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/unicodeobject.h:115:18: note: in expansion of macro ?PyType_FastSubclass? 115 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) | ^~~~~~~~~~~~~~~~~~~ libxml.c:362:15: note: in expansion of macro ?PyUnicode_Check? 362 | } else if PyUnicode_Check (ret) { | ^~~~~~~~~~~~~~~ libxml.c:362:37: error: expected ?;? before ?{? token 362 | } else if PyUnicode_Check (ret) { | ^ ---------- components: C API messages: 384443 nosy: boom0192 priority: normal severity: normal status: open title: Can't Built libxml2 When Using Python 3.9.x type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 18:57:52 2021 From: report at bugs.python.org (Berker Peksag) Date: Tue, 05 Jan 2021 23:57:52 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1609891072.02.0.672940912495.issue40956@roundup.psfhosted.org> Berker Peksag added the comment: New changeset c7f8d3caf0b10c19cd46b1b334a98628eac15672 by Erlend Egeberg Aasland in branch 'master': bpo-40956: Convert _sqlite3.Cursor to Argument Clinic (GH-24007) https://github.com/python/cpython/commit/c7f8d3caf0b10c19cd46b1b334a98628eac15672 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:02:50 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:02:50 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609891370.03.0.828564468067.issue40810@roundup.psfhosted.org> Berker Peksag added the comment: New changeset cf0b23908cc902ac38cd83dd7ca5afdf89e1543b by Erlend Egeberg Aasland in branch 'master': bpo-40810: Require SQLite 3.7.15 (GH-24106) https://github.com/python/cpython/commit/cf0b23908cc902ac38cd83dd7ca5afdf89e1543b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:04:50 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:04:50 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609891490.48.0.173797790008.issue40810@roundup.psfhosted.org> Berker Peksag added the comment: I think this is now done. Thank you, Erlend! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:05:08 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:05:08 +0000 Subject: [issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1 In-Reply-To: <1590688058.38.0.22519081316.issue40810@roundup.psfhosted.org> Message-ID: <1609891508.02.0.657389769579.issue40810@roundup.psfhosted.org> Change by Berker Peksag : ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:07:32 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 06 Jan 2021 00:07:32 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1609891652.77.0.646604945446.issue42811@roundup.psfhosted.org> Change by Brett Cannon : ---------- title: Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__ -> Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:07:40 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:07:40 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609891660.09.0.309928285931.issue42584@roundup.psfhosted.org> Steve Dower added the comment: > Steve Dower, do you mind if I create backports for the Windows build as well? Sorry, I've been doing it. They're just slow because I'm getting OpenSSL done at the same time and they both keep causing merge conflicts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:07:58 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:07:58 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609891678.51.0.829118325881.issue41837@roundup.psfhosted.org> Steve Dower added the comment: New changeset 86b1207dbb9201d1259d1ec7603e720e29ba9042 by Steve Dower in branch '3.8': bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i (GH-24125) https://github.com/python/cpython/commit/86b1207dbb9201d1259d1ec7603e720e29ba9042 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:09:15 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:09:15 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609891755.46.0.032262165962.issue42584@roundup.psfhosted.org> Steve Dower added the comment: New changeset 77d54710506b67e48b50bb1758fb31fc33a33c83 by Steve Dower in branch '3.9': bpo-42584: Update Windows installer to use SQLite 3.34.0 (GH-23675) https://github.com/python/cpython/commit/77d54710506b67e48b50bb1758fb31fc33a33c83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:10:38 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 06 Jan 2021 00:10:38 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609891838.08.0.798498531997.issue42584@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Sorry, I've been doing it. They're just slow because I'm getting OpenSSL done at the same time and they both keep causing merge conflicts. No problem. I noticed that, so I aborted my cherry-picker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:11:06 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 00:11:06 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609890811.68.0.419297459642.issue42835@roundup.psfhosted.org> Message-ID: <1609891866.99.0.788540092734.issue42835@roundup.psfhosted.org> Guido van Rossum added the comment: Have you approached the libxml2 developers with this problem? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:11:05 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:11:05 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609891865.27.0.792813127633.issue42584@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +22963 pull_request: https://github.com/python/cpython/pull/24133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:12:22 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:12:22 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1609891942.34.0.461082279179.issue41837@roundup.psfhosted.org> Steve Dower added the comment: I believe this is all done now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:18:54 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:18:54 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609892334.55.0.739787538409.issue38413@roundup.psfhosted.org> Berker Peksag added the comment: New changeset f9949f82e17c88609adb53eff3a7d5cd63a645bd by Vladimir in branch 'master': bpo-38413: Remove outdated section about multithreading in sqlite3 (GH-23159) https://github.com/python/cpython/commit/f9949f82e17c88609adb53eff3a7d5cd63a645bd ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:19:07 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 06 Jan 2021 00:19:07 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609892347.79.0.331858256243.issue38413@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +22964 pull_request: https://github.com/python/cpython/pull/24134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:22:05 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:22:05 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609892525.39.0.954844130287.issue38413@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 03a079f7cf8eacc29ea616060916e8a63ba6e5ba by Miss Islington (bot) in branch '3.8': bpo-38413: Remove outdated section about multithreading in sqlite3 (GH-23159) https://github.com/python/cpython/commit/03a079f7cf8eacc29ea616060916e8a63ba6e5ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:23:46 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:23:46 +0000 Subject: [issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs In-Reply-To: <1609056718.52.0.719197971794.issue42755@roundup.psfhosted.org> Message-ID: <1609892626.7.0.341969215698.issue42755@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 28611c28474a7fafdcf7ea2712f2670dda940eef by Miss Islington (bot) in branch '3.8': bpo-42755: Fix sqlite3.Connection.backup docs (GH-23965) https://github.com/python/cpython/commit/28611c28474a7fafdcf7ea2712f2670dda940eef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:27:24 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 06 Jan 2021 00:27:24 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1609892844.46.0.735359751443.issue40956@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22965 pull_request: https://github.com/python/cpython/pull/24135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:31:40 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:31:40 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609893100.38.0.10709440209.issue42584@roundup.psfhosted.org> Change by Steve Dower : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:31:20 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 06 Jan 2021 00:31:20 +0000 Subject: [issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0 In-Reply-To: <1607337382.55.0.591359272905.issue42584@roundup.psfhosted.org> Message-ID: <1609893080.01.0.114596800992.issue42584@roundup.psfhosted.org> Steve Dower added the comment: New changeset db91714faa6d3ede59003cdcc719a758160f3970 by Steve Dower in branch '3.8': bpo-42584: Update Windows installer to use SQLite 3.34.0 (GH-23675) https://github.com/python/cpython/commit/db91714faa6d3ede59003cdcc719a758160f3970 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:35:15 2021 From: report at bugs.python.org (Michael L. Boom) Date: Wed, 06 Jan 2021 00:35:15 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609891866.99.0.788540092734.issue42835@roundup.psfhosted.org> Message-ID: Michael L. Boom added the comment: I thought the problem was in a Python file. Perhaps I am mistaken. The libxml2 builds fine when using Python 3.8.x. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:36:12 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:36:12 +0000 Subject: [issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 In-Reply-To: <1434627103.24.0.34027869681.issue24464@psf.upfronthosting.co.za> Message-ID: <1609893372.35.0.82337982183.issue24464@roundup.psfhosted.org> Berker Peksag added the comment: New changeset ddb5e11683c8db9d2095f2f9406701443c4dc9b3 by Erlend Egeberg Aasland in branch 'master': bpo-24464: Deprecate sqlite3.enable_shared_cache (GH-24008) https://github.com/python/cpython/commit/ddb5e11683c8db9d2095f2f9406701443c4dc9b3 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:37:33 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:37:33 +0000 Subject: [issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 In-Reply-To: <1434627103.24.0.34027869681.issue24464@psf.upfronthosting.co.za> Message-ID: <1609893453.19.0.991049250459.issue24464@roundup.psfhosted.org> Berker Peksag added the comment: It's now deprecated in 3.10. ---------- components: +Extension Modules -Build, macOS resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:39:23 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:39:23 +0000 Subject: [issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 In-Reply-To: <1434627103.24.0.34027869681.issue24464@psf.upfronthosting.co.za> Message-ID: <1609893563.8.0.590008925863.issue24464@roundup.psfhosted.org> Change by Berker Peksag : ---------- components: +macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:55:46 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 00:55:46 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609890811.68.0.419297459642.issue42835@roundup.psfhosted.org> Message-ID: <1609894546.81.0.780048476634.issue42835@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe libxml is using a deprecated API or an invalid combination of command line flags. I don't feel like debugging this until there's a clearer indication of who's at fault. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:56:08 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:56:08 +0000 Subject: [issue40959] Remove unused and unneeded function declaration from sqlite3 header files In-Reply-To: <1591960917.09.0.191201794303.issue40959@roundup.psfhosted.org> Message-ID: <1609894568.24.0.792133548368.issue40959@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 203b2493ae6fd7c1f039f3f906f087d67d9100d5 by Erlend Egeberg Aasland in branch 'master': bpo-40959: Remove unused declarations from sqlite3 headers (GH-20828) https://github.com/python/cpython/commit/203b2493ae6fd7c1f039f3f906f087d67d9100d5 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 19:56:35 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 00:56:35 +0000 Subject: [issue40959] Remove unused and unneeded function declaration from sqlite3 header files In-Reply-To: <1591960917.09.0.191201794303.issue40959@roundup.psfhosted.org> Message-ID: <1609894595.19.0.350702198645.issue40959@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 20:09:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 01:09:02 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609895342.32.0.869287813493.issue42115@roundup.psfhosted.org> Guido van Rossum added the comment: I've skimmed several papers by Stefan Brunthaler about something called Quickening that I first found via the Pyston blog, which linked to an ancient bpo issue with a patch created by Stefan (https://bugs.python.org/issue14757). The gist seems to be to have extra opcodes that only work for certain situations (e.g. INT_BINARY_ADD). In a hot function we can rewrite opcodes with their specialized counterpart. The new opcode contains a guard that rewrites itself back if the guard fails (and then it stays unoptimized). I think the idea is that it's pretty cheap to keep an extra pointer to a "alternate bytecode" array. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 21:14:48 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 02:14:48 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1609899288.78.0.910107017865.issue14014@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 1a9f51ed12feb4d95ad6d0faf610a030c05b9f5e by Berker Peksag in branch 'master': bpo-14014: Clarify StreamWriter.reset() documentation (GH-13716) https://github.com/python/cpython/commit/1a9f51ed12feb4d95ad6d0faf610a030c05b9f5e ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 21:14:57 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 06 Jan 2021 02:14:57 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1609899297.58.0.412900932812.issue14014@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +22966 pull_request: https://github.com/python/cpython/pull/24136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 21:27:38 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 02:27:38 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1609900058.71.0.452594567009.issue14014@roundup.psfhosted.org> Berker Peksag added the comment: New changeset a3ca6747f50efa2fe59caf516a26b0fd1912b8e8 by Miss Islington (bot) in branch '3.9': bpo-14014: Clarify StreamWriter.reset() documentation (GH-13716) https://github.com/python/cpython/commit/a3ca6747f50efa2fe59caf516a26b0fd1912b8e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 21:28:46 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 02:28:46 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1609900126.8.0.0181699898158.issue14014@roundup.psfhosted.org> Change by Berker Peksag : ---------- assignee: lemburg -> components: +Documentation nosy: +vstinner resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 21:29:17 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 02:29:17 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1609900157.33.0.00639828659119.issue14014@roundup.psfhosted.org> Change by Berker Peksag : ---------- assignee: -> docs at python components: -Unicode nosy: +docs at python -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 22:42:49 2021 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 06 Jan 2021 03:42:49 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609904569.95.0.504487689895.issue42115@roundup.psfhosted.org> Yury Selivanov added the comment: > The gist seems to be to have extra opcodes that only work for certain situations (e.g. INT_BINARY_ADD). In a hot function we can rewrite opcodes with their specialized counterpart. The new opcode contains a guard that rewrites itself back if the guard fails (and then it stays unoptimized). This is also roughly what I suggested in https://bugs.python.org/msg379333. Except that I don't think it's necessary to add new opcodes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 23:21:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 06 Jan 2021 04:21:58 +0000 Subject: [issue42712] Segmentation fault in running ast.literal_eval() with large expression size. In-Reply-To: <1608632245.06.0.0184110305677.issue42712@roundup.psfhosted.org> Message-ID: <1609906918.13.0.834369774663.issue42712@roundup.psfhosted.org> Raymond Hettinger added the comment: I think we really need a customer parser for ast.literal_eval(), one that doesn't have the same constraints and that can be counted on for safe evaluation of untrusted input. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 23:41:22 2021 From: report at bugs.python.org (Michael L. Boom) Date: Wed, 06 Jan 2021 04:41:22 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609894546.81.0.780048476634.issue42835@roundup.psfhosted.org> Message-ID: Michael L. Boom added the comment: The gcc 10.x thinks that the right side of the expression on incoude/python3.9/object.h should be in parentheses. It seems like a Python bug. Perhaps earlier versions of gcc didn't have a problem with this. /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/object.h:633:41: error: expected ?(? before ?PyType_HasFeature? 633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 5 23:52:51 2021 From: report at bugs.python.org (David Justo) Date: Wed, 06 Jan 2021 04:52:51 +0000 Subject: [issue30044] shutil.copystat should (allow to) copy ownership, and other attributes In-Reply-To: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za> Message-ID: <1609908771.09.0.395204050157.issue30044@roundup.psfhosted.org> David Justo added the comment: Hi folks, I'd be interested in contributing to this issue, since it seems "easy" enough, but I'm unsure that consensus was reached about the right solution. >From what I gathered from Giampaolo's comments, we have solutions that should work for Unix-y systems and MacOS. So that's clear. For Windows though, I'm unsure. It appears, we'd need kernel-mode-enabled clients to do this and maybe that's enough to discourage this effort altogether. So it appears we have 3 options then: 1. Implement a new function that copies ownership in linux+mac but not in Windows. Then to document that difference. 2. Implement a new function that copies ownership in linux+mac, then use the native NT API to achieve the same result in Windows. Document the limitations 3. Just document the existing limitations. Do we have a preference? I do not, just excited to potentially contribute something :) Thanks! ---------- nosy: +davidmrdavid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 00:03:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 05:03:37 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609909417.02.0.398733681133.issue42115@roundup.psfhosted.org> Guido van Rossum added the comment: Do we have good intuition or data about which operations need speeding up most? Everybody always assumes it's BINARY_ADD, but much Python code isn't actually numeric, and binary operations aren't all that common. (For example, IIRC at my previous employer the hottest code was some kind of web template expansion and another bottleneck was marshalling RPC requests and results.) Optimizers usually evolve to be excellent at optimizing the benchmark du jour -- what benchmark do we want to use? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 00:18:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 05:18:02 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609890811.68.0.419297459642.issue42835@roundup.psfhosted.org> Message-ID: <1609910282.37.0.176761686165.issue42835@roundup.psfhosted.org> Guido van Rossum added the comment: Looks to me like this line is at fault: 607 | } else if PyLong_Check(obj) { That's not valid C. In the GitHub mirror this line has been corrected. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 00:20:36 2021 From: report at bugs.python.org (David Justo) Date: Wed, 06 Jan 2021 05:20:36 +0000 Subject: [issue34451] docs: tutorial/introduction doesn't mention toggle of prompts In-Reply-To: <1534877418.64.0.56676864532.issue34451@psf.upfronthosting.co.za> Message-ID: <1609910436.32.0.688537902323.issue34451@roundup.psfhosted.org> David Justo added the comment: Hi folks! I'm interested in contributing to this issue, but I'm unsure about the context. Can `>>>>` prompts be toggled on-and-off in the docs? I do not see that option. I read that this is possible in javascript-enabled versions of the site, but isn't that the default? If so, I have JS enabled and I do not see how to toggle them out :) . Maybe that's part of what we need to fix as well. Thanks for your time! ---------- nosy: +davidmrdavid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 00:29:59 2021 From: report at bugs.python.org (Michael L. Boom) Date: Wed, 06 Jan 2021 05:29:59 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609910282.37.0.176761686165.issue42835@roundup.psfhosted.org> Message-ID: Michael L. Boom added the comment: The gcc 10.x seems to think this is also a bug: /local/users/michael.l.boom/gits/scoring_engine/git/aae_build_python_3.9.1/include/python3.9/object.h:633:41: error: expected ?(? before ?PyType_HasFeature? 633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 00:34:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 05:34:58 +0000 Subject: [issue42835] Can't Built libxml2 When Using Python 3.9.x In-Reply-To: <1609890811.68.0.419297459642.issue42835@roundup.psfhosted.org> Message-ID: <1609911298.81.0.384967095808.issue42835@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 01:17:03 2021 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 06 Jan 2021 06:17:03 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609913823.25.0.577199608269.issue42115@roundup.psfhosted.org> Yury Selivanov added the comment: > Do we have good intuition or data about which operations need speeding up most? Everybody always assumes it's BINARY_ADD, but much Python code isn't actually numeric, and binary operations aren't all that common. IMO, we shouldn't focus too much on optimizing binops. Regular webapps/network kind of code wouldn't benefit from that, and scientific code that uses numpy/ml libraries already offsets most of expensive computation to outside of CPython eval. Instead, I think, we should continue focusing on lowering the cost of function/method calls and attribute access. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 01:29:26 2021 From: report at bugs.python.org (Ammar Askar) Date: Wed, 06 Jan 2021 06:29:26 +0000 Subject: [issue42825] Build libraries with "/OPT:REF" linker optimization on Windows In-Reply-To: <1609782160.13.0.0224895080942.issue42825@roundup.psfhosted.org> Message-ID: <1609914566.89.0.353043438888.issue42825@roundup.psfhosted.org> Change by Ammar Askar : ---------- nosy: +eryksun title: Optimization opportunity on Windows -> Build libraries with "/OPT:REF" linker optimization on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 01:46:27 2021 From: report at bugs.python.org (Ezio Melotti) Date: Wed, 06 Jan 2021 06:46:27 +0000 Subject: [issue42821] HTMLParser: subsequent duplicate attributes should be ignored In-Reply-To: <1609747254.8.0.505282394857.issue42821@roundup.psfhosted.org> Message-ID: <1609915587.98.0.579924133337.issue42821@roundup.psfhosted.org> Ezio Melotti added the comment: If we follow the behavior of the browser, we will have to pick one of the two values and discard the other, making this value unaccessible. If we provide both, scripts and libraries that use HTMLParser will have access to both and can decide what to do. For example BeautifulSoup already does the right thing: >>> bs4.BeautifulSoup('
text
')
text
Changing this might also break code that rely on this behavior. I'm therefore going to close this as "not a bug". ---------- assignee: -> ezio.melotti nosy: +ezio.melotti resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:05:31 2021 From: report at bugs.python.org (Sandeep Subramanian) Date: Wed, 06 Jan 2021 09:05:31 +0000 Subject: [issue42836] docs: struct: clarify struct caching behaviour Message-ID: <1609923931.89.0.0226570295473.issue42836@roundup.psfhosted.org> New submission from Sandeep Subramanian : As per docs in :https://docs.python.org/3.7/library/struct.html#struct.Struct > The compiled versions of the most recent format strings passed to Struct and the module-level functions are cached, so programs that use only a few format strings needn?t worry about reusing a single Struct instance. This statement seems to imply that the format string passed as `struct.Struct(format)` is also cached. This doesn't appear to be the case. Only format strings passed to the module level functions seems to be cached. `cache_struct_converter` at https://github.com/python/cpython/blob/v3.7.7/Modules/_struct.c#L2052 appears to be used only in the top module level functions `pack` and `pack_into` and is *not* used in `Struct.__init__`. Would it be better to change the doc to: > The compiled versions of the most recent format strings passed to the module-level functions are cached, so programs that use only a few format strings needn?t worry about reusing a single Struct instance. This issue was introduced by https://github.com/python/cpython/commit/3666b3c1f695a145adab1bf644c22e564e8eb0ee and is present in every version since. Refs: https://github.com/python/cpython/pull/7700 https://bugs.python.org/issue33032 ---------- assignee: docs at python components: Documentation messages: 384476 nosy: docs at python, sandeep2 priority: normal severity: normal status: open title: docs: struct: clarify struct caching behaviour type: enhancement versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:13:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 09:13:10 +0000 Subject: [issue32381] Python 3.6 cannot reopen .pyc file with non-ASCII path In-Reply-To: <1513750045.01.0.213398074469.issue32381@psf.upfronthosting.co.za> Message-ID: <1609924390.22.0.802170586045.issue32381@roundup.psfhosted.org> STINNER Victor added the comment: boost-python was using the removed private _Py_fopen() function, I proposed https://github.com/boostorg/python/pull/344 to replace _Py_fopen() with fopen(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:35:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 09:35:43 +0000 Subject: [issue42164] Python fails to compile in the Fedora Stable LTO buildbots In-Reply-To: <1603751687.99.0.243163164232.issue42164@roundup.psfhosted.org> Message-ID: <1609925743.55.0.925719417443.issue42164@roundup.psfhosted.org> STINNER Victor added the comment: Buildbots are back to green. It seems like the bug is gone with "gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)". ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:45:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 06 Jan 2021 09:45:38 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1609926338.86.0.402662085726.issue31951@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> curses for win32 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:51:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 09:51:20 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation Message-ID: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> New submission from Mark Shannon : This is an internal inconsistency. I have not identified any surface level bugs, but it is a trap for future compiler work. ---------- assignee: Mark.Shannon messages: 384479 nosy: Mark.Shannon, larry priority: normal severity: normal status: open title: Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 04:59:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 06 Jan 2021 09:59:23 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609927163.58.0.0290342122837.issue42837@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a duplicate of issue42725. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> PEP 563: Should the behavior change for yield/yield from's _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:04:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 06 Jan 2021 10:04:16 +0000 Subject: [issue39508] no module curses error although i downloaded the module - windows 10 In-Reply-To: <1580482082.1.0.922196738704.issue39508@roundup.psfhosted.org> Message-ID: <1609927456.77.0.543533865041.issue39508@roundup.psfhosted.org> Serhiy Storchaka added the comment: The curses module is not supported on Windows. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> curses for win32 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:05:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 10:05:22 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609927522.28.0.327175527496.issue42837@roundup.psfhosted.org> Mark Shannon added the comment: No this is not a duplicate. This is about making the symbol table correct for current semantics. #42725 is about changing the behavior ---------- resolution: duplicate -> status: closed -> open superseder: PEP 563: Should the behavior change for yield/yield from's -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:12:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 10:12:29 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1609927949.36.0.351784409369.issue42725@roundup.psfhosted.org> Mark Shannon added the comment: I've also opened #42837 which is about fixing the symbol table, so that it is correct w.r.t. to current behavior. I'd like to fix it ASAP as the compiler should be able to rely on the symbol table being correct. Of course, once we have decided what the behavior should be, then it may need to be updated again. I'm inclined to agree that 'yield' in an annotation should probably be a syntax error, but I haven't put much thought into to. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:15:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 10:15:28 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609928128.25.0.149781114829.issue42837@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +22967 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/24138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:32:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 06 Jan 2021 10:32:26 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609929146.6.0.940880833983.issue42837@roundup.psfhosted.org> Serhiy Storchaka added the comment: Does not it change the current behavior? I do not see a difference with issue42725. >>> def f(): ... x: (yield) ... >>> f() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:46:25 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 06 Jan 2021 10:46:25 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1609869898.76.0.596674766427.issue39457@roundup.psfhosted.org> Message-ID: <027c430d-a092-7751-46ce-2029b5d3aeb4@egenix.com> Marc-Andre Lemburg added the comment: On 05.01.2021 19:04, G?ry wrote: > > @lemburg > >> I guess the SQLite driver does not start a new transaction for SELECTs, since these are usually read-only > > Nor for DDL statements (CREATE, DROP). Those are definitely changing the database and AFAIK SQLite does support DDLs in transactions (including rolling them back if needed). Looking at the _sqlite code, the module does indeed only start a transaction for INSERT, UPDATE, DELETE and REPLACE, with "starting a transaction" meaning that it inserts a "BEGIN" (or one of the txn isolation alternatives) before the statement: https://github.com/python/cpython/blob/3.9/Modules/_sqlite/cursor.c#L489 This is also documented: https://docs.python.org/3/library/sqlite3.html#controlling-transactions I wonder why the module does not implement this properly, but I also believe it's too late to change. I guess what could be done is to add a connection.autocommit, defaulting to None, meaning "use the pre-3.10 behavior". If this is set to False, the module could then implement the correct way of handling transactions, which means: a) start a new transaction when the connection is opened b) start a new transaction after .commit() and .rollback() c) don't start new transactions anywhere else d) run an implicit .rollback() when the connection closes The code could even check for "BEGIN", "ROLLBACK" and "COMMIT" text in the .execute() and issues a warning when connection.autocommit is set to True or False. When set to True, the module would set the SQLite autocommit flag and also issues warnings for the txn statements. .rollback() would issue an exception and .commit() pass silently. >> For the same reason, removing the SELECT "optimization" may cause >> a backwards incompatible change, which can be tricky to identify >> and cause corruption of data (in this case, data not written to >> the database, where it previously was written). > > Since DQL statements (SELECT) are read-only, maybe we could keep the optimization and start transactions implicitly only for DDL statements (CREATE, DROP)? See https://sqlite.org/c3ref/stmt_readonly.html. SELECT are usually read-only, but not always. Since SQLite does support UDFs (user defined functions), it is possible that a call to such a function does change the database. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:53:10 2021 From: report at bugs.python.org (Richard Neumann) Date: Wed, 06 Jan 2021 10:53:10 +0000 Subject: [issue42765] Introduce new data model method __iter_items__ In-Reply-To: <1609169200.88.0.326770807054.issue42765@roundup.psfhosted.org> Message-ID: <1609930390.5.0.321275372635.issue42765@roundup.psfhosted.org> Richard Neumann added the comment: Thank you all for your input. I had a look at aforementioned discussion and learned something new. So I tried to implement the dict data model by implementing keys() and __getitem__() accordingly: from typing import NamedTuple class Spamm(NamedTuple): foo: int bar: str def __getitem__(self, item): if isinstance(item, str): try: return getattr(self, item) except AttributeError: raise KeyError(item) from None return super().__getitem__(item) def keys(self): yield 'foo' yield 'bar' def main(): spamm = Spamm(12, 'hello') print(spamm.__getitem__) print(spamm.__getitem__(1)) d = dict(spamm) if __name__ == '__main__': main() Unfortunately this will result in an error: Traceback (most recent call last): File "/home/neumann/test.py", line 4, in class Spamm(NamedTuple): RuntimeError: __class__ not set defining 'Spamm' as . Was __classcell__ propagated to type.__new__? Which seems to be caused by the __getitem__ implementation. I found a corresponding issue here: https://bugs.python.org/issue41629 Can I assume, that this is a pending bug and thusly I cannot implement the desired behaviour until a fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:55:33 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 06 Jan 2021 10:55:33 +0000 Subject: [issue42541] Tkinter colours wrong on MacOS universal2 In-Reply-To: <1606920595.63.0.665509072103.issue42541@roundup.psfhosted.org> Message-ID: <1609930533.19.0.459006345795.issue42541@roundup.psfhosted.org> E. Paine added the comment: This does not appear to be a problem anymore on Tk 8.6.11 so I think this issue can be closed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 05:58:49 2021 From: report at bugs.python.org (Richard Neumann) Date: Wed, 06 Jan 2021 10:58:49 +0000 Subject: [issue42765] Introduce new data model method __iter_items__ In-Reply-To: <1609169200.88.0.326770807054.issue42765@roundup.psfhosted.org> Message-ID: <1609930729.04.0.0414635678077.issue42765@roundup.psfhosted.org> Richard Neumann added the comment: Okay, I found the solution. Not using super() works: from typing import NamedTuple class Spamm(NamedTuple): foo: int bar: str def __getitem__(self, index_or_key): if isinstance(index_or_key, str): try: return getattr(self, index_or_key) except AttributeError: raise KeyError(index_or_key) from None return tuple.__getitem__(self, index_or_key) def keys(self): yield 'foo' yield 'bar' def main(): spamm = Spamm(12, 'hello') print(spamm.__getitem__) print(spamm.__getitem__(1)) d = dict(spamm) print(d) if __name__ == '__main__': main() Result: hello {'foo': 12, 'bar': 'hello'} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:00:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 11:00:10 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609930810.67.0.84701724777.issue42837@roundup.psfhosted.org> Mark Shannon added the comment: The aim is to change the behavior of the symbol table to match the compiler. The behavior has already changed at module scope. Python 3.9.0+ >>> x:(yield None) File "", line 1 SyntaxError: 'yield' outside function >>> Python 3.10.0a4+ >>> x:(yield None) >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:25:59 2021 From: report at bugs.python.org (Richard Neumann) Date: Wed, 06 Jan 2021 11:25:59 +0000 Subject: [issue41629] __class__ not set defining 'X' as In-Reply-To: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> Message-ID: <1609932359.6.0.384727611958.issue41629@roundup.psfhosted.org> Richard Neumann added the comment: I just stumbled across this issue trying to resolve this: https://bugs.python.org/issue42765? While this fails: from typing import NamedTuple class Spamm(NamedTuple): foo: int bar: str def __getitem__(self, index_or_key): """Returns the respective item.""" if isinstance(index_or_key, str): try: return getattr(self, index_or_key) except AttributeError: raise IndexError(index_or_key) from None return super().__getitem__(index_or_key) def keys(self): return self._fields def main(): spamm = Spamm(12, 'hello') print(dir(spamm)) print(spamm._fields) d = dict(spamm) print(d) if __name__ == '__main__': main() with Traceback (most recent call last): File "/home/neumann/test.py", line 4, in class Spamm(NamedTuple): RuntimeError: __class__ not set defining 'Spamm' as . Was __classcell__ propagated to type.__new__? The following works: from typing import NamedTuple def _getitem(instance, index_or_key): """Returns the respective item.""" if isinstance(index_or_key, str): try: return getattr(instance, index_or_key) except AttributeError: raise IndexError(index_or_key) from None return super().__getitem__(index_or_key) def dicttuple(cls: tuple): """Extends a tuple class with methods for the dict constructor.""" cls.keys = lambda self: self._fields cls.__getitem__ = _getitem return cls @dicttuple class Spamm(NamedTuple): foo: int bar: str def main(): spamm = Spamm(12, 'hello') print(dir(spamm)) print(spamm._fields) d = dict(spamm) print(d) if __name__ == '__main__': main() And produces: ['__add__', '__annotations__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__mul__', '__ne__', '__new__', '__orig_bases__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_asdict', '_field_defaults', '_fields', '_make', '_replace', 'bar', 'count', 'foo', 'index', 'keys'] ('foo', 'bar') {'foo': 12, 'bar': 'hello'} I am a bit baffled, why it works when the method is injected via a decorator. ---------- nosy: +conqp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:29:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 06 Jan 2021 11:29:05 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609932545.38.0.378628832164.issue42837@roundup.psfhosted.org> Serhiy Storchaka added the comment: Then why not fix the compiler? As I understand, it is not clear yet what behavior should be, and discussing it is the matter of issue42725. Any changes before the decision be made are preliminary. It is very likely that the decision will be in favor of ignoring annotations. In that case your PR or even more radical changes can be merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:32:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 11:32:07 +0000 Subject: [issue42681] Incorrect range checks/documentation in curses In-Reply-To: <1608339537.48.0.496910027234.issue42681@roundup.psfhosted.org> Message-ID: <1609932727.76.0.955982892537.issue42681@roundup.psfhosted.org> STINNER Victor added the comment: Great work, thank you Serhiy! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:38:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 11:38:55 +0000 Subject: [issue42528] Improve the docs of most Py*_Check{,Exact} API calls In-Reply-To: <1606841265.25.0.130640674128.issue42528@roundup.psfhosted.org> Message-ID: <1609933135.1.0.148646081662.issue42528@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 315fc52db17b19fe30aa9193f26adf69e18d8844 by Antonio Cuni in branch 'master': bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602) https://github.com/python/cpython/commit/315fc52db17b19fe30aa9193f26adf69e18d8844 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 06:47:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 11:47:31 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609933651.61.0.0499059002606.issue41798@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fe9f446afe46bd716592eda9fa2af8d9f46bbce4 by Erlend Egeberg Aasland in branch 'master': bpo-41798: Allocate _decimal extension module C API on the heap (GH-24117) https://github.com/python/cpython/commit/fe9f446afe46bd716592eda9fa2af8d9f46bbce4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:03:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 12:03:37 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609934617.05.0.649147369727.issue42837@roundup.psfhosted.org> Mark Shannon added the comment: OK, I won't merge anything yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:05:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 12:05:31 +0000 Subject: [issue22213] Make pyvenv style virtual environments easier to configure when embedding Python In-Reply-To: <1408275761.36.0.915361061447.issue22213@psf.upfronthosting.co.za> Message-ID: <1609934731.8.0.874255774262.issue22213@roundup.psfhosted.org> STINNER Victor added the comment: See also "Configure Python initialization (PyConfig) in Python" https://mail.python.org/archives/list/python-dev at python.org/thread/HQNFTXOCDD5ROIQTDXPVMA74LMCDZUKH/#X45X2K4PICTDJQYK3YPRPR22IGT2CDXB And bpo-42260: [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:08:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 06 Jan 2021 12:08:23 +0000 Subject: [issue42528] Improve the docs of most Py*_Check{,Exact} API calls In-Reply-To: <1606841265.25.0.130640674128.issue42528@roundup.psfhosted.org> Message-ID: <1609934903.03.0.729596530633.issue42528@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +22968 pull_request: https://github.com/python/cpython/pull/24139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:32:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 06 Jan 2021 12:32:34 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609936354.75.0.495167328295.issue42115@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I subscribe that but is also a matter of what are the optimizations with higher ratio impact/(cost+complexity). Caching the function pointers on binary operations or (better IMHO) comparisons is likely a good candidate ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:53:38 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 06 Jan 2021 12:53:38 +0000 Subject: [issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed In-Reply-To: <1609793289.79.0.762652539307.issue42827@roundup.psfhosted.org> Message-ID: <1609937618.53.0.55023426597.issue42827@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- pull_requests: +22969 pull_request: https://github.com/python/cpython/pull/24140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 07:54:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 12:54:26 +0000 Subject: [issue42528] Improve the docs of most Py*_Check{,Exact} API calls In-Reply-To: <1606841265.25.0.130640674128.issue42528@roundup.psfhosted.org> Message-ID: <1609937666.29.0.665051304394.issue42528@roundup.psfhosted.org> STINNER Victor added the comment: New changeset faf49573963921033c608b4d2f398309d9f0d2b5 by Miss Islington (bot) in branch '3.9': bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602) (GH-24139) https://github.com/python/cpython/commit/faf49573963921033c608b4d2f398309d9f0d2b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 08:05:28 2021 From: report at bugs.python.org (James Oldfield) Date: Wed, 06 Jan 2021 13:05:28 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609938328.96.0.542328422411.issue39457@roundup.psfhosted.org> James Oldfield added the comment: There's some confusion here over what autocommit=True would do. I believe the last three comments give three different interpretations! G?ry said conn.autocommit would change to False when I start a transaction with execute("BEGIN"), Mike said it wouldn't (because it represents the driver's state, not the engine's, by analogy with other DB API drivers), and Marc-Andre says execute("BEGIN") wouldn't be allowed in the first place (or at least it would issue a warning). To reiterate, the ability to control transactions manually is already supported in the sqlite3 driver, in the form of isolation_mode=None. My first request is simply that **this ability continues to exist**. This functionality was implemented deliberately - the original author of pysqlite recommended this usage, and care has been taken over the years not to break it. Please do not point out that this is not DB API compliant; I know that, and I just don't care! So long as DB API compliant usage is _also_ supported, even the default, that doesn't prevent this other mode from existing too. Many others are using the mode, even if they are not commenters here, so I don't believe it is feasible to break or remove this functionality, even if you're not a fan. My second request was: feel free to rename this option from "isolation_mode=None" to something else if you wish, but please don't call it "autocommit=True" because that's just too confusing. I feel like the confusion in the comments above justifies this point of view. As I see it, that leaves two options: Option 1: Suck it up and use autocommit=True as the option name. It's confusing, but there's so much precedent that it has to be so. This is Mike Bayer's suggestion (except he didn't say it was confusing, that's just my commentary). I think that this option is only feasible if conn.autocommit only refer's the driver's state, not the underlying engine's state, confusing though that is i.e. once set to true it would *always* be true, even if a transaction is started. Option 2: Reserve autocommit=True for the underlying SQLite engine autocommit mode. That means detecting when there's an attempt to use execute("BEGIN") or similar, and then issuing a warning or error. It also means supplying some other, third, option for what I'm asking (like today's isolation_mode=None). Although option 2 is closer to what I originally requested, I do worry it means that the non-DBAPI mode will appear unsupported and fall into neglect. If the API for accessing it is to set autocommit=None, to mean legacy behaviour, and then also isolation_mode=None to mean the type of legacy behaviour, then it doesn't look like the most recommended API ever. And yet, for those that don't care about DB API (which I imagine is most users of the sqlite3 driver), this is probably the best API to use. So I reluctantly agree that option 1, using autocommit=True, is actually best overall. I would ask that there is at least a note in the documentation so that it's clear this is allowed to work. Something like this: If autocommit=True then the sqlite3 module will never automatically start transactions. The underlying SQLite database engine operates in autocommit mode whenever no transactions are active, so the net effect of this is to use SQLite's autocommit mode [1]. Note that, when autocommit=True, the sqlite3 module will not intercept and stop a statement to explicitly start a transaction, such as with execute("BEGIN"). In that case, a transaction is started and the underlying SQLite engine is no longer in autocommit mode. (The sqlite3 Connection object will still report autocommit=True; this does not indicate that the SQLite engine is autocommit mode, just that the sqlite3 module is not going to implicitly start any transactions.) The connection commit() and rollback() methods may be used for transactions started explictly when autocommit=True, and the connection may be used as a context manager, just as it can be when autocommit=False. If no transaction is currently active then those methods silent pass with no effect. [1] https://sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions Side note: When I started down this rabbit hole several weeks ago, I repeatedly came across the extremely confusing phrase "SQLite operates in autocommit mode by default". It took me a while to realise that autocommit is not a flag that it is possible to turn off on a connection *when you open it*. The text I used above, "The underlying SQLite database engine operates in autocommit mode whenever no transactions are active" was carefully chosen and I consider it to be much clearer, regardless of whatever else ends up happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 08:10:28 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 06 Jan 2021 13:10:28 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609938628.45.0.0577331738678.issue42823@roundup.psfhosted.org> Ned Batchelder added the comment: This change seems like it has caused a problem. Python trace functions behave as they did in Python 3.9, but C trace functions no longer get line numbers for call or return events. Running this test code: def gen(inp): for n in inp: yield n list(gen([1,2,3])) With my C trace function logging what it is passed, in Python 3.9 I got this: trace: CALL @ coverage_test_2616437928787223.py 1 trace: LINE @ coverage_test_2616437928787223.py 1 trace: LINE @ coverage_test_2616437928787223.py 5 trace: CALL @ coverage_test_2616437928787223.py 1 trace: LINE @ coverage_test_2616437928787223.py 2 trace: LINE @ coverage_test_2616437928787223.py 3 trace: RET @ coverage_test_2616437928787223.py 3 trace: CALL @ coverage_test_2616437928787223.py 3 trace: LINE @ coverage_test_2616437928787223.py 2 trace: LINE @ coverage_test_2616437928787223.py 3 trace: RET @ coverage_test_2616437928787223.py 3 trace: CALL @ coverage_test_2616437928787223.py 3 trace: LINE @ coverage_test_2616437928787223.py 2 trace: LINE @ coverage_test_2616437928787223.py 3 trace: RET @ coverage_test_2616437928787223.py 3 trace: CALL @ coverage_test_2616437928787223.py 3 trace: LINE @ coverage_test_2616437928787223.py 2 trace: RET @ coverage_test_2616437928787223.py 2 trace: RET @ coverage_test_2616437928787223.py 5 With 3.10 (commit 1a9f51ed12feb4d95ad6d0faf610a030c05b9f5e) I get: trace: CALL @ coverage_test_40117094849631774.py 0 trace: LINE @ coverage_test_40117094849631774.py 1 trace: LINE @ coverage_test_40117094849631774.py 5 trace: CALL @ coverage_test_40117094849631774.py 0 trace: LINE @ coverage_test_40117094849631774.py 2 trace: LINE @ coverage_test_40117094849631774.py 3 trace: RET @ coverage_test_40117094849631774.py 0 trace: CALL @ coverage_test_40117094849631774.py 0 trace: LINE @ coverage_test_40117094849631774.py 2 trace: LINE @ coverage_test_40117094849631774.py 3 trace: RET @ coverage_test_40117094849631774.py 0 trace: CALL @ coverage_test_40117094849631774.py 0 trace: LINE @ coverage_test_40117094849631774.py 2 trace: LINE @ coverage_test_40117094849631774.py 3 trace: RET @ coverage_test_40117094849631774.py 0 trace: CALL @ coverage_test_40117094849631774.py 0 trace: LINE @ coverage_test_40117094849631774.py 2 trace: RET @ coverage_test_40117094849631774.py 0 trace: RET @ coverage_test_40117094849631774.py 0 All of the call and return events now get a frame with f_lineno == 0. Python trace functions seem unaffected. The C code producing this debug output is here: https://github.com/nedbat/coveragepy/blob/a498ebc28273fd21b6a047a173b2e4443b91f563/coverage/ctracer/tracer.c#L786-L813 ---------- nosy: +nedbat status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 08:21:56 2021 From: report at bugs.python.org (mike bayer) Date: Wed, 06 Jan 2021 13:21:56 +0000 Subject: [issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate In-Reply-To: <1580066229.26.0.0229158792904.issue39457@roundup.psfhosted.org> Message-ID: <1609939316.62.0.16408128795.issue39457@roundup.psfhosted.org> mike bayer added the comment: I think this issue just discusses the naming of an attribute called ".autocommit". for the discussion for SQLite's unusual starting of transactions, that's all in two other issues: https://bugs.python.org/issue9924 https://bugs.python.org/issue10740 so I would encourage folks to read those discussions. at issue is the limitation of SQLite that it locks the whole file for transactions, which is the main rationale for why SQLite is hesitant to begin a transaction. however, without configurability, this means it's not compatible with SAVEPOINT or serializable isolation levels. when users want to use those two features we have them set isolation_level=None and emit "BEGIN" on the connection directly. the connection.commit() and connection.rollback() methods continue to be functional ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 08:29:41 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 06 Jan 2021 13:29:41 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609939781.16.0.96509898455.issue42823@roundup.psfhosted.org> Mark Shannon added the comment: It looks like you are accessing the c field "f_lineno" directly. That was never guaranteed to work, it just happened to. You should use PyFrame_GetLineNumber() If "f_lineno" is up to date, then it will be almost efficient as the direct field access (the overhead is a C call). If "f_lineno" is not up to date, PyFrame_GetLineNumber() will compute the correct value. In the interest of efficiency it makes sense that the internal f_line field is updated before CALL and RETURN trace events. I'll make that change, but you really ought to use the API rather than probing into the frame internals. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 08:56:08 2021 From: report at bugs.python.org (xloem) Date: Wed, 06 Jan 2021 13:56:08 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. Message-ID: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> New submission from xloem <0xloem at gmail.com>: To handle destruction of resources especially during exceptions, it would be nice if there were some way to provide coroutines/tasks that run at the termination or closure of an event loop. There are a lot of api options here. Maybe a simple one would be to have close() call a run_until_closed() function that starts all of these and steps the loop to wait for them, before closing, and provide run_close() functions to queue them for delay. ---------- components: asyncio messages: 384503 nosy: asvetlov, xloem, yselivanov priority: normal severity: normal status: open title: Wait for cleanup coroutines before event loop is closed. type: enhancement versions: Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 09:32:12 2021 From: report at bugs.python.org (favonia) Date: Wed, 06 Jan 2021 14:32:12 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects Message-ID: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> New submission from favonia : If one uses the loader created by importlib.machinery.SourceFileLoader(module_name, path) in a meta path finder, where path is not a str, then the following error would happen at the moment the module is being imported. Note that, the error would not occur if the corresponding bytecode cache (__pycache__/*.pyc) is present. File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 972, in _find_and_load_unlocked File "", line 228, in _call_with_frames_removed File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 786, in exec_module File "", line 932, in get_code File "", line 604, in _code_to_timestamp_pyc ValueError: unmarshallable object Here is an example that could trigger the error. The package unipath is not very important except that unipath.Path is not marshallable. (Any library with a fancy, unmarshallable path-like object would work.) The choice of 'local' and the use of 'os.getcwd()' are also irrelevant. The actual production code is quite complicated, using different path-like objects and convoluted logic. I made up this example from scratch. import os import sys import importlib import importlib.abc import importlib.util from unipath import Path # just an example class DummyFinder(importlib.abc.MetaPathFinder): def __init__(self): self.cwd = os.getcwd() def find_spec(self, fullname, path, target=None): if fullname == 'local': initpath = os.path.join(self.cwd, '__init__.py') if os.path.isfile(initpath): loader = importlib.machinery.SourceFileLoader(fullname, Path(initpath)) # some non-str Path-like object here return importlib.util.spec_from_file_location(fullname, initpath, loader = loader, submodule_search_locations=[self.cwd]) else: return None sys.meta_path.append(DummyFinder()) importlib.import_module("local.test2") If this is indeed a bug, there might be other classes and functions in importlib that share the same problem. ---------- components: Library (Lib) messages: 384504 nosy: favonia priority: normal severity: normal status: open title: SourceFileLoader does not (fully) accept path-like objects type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:18:30 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 06 Jan 2021 15:18:30 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1609946310.31.0.42011607404.issue42823@roundup.psfhosted.org> Ned Batchelder added the comment: OK, thanks. I guess the parallels between the Python frame object and the C frame object made it easy to think I could use the fields directly. I'm updating the coverage.py code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:21:21 2021 From: report at bugs.python.org (Erik Soma) Date: Wed, 06 Jan 2021 15:21:21 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ Message-ID: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> New submission from Erik Soma : The documentation (https://docs.python.org/3/library/functions.html#type) shows type's signature as: class type(object) class type(name, bases, dict) But the "actual" 2nd signature in CPython 3.6+ is: class type(name, bases, dict, **kwargs) **kwargs here gets passed to __init_subclass__ in the same way that keywords in a class statement do so that: type("Bar", (Foo,), {}, spam='ham') is equivalent to class Bar(Foo, spam='ham'): pass It's not clear to me whether this is behavior to rely on. I started using this intuitively, but found that my type checker reasonably complained. Looking through the commit that implemented PEP 487 (d78448e9), it seems this may have been incidental. Additionally I haven't found mention of this in PEP 487 or the documentation and I can't seem to find any tests for it. ---------- messages: 384506 nosy: esoma priority: normal severity: normal status: open title: `type` takes **kwargs for __init_subclass__ type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:27:26 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 06 Jan 2021 15:27:26 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping Message-ID: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: In python3.9 `dict` `bitwise or` operator was introduced. I think it will be great if `collections.abc.Mapping` and `collections.abc.MutableMapping` will have a default implementation of `bitwise or` operator. ---------- messages: 384507 nosy: uriyyo priority: normal severity: normal status: open title: Add bitwise or operator to collections.abc Mapping and MutableMapping _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:27:47 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 06 Jan 2021 15:27:47 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping In-Reply-To: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> Message-ID: <1609946867.38.0.457300131296.issue42841@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- components: +Library (Lib) type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:31:21 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 06 Jan 2021 15:31:21 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping In-Reply-To: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> Message-ID: <1609947081.1.0.521568562261.issue42841@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +22970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:38:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 15:38:20 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1609947500.13.0.616671835986.issue42725@roundup.psfhosted.org> Guido van Rossum added the comment: Yield in an annotation should be a syntax error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 10:39:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 15:39:18 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1609947558.96.0.345349042762.issue42837@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:30:16 2021 From: report at bugs.python.org (sasquatchplatypus) Date: Wed, 06 Jan 2021 16:30:16 +0000 Subject: [issue42842] import logging.handlers shows weird behavior Message-ID: <1609950616.34.0.697361127063.issue42842@roundup.psfhosted.org> New submission from sasquatchplatypus : when trying to import a handler from logging.handlers, you have to explicitely import logging.handlers, because trying to get it from logging directly (for example import logging, logging.handlers.RotatingFileHandlers) raises this error: AttributeError: module 'logging' has no attribute 'handlers' ---------- messages: 384509 nosy: sasquatchplatypus priority: normal severity: normal status: open title: import logging.handlers shows weird behavior type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:32:08 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 06 Jan 2021 16:32:08 +0000 Subject: [issue30044] shutil.copystat should (allow to) copy ownership, and other attributes In-Reply-To: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za> Message-ID: <1609950728.53.0.0193858452727.issue30044@roundup.psfhosted.org> Eryk Sun added the comment: > For Windows though, I'm unsure. If copystat() gains the ability to copy the file's owner and group in POSIX, it is not a priority to mirror this capability in Windows, which doesn't implement anything like the Unix owner-group-other permission model. The only security metadata that I expect to be copied in Windows is the file's resource attributes, which are named attributes set on an object -- and considered inherent to the object -- for use in conditional access-control entries. Normally, the rest of the security descriptor is not copied, including the owner, group, mandatory label (integrity level and read-up/write-up/execute-up access), discretionary access-control list, and system access-control list (audit entries). That level of deep copying is a backup and restore operation of the complete file context, not a normal file copy. Regarding copy2(), what I've seen proposed a couple of times for Windows is to implement it via CopyFileExW(). The documentation of copy2() would have to be special cased to explain that the platform copy routine is used in Windows, which copies all named (alternate) data streams and settable file attributes, extended attributes, and resource attributes. It would also need to be emphasized that copy2() is not equivalent to copyfile() + copystat() in Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:38:53 2021 From: report at bugs.python.org (sasquatchplatypus) Date: Wed, 06 Jan 2021 16:38:53 +0000 Subject: [issue42842] module 'logging' has not attribute 'handlers' In-Reply-To: <1609950616.34.0.697361127063.issue42842@roundup.psfhosted.org> Message-ID: <1609951133.19.0.232686006803.issue42842@roundup.psfhosted.org> Change by sasquatchplatypus : ---------- title: import logging.handlers shows weird behavior -> module 'logging' has not attribute 'handlers' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:41:47 2021 From: report at bugs.python.org (Michael Felt) Date: Wed, 06 Jan 2021 16:41:47 +0000 Subject: [issue42309] BUILD: AIX-64-bit segmentation fault using xlc-v11 In-Reply-To: <1605008695.96.0.78391537773.issue42309@roundup.psfhosted.org> Message-ID: <1609951307.49.0.0180105847144.issue42309@roundup.psfhosted.org> Michael Felt added the comment: OK - looking at this again. This looks very similiar to another 'coredump' issue (will have to look for the number later). iirc, when something called 'pgen', or similiar was modified. Here is a lengthy `dbx` dump. If I am reading this correctly, it is 'starting' in this area: _PyPegen_run_parser(p = 0x0fffffffffffcb40), line 1121 in "pegen.c" _PyPegen_run_parser_from_string(str = "compile", start_rule = 1, filename_ob = 0x00000001100ee2b0, flags = 0x070000000007fb30, arena = 0x07000000000d3330), line 1250 in "pegen.c" PyPegen_ASTFromStringObject(str = warning: Unable to access address 0x15d4 from core (invalid char ptr (0x00000000000015d4)), filename = (nil), mode = 268435455, flags = 0x482448c200000000, arena = 0x00000001001a1e3c), line 27 in "peg_api.c" Py_CompileStringObject(str = "", filename = (nil), start = 268435455, flags = 0x070000000007fb30, optimize = 268435455), line 1274 in "pythonrun.c" builtin_compile_impl(module = 0x0000000100077a0c, source = (nil), filename = 0x0000000110000e28, mode = "", flags = 1, dont_inherit = 1, optimize = 0, feature_version = 0), line 819 in "bltinmodule.c" builtin_compile(module = (nil), args = 0x00000001100741c0, nargs = 2, kwnames = 0x07000000000068f0), line 274 in "bltinmodule.c.h" cfunction_vectorcall_FASTCALL_KEYWORDS(func = 0x0fffffffffffd030, args = 0x0000000000001300, nargsf = 0, kwnames = 0x0000000000000008), line 457 in "methodobject.c" Here is the complete 'where' status: (dbx) where strncmp.strncmp(??, ??, ??) at 0x90000000001b3a0 _get_keyword_or_name_type(p = 0x0000000000000020, name = (nil), name_len = 0), line 535 in "pegen.c" _PyPegen_fill_token(p = 0x00000001001be088), line 638 in "pegen.c" _PyPegen_is_memoized(p = 0x0000000000000020, type = 0, pres = 0x0fffffffffffc370), line 716 in "pegen.c" dotted_name_rule(p = 0x0fffffffffffc400), line 3443 in "parse.c" dotted_as_name_rule at AF452_298(??), line 3410 in "parse.c" _gather_36_rule at AF453_127(??), line 17755 in "parse.c" dotted_as_names_rule at AF454_299(??), line 3368 in "parse.c" import_name_rule(p = 0x0fffffffffffc660), line 3000 in "parse.c" import_stmt_rule at AF462_305(??), line 2932 in "parse.c" small_stmt_rule(p = 0x0fffffffffffc7a0), line 1606 in "parse.c" unnamed block in simple_stmt_rule(p = 0x00000001000df758), line 1428 in "parse.c" simple_stmt_rule(p = 0x00000001000df758), line 1428 in "parse.c" unnamed block in statement_rule(p = 0x00000000000015d5), line 1262 in "parse.c" statement_rule(p = 0x00000000000015d5), line 1262 in "parse.c" _loop1_11_rule(p = 0x00000001000df6d4), line 16254 in "parse.c" statements_rule at AF475_318(??), line 1197 in "parse.c" file_rule at AF476_324(??), line 730 in "parse.c" _PyPegen_run_parser(p = 0x0fffffffffffcb40), line 1121 in "pegen.c" _PyPegen_run_parser_from_string(str = "compile", start_rule = 1, filename_ob = 0x00000001100ee2b0, flags = 0x070000000007fb30, arena = 0x07000000000d3330), line 1250 in "pegen.c" PyPegen_ASTFromStringObject(str = warning: Unable to access address 0x15d4 from core (invalid char ptr (0x00000000000015d4)), filename = (nil), mode = 268435455, flags = 0x482448c200000000, arena = 0x00000001001a1e3c), line 27 in "peg_api.c" Py_CompileStringObject(str = "", filename = (nil), start = 268435455, flags = 0x070000000007fb30, optimize = 268435455), line 1274 in "pythonrun.c" builtin_compile_impl(module = 0x0000000100077a0c, source = (nil), filename = 0x0000000110000e28, mode = "", flags = 1, dont_inherit = 1, optimize = 0, feature_version = 0), line 819 in "bltinmodule.c" builtin_compile(module = (nil), args = 0x00000001100741c0, nargs = 2, kwnames = 0x07000000000068f0), line 274 in "bltinmodule.c.h" cfunction_vectorcall_FASTCALL_KEYWORDS(func = 0x0fffffffffffd030, args = 0x0000000000001300, nargsf = 0, kwnames = 0x0000000000000008), line 457 in "methodobject.c" PyVectorcall_Call(callable = 0x0fffffffffffd0c0, tuple = 0x07000000000b9900, kwargs = 0x07000000000bf1c8), line 257 in "call.c" do_call_core(tstate = 0x0000000000000001, func = 0x0000000000000002, callargs = 0x0000000000000001, kwdict = 0x00000001100741c0), line 5092 in "ceval.c" _PyEval_EvalFrameDefault(tstate = 0x0fffffffffffd370, f = 0x07000000000aced8, throwflag = 1), line 3580 in "ceval.c" _PyEval_EvalCode(tstate = 0x9f63fdf1699118db, _co = 0x070000000004ed80, globals = 0x07000000000754c0, locals = 0x0700000000051070, args = 0x0fffffffffffd4a0, argcount = 4765972565237396600, kwnames = 0x00000001000bb5e4, kwargs = 0x07000000000683b0, kwcount = 2, kwstep = 0, defs = (nil), defcount = 0, kwdefs = (nil), closure = (nil), name = 0x0700000000055ad0, qualname = 0x0700000000055ad0), line 40 in "pycore_ceval.h" _PyFunction_Vectorcall(func = 0x0fffffffffffd560, stack = 0x00000001100aefa8, nargsf = 1152921504606836064, kwnames = 0x07000000000b70f0), line 413 in "call.c" _PyEval_EvalFrameDefault(tstate = 0x000000010001c9c4, f = 0xffffffff000b99c0, throwflag = 268435455), line 621 in "abstract.h" _PyEval_EvalCode(tstate = 0x07000000000abd00, _co = 0x0700000000080870, globals = 0x0fffffffffffd880, locals = 0x07000000000acd60, args = 0x00000001000774ac, argcount = 5990971936392823232, kwnames = 0x0fffffffffffd880, kwargs = 0x00000001100741c0, kwcount = 0, kwstep = 0, defs = (nil), defcount = 0, kwdefs = 0x070000000008ee80, closure = (nil), name = 0x0700000000080870, qualname = 0x07000000000831c0), line 40 in "pycore_ceval.h" _PyFunction_Vectorcall(func = 0x070000000005d920, stack = 0x00000001100a7cb0, nargsf = 1152921504606837152, kwnames = 0x4224224400000000), line 413 in "call.c" _PyEval_EvalFrameDefault(tstate = 0x0000000100079094, f = 0x00000001100741c0, throwflag = 117440512), line 621 in "abstract.h" function_code_fastcall(tstate = 0x0700000000071790, co = 0x0700000000071788, args = 0x0fffffffffffdc00, nargs = 0, globals = (nil)), line 40 in "pycore_ceval.h" _PyEval_EvalFrameDefault(tstate = 0x0000000100079094, f = 0x00000001100741c0, throwflag = -2147483648), line 621 in "abstract.h" function_code_fastcall(tstate = 0x07000000000abd30, co = 0x07000000000601b0, args = 0x0000000110010150, nargs = 5198324447627075472, globals = 0x00000001000cfd9c), line 40 in "pycore_ceval.h" _PyEval_EvalFrameDefault(tstate = 0x07000000000642f8, f = 0x0000000000000001, throwflag = 0), line 621 in "abstract.h" function_code_fastcall(tstate = 0x0700000000066326, co = 0x0700000000066310, args = 0x0700000000067200, nargs = 504403158266200968, globals = (nil)), line 40 in "pycore_ceval.h" _PyEval_EvalFrameDefault(tstate = 0x0000000100079094, f = 0x09fffffff000d4d0, throwflag = 1), line 621 in "abstract.h" function_code_fastcall(tstate = 0x000000007fffffff, co = 0x00000001100741c0, args = 0x0fffffffffffe2e0, nargs = 0, globals = 0x00000001000639b0), line 40 in "pycore_ceval.h" _PyEval_EvalFrameDefault(tstate = 0x0fffffffffffe5b0, f = 0x000000011000f7b0, throwflag = 1), line 621 in "abstract.h" function_code_fastcall(tstate = 0x0fffffffffffe540, co = 0x00000001100741c0, args = 0x00000001000775cc, nargs = 0, globals = (nil)), line 40 in "pycore_ceval.h" object_vacall(tstate = 0x0fffffffffffe5e0, base = 0x482402c8000b98b0, callable = 0x0000000100093d1c, vargs = (nil)), line 62 in "abstract.h" _PyObject_CallMethodIdObjArgs(obj = (nil), name = 0x000000011003f360, ... = 0x7000000000b98b0, 0x700000000050950, 0x0, 0x700000000053dc0, 0x700000000053b00, 0x700000000053bc0), line 897 in "call.c" import_find_and_load(tstate = 0x0000000110068100, abs_name = (nil)), line 1771 in "import.c" unnamed block in PyImport_ImportModuleLevelObject(name = 0x07000000000af090, globals = (nil), locals = 0x00000001003c75dc, fromlist = 0x000000011005ad00, level = 268435455), line 1887 in "import.c" unnamed block in PyImport_ImportModuleLevelObject(name = 0x07000000000af090, globals = (nil), locals = 0x00000001003c75dc, fromlist = 0x000000011005ad00, level = 268435455), line 1887 in "import.c" PyImport_ImportModuleLevelObject(name = 0x07000000000af090, globals = (nil), locals = 0x00000001003c75dc, fromlist = 0x000000011005ad00, level = 268435455), line 1887 in "import.c" builtin___import__(self = 0x0000000100100c84, args = 0x0fffffffffffe970, kwds = 0xbadc0ffee0ddf00d), line 280 in "bltinmodule.c" cfunction_call(func = 0x0000000100076e4c, args = 0xbadc0ffee0ddf00d, kwargs = 0x00000001100a7cb0), line 539 in "methodobject.c" _PyObject_MakeTpCall(tstate = 0x0000000100088f74, callable = (nil), args = (nil), nargs = 4563878336, keywords = 0x0fffffffffffeaa0), line 191 in "call.c" _PyObject_CallFunctionVa(tstate = 0x0ffffffffffffed0, callable = (nil), format = (nil), va = (nil), is_size_t = 117440512), line 60 in "abstract.h" PyObject_CallFunction(callable = 0x0700000000050950, format = "OOOOi", ... = 0x7000000000b98b0, 0x7000000000ad400, 0x7000000000ad400, 0x700000000093580, 0x0, 0x0), line 579 in "call.c" PyImport_Import(module_name = 0x0000000000000001), line 2088 in "import.c" PyImport_ImportModule(name = "^O(invalid char ptr (0x0fffffffffffecf0))), line 1488 in "import.c" PyImport_ImportModuleNoBlock(name = "^O(invalid char ptr (0x0fffffffffffedb0))), line 1506 in "import.c" unnamed block in _PyCodecRegistry_Init(), line 1543 in "codecs.c" _PyCodecRegistry_Init(), line 1543 in "codecs.c" _PyCodec_Forget(encoding = ""), line 124 in "codecs.c" init_stdio_encoding(tstate = 0x0000000000000013), line 16018 in "unicodeobject.c" init_fs_encoding(tstate = 0x00000001100a7cb0), line 16132 in "unicodeobject.c" _PyUnicode_InitEncodings(tstate = (nil)), line 16148 in "unicodeobject.c" init_interp_main(tstate = (nil)), line 1009 in "pylifecycle.c" pyinit_main(tstate = (nil)), line 1097 in "pylifecycle.c" Py_InitializeFromConfig(config = 0x0000000110098c70), line 1141 in "pylifecycle.c" pymain_init(args = 0x09fffffff000c9c8), line 66 in "main.c" pymain_main(args = 0x09fffffff00009a0), line 698 in "main.c" Py_BytesMain(argc = -1159983106, argv = 0xbadc0ffee0ddf00d), line 731 in "main.c" python.main(argc = 0, argv = (nil)), line 15 in "python.c" (dbx) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:46:41 2021 From: report at bugs.python.org (hai shi) Date: Wed, 06 Jan 2021 16:46:41 +0000 Subject: [issue42842] module 'logging' has not attribute 'handlers' In-Reply-To: <1609950616.34.0.697361127063.issue42842@roundup.psfhosted.org> Message-ID: <1609951601.0.0.977628257991.issue42842@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:52:47 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 06 Jan 2021 16:52:47 +0000 Subject: [issue42843] What min_sphinx for Python 3.10 Message-ID: <1609951966.97.0.867485424131.issue42843@roundup.psfhosted.org> New submission from Julien Palard : According to [1] there's no concensus on which minimum Sphinx version we should use for Python 3.10. "sadly" since https://github.com/python/cpython/pull/23620 which make use of a Sphinx 3.2.0 only feature, we should bump it to 3.2, but it may not work for everybody. [1]: https://github.com/python/cpython/pull/23620#issuecomment-755420205 ---------- assignee: mdk components: Documentation messages: 384512 nosy: mdk priority: normal severity: normal status: open title: What min_sphinx for Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 11:54:47 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 06 Jan 2021 16:54:47 +0000 Subject: [issue42843] What min_sphinx for Python 3.10 In-Reply-To: <1609951966.97.0.867485424131.issue42843@roundup.psfhosted.org> Message-ID: <1609952087.31.0.193876792058.issue42843@roundup.psfhosted.org> Change by Julien Palard : ---------- keywords: +patch pull_requests: +22971 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:00:12 2021 From: report at bugs.python.org (Stephen) Date: Wed, 06 Jan 2021 17:00:12 +0000 Subject: [issue42844] Turtle Module -- "onclick" arguments enchancement Message-ID: <1609952412.13.0.0764333219073.issue42844@roundup.psfhosted.org> New submission from Stephen : I have created an enhancement in the Turtle module. When a programmer wants to have an action performed after clicking on a Turtle object, the programmer is currently unable to supply any arguments into the method that is run when "on_clicked" which is extremely limiting, especially to beginners who are looking to modify multiple objects on the screen at one time, such as in a game. I have modified the implementation of the ?on_clicked? method to be able to provide keyword arguments into the method through a dictionary that is later unpacked into the target method. Attached is an example of the benefits of this enhancement to the turtle module. ---------- components: Library (Lib) files: on_click_arguments_example.py messages: 384513 nosy: sc1341 priority: normal severity: normal status: open title: Turtle Module -- "onclick" arguments enchancement type: enhancement versions: Python 3.10 Added file: https://bugs.python.org/file49723/on_click_arguments_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:04:03 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 06 Jan 2021 17:04:03 +0000 Subject: [issue42843] What min_sphinx for Python 3.10 In-Reply-To: <1609951966.97.0.867485424131.issue42843@roundup.psfhosted.org> Message-ID: <1609952643.81.0.106930491572.issue42843@roundup.psfhosted.org> Julien Palard added the comment: In favor of Sphinx 3 only : - We have :no-trim-doctest-flags: which fixes https://bugs.python.org/issue36675 - backslash handing is different in Sphinx 2 and Sphinx 3: https://bugs.python.org/issue42822 In favor of keeping compatibility with Sphinx 2 : - Some distribs may want/need to ship Python 3.10 along with Sphinx 2? So I'm personally in favor of a full witch to Sphinx 3 with Python 3.10, but I'm open to hear everybody. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:08:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 06 Jan 2021 17:08:08 +0000 Subject: [issue42845] Third Party Module Installation using pip fails in Python 3.10.0a3 Message-ID: <1609952888.82.0.0280575677398.issue42845@roundup.psfhosted.org> New submission from Shreyan Avigyan : A few days ago, I tried installing Python 3.10.a3 for testing. After installing, I tried using the Python built-in modules, they were working fine. Then I tried going for installing third party modules using pip from the command prompt. While installing I noticed that some modules I could install perfectly but for most of the modules, they failed to install. After trying to install them, I tried looking for the full error message. After a lot of searching I found out that it is looking for Microsoft Visual C++ and couldn't find it because I haven't installed it and gave me that error. I haven't tried installing Python 3.10.0a4 yet and I don't know if it's already solved or not but this problem is continuously occurring in Python 3.10.0a3. ---------- components: Installation messages: 384515 nosy: shreyanavigyan priority: normal severity: normal status: open title: Third Party Module Installation using pip fails in Python 3.10.0a3 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:12:03 2021 From: report at bugs.python.org (Stephen) Date: Wed, 06 Jan 2021 17:12:03 +0000 Subject: [issue42844] Turtle Module -- "onclick" arguments enchancement In-Reply-To: <1609952412.13.0.0764333219073.issue42844@roundup.psfhosted.org> Message-ID: <1609953123.41.0.739689423548.issue42844@roundup.psfhosted.org> Change by Stephen : ---------- keywords: +patch pull_requests: +22972 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:15:20 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 06 Jan 2021 17:15:20 +0000 Subject: [issue42842] module 'logging' has not attribute 'handlers' In-Reply-To: <1609950616.34.0.697361127063.issue42842@roundup.psfhosted.org> Message-ID: <1609953320.53.0.170487166415.issue42842@roundup.psfhosted.org> Vinay Sajip added the comment: This is not a bug - this is how it is supposed to work. The handlers module isn't automatically loaded; you have to import it. The basic handlers (NullHandler, StreamHandler, FileHandler) are in the logging module - additional handlers are in logging.handlers. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:22:06 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 17:22:06 +0000 Subject: [issue42845] Third Party Module Installation using pip fails in Python 3.10.0a3 In-Reply-To: <1609952888.82.0.0280575677398.issue42845@roundup.psfhosted.org> Message-ID: <1609953726.43.0.385011625759.issue42845@roundup.psfhosted.org> Guido van Rossum added the comment: This is expected -- those modules contain C extensions for which no 3.10 wheels are available from PyPI yet, so pip tries to build them locally. If you want to help testing, please install the recommended free version of the MS C++ compiler. From CPython/PCbuild/readme.txt: 1. Install Microsoft Visual Studio 2017 with Python workload and Python native development component. ---------- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:30:15 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 06 Jan 2021 17:30:15 +0000 Subject: [issue38780] SysLogHandler crash atexit In-Reply-To: <1573579569.01.0.575609345468.issue38780@roundup.psfhosted.org> Message-ID: <1609954215.84.0.324277608336.issue38780@roundup.psfhosted.org> Vinay Sajip added the comment: TBH as I said in the now-closed PR, using a NullSocket seems overkill. As mentioned in msg359594, it seems to make more sense to assign a socket attribute to None early in the constructor. If an error occurs during socket creation, the socket attribute will remain at None. When closing, just ensure the socket attribute isn't None before trying to close it. This mirrors what SocketHandler does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:31:28 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 17:31:28 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping In-Reply-To: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> Message-ID: <1609954288.61.0.114172874393.issue42841@roundup.psfhosted.org> Guido van Rossum added the comment: This was discussed during the PEP review and rejected. The main reason is that this operator would need to create a new instance, and there is no standard API that's part of the Mapping protocol that can be used (the constructor of a Mapping instance might have unknown parameters). ---------- nosy: +gvanrossum resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:32:44 2021 From: report at bugs.python.org (Alan Robertson) Date: Wed, 06 Jan 2021 17:32:44 +0000 Subject: [issue38780] SysLogHandler crash atexit In-Reply-To: <1609954215.84.0.324277608336.issue38780@roundup.psfhosted.org> Message-ID: <6dcf18fe-665e-4ba6-9e6d-79d50d3b9031@www.fastmail.com> Alan Robertson added the comment: On Wed, Jan 6, 2021, at 10:30 AM, Vinay Sajip wrote: > > Vinay Sajip added the comment: > > TBH as I said in the now-closed PR, using a NullSocket seems overkill. > As mentioned in msg359594, it seems to make more sense to assign a > socket attribute to None early in the constructor. If an error occurs > during socket creation, the socket attribute will remain at None. When > closing, just ensure the socket attribute isn't None before trying to > close it. This mirrors what SocketHandler does. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- Alan Robertson alanr at unix.sh ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:34:18 2021 From: report at bugs.python.org (Alan Robertson) Date: Wed, 06 Jan 2021 17:34:18 +0000 Subject: [issue38780] SysLogHandler crash atexit In-Reply-To: <1609954215.84.0.324277608336.issue38780@roundup.psfhosted.org> Message-ID: Alan Robertson added the comment: As far as I know, this only happens during shutdown. During shutdown it has already removed the attribute as part of the teardown process. In this case adding the attribute at the begining will do no good. On Wed, Jan 6, 2021, at 10:30 AM, Vinay Sajip wrote: > > Vinay Sajip added the comment: > > TBH as I said in the now-closed PR, using a NullSocket seems overkill. > As mentioned in msg359594, it seems to make more sense to assign a > socket attribute to None early in the constructor. If an error occurs > during socket creation, the socket attribute will remain at None. When > closing, just ensure the socket attribute isn't None before trying to > close it. This mirrors what SocketHandler does. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:36:24 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 17:36:24 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ In-Reply-To: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> Message-ID: <1609954584.36.0.551784057645.issue42840@roundup.psfhosted.org> Guido van Rossum added the comment: That sounds intentional to me (else the class statement would have a capability that cannot be dynamically emulated by calling type()). We should probably update the docs (if you could submit a small PR that would be appreciated) and also typeshed (ditto). ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:36:30 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 06 Jan 2021 17:36:30 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping In-Reply-To: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> Message-ID: <1609954590.13.0.0821077827987.issue42841@roundup.psfhosted.org> Brandt Bucher added the comment: (Also, it would break virtual subclasses.) ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:37:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 17:37:45 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects In-Reply-To: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> Message-ID: <1609954665.83.0.714840897511.issue42839@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe Brett can help? ---------- nosy: +brett.cannon, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:42:30 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 06 Jan 2021 17:42:30 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1609954950.87.0.68451237696.issue42811@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +22973 pull_request: https://github.com/python/cpython/pull/24144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:42:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 06 Jan 2021 17:42:33 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1609954953.47.0.99426343472.issue42811@roundup.psfhosted.org> miss-islington added the comment: New changeset ff8458b918050168acda1ad6d079f52b8effa821 by Yair Frid in branch 'master': bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100) https://github.com/python/cpython/commit/ff8458b918050168acda1ad6d079f52b8effa821 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:42:44 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 06 Jan 2021 17:42:44 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1609954964.61.0.0259374079014.issue42811@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:43:06 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 17:43:06 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609954986.1.0.779269343831.issue42115@roundup.psfhosted.org> Guido van Rossum added the comment: Undoubtedly -- but impact should be measured on what typical users would see, not on narrow benchmarks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 12:49:54 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 06 Jan 2021 17:49:54 +0000 Subject: [issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping In-Reply-To: <1609946846.04.0.311249244168.issue42841@roundup.psfhosted.org> Message-ID: <1609955394.42.0.565722655807.issue42841@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Thanks, for the replies, didn't know about that. Interesting thing that `collections.abc.Set` base class has implementations of `__and__`, `__or__`, `__sub__` and `__xor__` methods, it also provide `_from_iterable` class method that is used to create `Set` instance from iterable (all of those operators use this method). ``` class Set(Collection): ... @classmethod def _from_iterable(cls, it): '''Construct an instance of the class from any iterable input. Must override this method if the class constructor signature does not accept an iterable for an input. ''' return cls(it) ``` Basically, my proposition was to do smth similar to `collections.abc.Mapping`, but I understand your motivation not to implement this feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 13:15:41 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 06 Jan 2021 18:15:41 +0000 Subject: [issue42299] Remove formatter module In-Reply-To: <1604965286.22.0.755561980419.issue42299@roundup.psfhosted.org> Message-ID: <1609956941.48.0.389131936694.issue42299@roundup.psfhosted.org> Miro Hron?ok added the comment: I am confused. Why is this still online when the source was removed? https://docs.python.org/3.10/library/formatter.html ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 13:23:31 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 06 Jan 2021 18:23:31 +0000 Subject: [issue38780] SysLogHandler crash atexit In-Reply-To: <1573579569.01.0.575609345468.issue38780@roundup.psfhosted.org> Message-ID: <1609957411.16.0.721596702202.issue38780@roundup.psfhosted.org> Vinay Sajip added the comment: > As far as I know, this only happens during shutdown. During shutdown it has already removed the attribute as part of the teardown process. In this case adding the attribute at the begining will do no good. Certainly, that's true - there are a number of issues that get laid at logging's door because of interpreter shutdown sometimes intersecting with asyncio, threads and error handling using logging to report, which then fails in turn because of inconsistent interpreter state during shutdown. That would then perhaps be a "wontfix" or "cantfix" because there is no good solution. But the missing socket attribute in SysLogHandler might cause other problems in the future - I'm just saying that the approach you suggested is, to me, preferable to the NullSocket approach to deal with a similar issue in this area. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 13:37:18 2021 From: report at bugs.python.org (Erik Soma) Date: Wed, 06 Jan 2021 18:37:18 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ In-Reply-To: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> Message-ID: <1609958238.32.0.286875482035.issue42840@roundup.psfhosted.org> Erik Soma added the comment: Can do. I have found a blurb in the 3.6 What's New that confirms it was purposeful (https://docs.python.org/3/whatsnew/3.6.html#index-37). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 13:41:54 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 06 Jan 2021 18:41:54 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects In-Reply-To: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> Message-ID: <1609958514.19.0.558132966187.issue42839@roundup.psfhosted.org> Brett Cannon added the comment: importlib is probably not os.PathLike-clean due to its bootstrapping restrictions of not getting to use anything implemented in Python from 'os' (i.e. if it isn't being managed in posixmodule.c then it probably won't work). If you follow the traceback it's trying to marshal a code object for the eventual .pyc file and failing (https://github.com/python/cpython/blob/faf49573963921033c608b4d2f398309d9f0d2b5/Lib/importlib/_bootstrap_external.py#L604). The real question is why is any unmarshallable object getting passed in the first place since that object is the code object that compile() returned. Best guess? The compile() function is being given the path-like object (via https://github.com/python/cpython/blob/faf49573963921033c608b4d2f398309d9f0d2b5/Lib/importlib/_bootstrap_external.py#L848) and it's blindly setting it on the code object itself, and then marhsal fails since it can't handle pathlib.Path. If my hunch is right, then the possible solutions are: - Don't do that ? - Make compile() aware of path-like objects - Have importlib explicitly work around compile()'s shortcoming by doing the right thing for path-like objects before passing in the the 'path' argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 13:46:31 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 18:46:31 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects In-Reply-To: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> Message-ID: <1609958791.29.0.0954200109486.issue42839@roundup.psfhosted.org> Guido van Rossum added the comment: If Brett's theory is right, compile() has a bug though -- it shouldn't plug a non-string into the code object. Or possibly the code object constructor should reject such objects (or extract the string). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:00:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 19:00:05 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ In-Reply-To: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> Message-ID: <1609959605.64.0.570884361823.issue42840@roundup.psfhosted.org> Guido van Rossum added the comment: Excellent! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:09:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 06 Jan 2021 19:09:31 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1609960171.83.0.470833854801.issue42115@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Agreed. In that regard the most standard thing that we have is the pyperformance suite, which are almost all macro benchmarks. Is also what is displayed in speed.python.org ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:26:24 2021 From: report at bugs.python.org (Vladimir Ryabtsev) Date: Wed, 06 Jan 2021 19:26:24 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609961184.43.0.0509762052486.issue38413@roundup.psfhosted.org> Change by Vladimir Ryabtsev : ---------- pull_requests: +22974 pull_request: https://github.com/python/cpython/pull/24145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:29:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 06 Jan 2021 19:29:22 +0000 Subject: [issue42299] Remove formatter module In-Reply-To: <1604965286.22.0.755561980419.issue42299@roundup.psfhosted.org> Message-ID: <1609961362.11.0.757589574026.issue42299@roundup.psfhosted.org> Christian Heimes added the comment: https://docs.python.org/3.10/library/index.html no longer links to https://docs.python.org/3.10/library/misc.html but misc.html and formatter.html are still there. It looks like a bug in the build and update process. I bet it's not removing files. Ee, could you take a look, please? ---------- nosy: +EWDurbin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:31:45 2021 From: report at bugs.python.org (Ernest W. Durbin III) Date: Wed, 06 Jan 2021 19:31:45 +0000 Subject: [issue42299] Remove formatter module In-Reply-To: <1604965286.22.0.755561980419.issue42299@roundup.psfhosted.org> Message-ID: <1609961505.68.0.324645727253.issue42299@roundup.psfhosted.org> Ernest W. Durbin III added the comment: Issues relating to documentation build likely need to be looked at and addressed by Julien. If it does end up being an infra issue, feel free to read me to nosy. ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:32:20 2021 From: report at bugs.python.org (Vladimir Ryabtsev) Date: Wed, 06 Jan 2021 19:32:20 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609961540.62.0.94601308622.issue38413@roundup.psfhosted.org> Change by Vladimir Ryabtsev : ---------- stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:43:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 19:43:14 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609962194.37.0.399254229143.issue41798@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f22b7ca1afd98a7381a9fe9e53bd6dfa2a5eba16 by Erlend Egeberg Aasland in branch 'master': bpo-41798: Allocate _socket module C API on the heap (GH-24126) https://github.com/python/cpython/commit/f22b7ca1afd98a7381a9fe9e53bd6dfa2a5eba16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 14:47:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 19:47:27 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1609962447.27.0.3998275067.issue41798@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1ab045933b90d1954af983cc08d1bf0bc46b6240 by Hai Shi in branch 'master': bpo-41798: Allocate the _datetime.datetime_CAPI on the heap memory (GH-24096) https://github.com/python/cpython/commit/1ab045933b90d1954af983cc08d1bf0bc46b6240 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 15:53:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jan 2021 20:53:30 +0000 Subject: [issue40601] [C API] Hide static types from the limited C API In-Reply-To: <1589235805.82.0.0888479979707.issue40601@roundup.psfhosted.org> Message-ID: <1609966410.74.0.130516915727.issue40601@roundup.psfhosted.org> STINNER Victor added the comment: PC/python3dll.c exports 66 types in the stable ABI: Py_GenericAliasType PyObject_Type _PyWeakref_CallableProxyType _PyWeakref_ProxyType _PyWeakref_RefType PyBaseObject_Type PyBool_Type PyByteArray_Type PyByteArrayIter_Type PyBytes_Type PyBytesIter_Type PyCallIter_Type PyCapsule_Type PyCFunction_Type PyClassMethodDescr_Type PyComplex_Type PyDict_Type PyDictItems_Type PyDictIterItem_Type PyDictIterKey_Type PyDictIterValue_Type PyDictKeys_Type PyDictProxy_Type PyDictValues_Type PyEllipsis_Type PyEnum_Type PyExc_TypeError PyFilter_Type PyFloat_Type PyFrozenSet_Type PyGetSetDescr_Type PyList_Type PyListIter_Type PyListRevIter_Type PyLong_Type PyLongRangeIter_Type PyMap_Type PyMemberDescr_Type PyMemoryView_Type PyMethodDescr_Type PyModule_Type PyModuleDef_Type PyNullImporter_Type PyODict_Type PyODictItems_Type PyODictIter_Type PyODictKeys_Type PyODictValues_Type PyProperty_Type PyRange_Type PyRangeIter_Type PyReversed_Type PySeqIter_Type PySet_Type PySetIter_Type PySlice_Type PySortWrapper_Type PySuper_Type PyTraceBack_Type PyTuple_Type PyTupleIter_Type PyType_Type PyUnicode_Type PyUnicodeIter_Type PyWrapperDescr_Type PyZip_Type ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 15:57:43 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 20:57:43 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609966663.6.0.604011828535.issue38413@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 49c150f1f16398a4e77e051244f27adc5ac7b47b by Vladimir in branch '3.9': bpo-38413: Remove outdated section about multithreading in sqlite3 (GH-23159) https://github.com/python/cpython/commit/49c150f1f16398a4e77e051244f27adc5ac7b47b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 15:58:40 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 06 Jan 2021 20:58:40 +0000 Subject: [issue38413] Remove or change "Multithreading" section In-Reply-To: <1570563042.6.0.0902531064636.issue38413@roundup.psfhosted.org> Message-ID: <1609966720.55.0.334968361625.issue38413@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 17:38:22 2021 From: report at bugs.python.org (neonene) Date: Wed, 06 Jan 2021 22:38:22 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure Message-ID: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> New submission from neonene : After https://github.com/python/cpython/commit/0b858cdd5d114f0890b11b6c4d6559d0ceb468ab (bpo-1635741: Convert _multibytecodec to multi-phase init), On Windows x64/x86 with chinese/japanese/korean system-locale, MultibyteCodec_Check() in multibytecodec.c returns false and PyExc_TypeError follows. This affects some tests and PGO training. 1) python -m test --verbose test_threading ====================================================================== FAIL: test_daemon_threads_fatal_error (test.test_threading.SubinterpThreadi ngTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\cpython-0b858\lib\test\test_threading.py", line 1124, in test_da emon_threads_fatal_error self.assertIn("Fatal Python error: Py_EndInterpreter: " AssertionError: 'Fatal Python error: Py_EndInterpreter: not the last thread ' not found in 'TypeError: codec is unexpected type\nFatal Python error: _P yThreadState_Delete: tstate 00000000003FF980 is still current\nPython runti me state: initialized\n\nThread 0x00000710 (most recent call first):\n\n' 2) python -m test --verbose test_embed ====================================================================== FAIL: test_audit_subinterpreter (test.test_embed.AuditingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\cpython-0b858\lib\test\test_embed.py", line 1433, in test_audit_ subinterpreter self.run_embedded_interpreter("test_audit_subinterpreter") File "C:\cpython-0b858\lib\test\test_embed.py", line 104, in run_embedded _interpreter self.assertEqual(p.returncode, returncode, AssertionError: 3221225477 != 0 : bad returncode 3221225477, stderr is 'Typ eError: codec is unexpected type\nFatal Python error: _PyThreadState_Delete : tstate 000000000050CAF0 is still current\nPython runtime state: initializ ed\n\nThread 0x000009d8 (most recent call first):\n\n' ====================================================================== FAIL: test_subinterps_different_ids (test.test_embed.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\cpython-0b858\lib\test\test_embed.py", line 169, in test_subinte rps_different_ids for run in self.run_repeated_init_and_subinterpreters(): File "C:\cpython-0b858\lib\test\test_embed.py", line 110, in run_repeated _init_and_subinterpreters out, err = self.run_embedded_interpreter("test_repeated_init_and_subint erpreters") File "C:\cpython-0b858\lib\test\test_embed.py", line 104, in run_embedded _interpreter self.assertEqual(p.returncode, returncode, AssertionError: 3221225477 != 0 : bad returncode 3221225477, stderr is 'Typ eError: codec is unexpected type\nFatal Python error: _PyThreadState_Delete : tstate 000000000041C960 is still current\nPython runtime state: initializ ed\n\nThread 0x00000a40 (most recent call first):\n\n' ====================================================================== FAIL: test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\cpython-0b858\lib\test\test_embed.py", line 177, in test_subinte rps_distinct_state for run in self.run_repeated_init_and_subinterpreters(): File "C:\cpython-0b858\lib\test\test_embed.py", line 110, in run_repeated _init_and_subinterpreters out, err = self.run_embedded_interpreter("test_repeated_init_and_subint erpreters") File "C:\cpython-0b858\lib\test\test_embed.py", line 104, in run_embedded _interpreter self.assertEqual(p.returncode, returncode, AssertionError: 3221225477 != 0 : bad returncode 3221225477, stderr is 'Typ eError: codec is unexpected type\nFatal Python error: _PyThreadState_Delete : tstate 000000000047C960 is still current\nPython runtime state: initializ ed\n\nThread 0x00000b34 (most recent call first):\n\n' ====================================================================== FAIL: test_subinterps_main (test.test_embed.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\cpython-0b858\lib\test\test_embed.py", line 163, in test_subinte rps_main for run in self.run_repeated_init_and_subinterpreters(): File "C:\cpython-0b858\lib\test\test_embed.py", line 110, in run_repeated _init_and_subinterpreters out, err = self.run_embedded_interpreter("test_repeated_init_and_subint erpreters") File "C:\cpython-0b858\lib\test\test_embed.py", line 104, in run_embedded _interpreter self.assertEqual(p.returncode, returncode, AssertionError: 3221225477 != 0 : bad returncode 3221225477, stderr is 'Typ eError: codec is unexpected type\nFatal Python error: _PyThreadState_Delete : tstate 000000000032C960 is still current\nPython runtime state: initializ ed\n\nThread 0x00000bf0 (most recent call first):\n\n' ---------- components: Extension Modules, Subinterpreters, Tests, Windows messages: 384541 nosy: corona10, erlendaasland, neonene, paul.moore, petr.viktorin, shihai1991, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Using _multibytecodec module on Windows, test_threading/embed get failure type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 18:37:55 2021 From: report at bugs.python.org (Vladimir Ryabtsev) Date: Wed, 06 Jan 2021 23:37:55 +0000 Subject: [issue42179] Clarify chaining exceptions in tutorial/errors.rst In-Reply-To: <1603873891.9.0.500762071742.issue42179@roundup.psfhosted.org> Message-ID: <1609976275.32.0.753919665812.issue42179@roundup.psfhosted.org> Vladimir Ryabtsev added the comment: The issue won't be fixed, but other useful changes applied. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 18:41:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 06 Jan 2021 23:41:04 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ Message-ID: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : GitHub does not play well with other file encodings than UTF-8. For example, when the "suggestion" in https://github.com/python/cpython/pull/20538#discussion_r552926126 was applied, GitHub silently converted Lib/sqlite3/test/types.py from ISO-8859 to UTF-8, as seen in the resulting commit fd4f65141925f2d84e0efd17ca4b9395c171d7ba. Apart from being annoying, this created an inconsistency between the `#-*- coding: iso-8859-1 -*-` header in Lib/sqlite3/test/types.py and its actual encoding (now UTF-8). I suggest to convert Lib/sqlite3/test/* to UTF-8 encoding for consistency. $ file Lib/sqlite3/test/*.py Lib/sqlite3/test/backup.py: Python script text executable, ASCII text Lib/sqlite3/test/dbapi.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/dump.py: Python script text executable, ASCII text Lib/sqlite3/test/factory.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/hooks.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/regression.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/transactions.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/types.py: Python script text executable, ISO-8859 text Lib/sqlite3/test/userfunctions.py: Python script text executable, UTF-8 Unicode text ---------- components: Library (Lib) messages: 384543 nosy: berker.peksag, erlendaasland priority: normal severity: normal status: open title: Normalise file encodings in Lib/sqlite3/test/ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 18:51:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 06 Jan 2021 23:51:00 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609977060.63.0.355311138402.issue42847@roundup.psfhosted.org> Guido van Rossum added the comment: SGTM, the use of ISO-8859 is surely a legacy issue. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 18:52:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 06 Jan 2021 23:52:48 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609977168.14.0.555150336501.issue42847@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Indeed it is. I'll create a PR as soon as GH-20538 is merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:05:15 2021 From: report at bugs.python.org (Berker Peksag) Date: Thu, 07 Jan 2021 00:05:15 +0000 Subject: [issue40823] Don't use obsolete unittest.makeSuite() in sqlite3 tests In-Reply-To: <1590838553.12.0.97963003429.issue40823@roundup.psfhosted.org> Message-ID: <1609977915.42.0.013147886075.issue40823@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 849e339a925fb398be31e566c31b99ce6cdb6006 by Erlend Egeberg Aasland in branch 'master': bpo-40823: Use loadTestsFromTestCase() iso. makeSuite() in sqlite3 tests (GH-20538) https://github.com/python/cpython/commit/849e339a925fb398be31e566c31b99ce6cdb6006 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:05:40 2021 From: report at bugs.python.org (Berker Peksag) Date: Thu, 07 Jan 2021 00:05:40 +0000 Subject: [issue40823] Don't use obsolete unittest.makeSuite() in sqlite3 tests In-Reply-To: <1590838553.12.0.97963003429.issue40823@roundup.psfhosted.org> Message-ID: <1609977940.36.0.249359447467.issue40823@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:14:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 07 Jan 2021 00:14:35 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609978475.55.0.305957743373.issue42847@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +22975 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:36:50 2021 From: report at bugs.python.org (Berker Peksag) Date: Thu, 07 Jan 2021 00:36:50 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609979810.63.0.602927659531.issue42847@roundup.psfhosted.org> Berker Peksag added the comment: New changeset deab1e54ff1695cdbe87f8db3d2c382d8e78330f by Erlend Egeberg Aasland in branch 'master': bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147) https://github.com/python/cpython/commit/deab1e54ff1695cdbe87f8db3d2c382d8e78330f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:38:06 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 07 Jan 2021 00:38:06 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609979886.27.0.117037394483.issue42847@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:40:15 2021 From: report at bugs.python.org (Berker Peksag) Date: Thu, 07 Jan 2021 00:40:15 +0000 Subject: [issue42847] Normalise file encodings in Lib/sqlite3/test/ In-Reply-To: <1609976464.16.0.541873091964.issue42847@roundup.psfhosted.org> Message-ID: <1609980015.24.0.363484141428.issue42847@roundup.psfhosted.org> Berker Peksag added the comment: iso-8859-1 is still commonly used in some parts of Nordic countries, but I don't see a reason not to change it here :) Thank you, Erlend! ---------- components: +Tests -Library (Lib) type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 19:56:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 07 Jan 2021 00:56:35 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1609980995.18.0.677877958394.issue10572@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22976 pull_request: https://github.com/python/cpython/pull/24148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 21:03:27 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 07 Jan 2021 02:03:27 +0000 Subject: [issue42783] asyncio.sleep(0) idiom is not documented In-Reply-To: <1609270826.19.0.331548885122.issue42783@roundup.psfhosted.org> Message-ID: <1609985007.42.0.040085937456.issue42783@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 5c30145afb6053998e3518befff638d207047f00 by Simon Willison in branch 'master': bpo-42783: Documentation for asyncio.sleep(0) (#24002) https://github.com/python/cpython/commit/5c30145afb6053998e3518befff638d207047f00 ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 21:10:12 2021 From: report at bugs.python.org (asleep-cult) Date: Thu, 07 Jan 2021 02:10:12 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ Message-ID: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> New submission from asleep-cult : The code below produces an unexpected traceback format that makes the source of an error very hard to find, this more than likely happens in less specific situations but this is how I came across it. I'm also not sure if this is an issue with asyncio, logging or the traceback module. import asyncio class Bar: def __init__(self): self.y = None class Foo: def __init__(self): self._bar = Bar() self.y def __getattribute__(self, name): try: attr = super().__getattribute__(name) except AttributeError as e: try: attr = self.ooops_spelled_bar_wrong.__getattribute__(name) except AttributeError: raise e return attr async def foo(): Foo() loop = asyncio.get_event_loop() loop.create_task(foo()) loop.run_forever() Traceback: Exception in default exception handler Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1733, in call_exception_handler self.default_exception_handler(context) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1707, in default_exception_handler logger.error('\n'.join(log_lines), exc_info=exc_info) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1471, in error self._log(ERROR, msg, args, **kwargs) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1585, in _log self.handle(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1595, in handle self.callHandlers(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1665, in callHandlers lastResort.handle(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 950, in handle self.emit(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1081, in emit msg = self.format(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 925, in format return fmt.format(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 672, in format record.exc_text = self.formatException(record.exc_info) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 622, in formatException traceback.print_exception(ei[0], ei[1], tb, None, sio) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 103, in print_exception for line in TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( [Previous line repeated 488 more times] File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 476, in __init__ _seen.add(id(exc_value)) RecursionError: maximum recursion depth exceeded while calling a Python object ``` The code below procures the expected traceback import traceback class Bar: def __init__(self): self.y = None class Foo: def __init__(self): self._bar = Bar() self.y def __getattribute__(self, name): try: attr = super().__getattribute__(name) except AttributeError as e: try: attr = self.ooops_spelled_bar_wrong.__getattribute__(name) except AttributeError: raise e return attr try: Foo() except: traceback.print_exc() Traceback: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Development/test/test.py", line 15, in __getattribute__ attr = super().__getattribute__(name) AttributeError: 'Foo' object has no attribute 'ooops_spelled_bar_wrong' # The part above is repeated hundreds of times Traceback (most recent call last): File "c:/Development/test/test.py", line 24, in Foo() File "c:/Development/test/test.py", line 11, in __init__ self.y File "c:/Development/test/test.py", line 18, in __getattribute__ attr = self.ooops_spelled_bar_wrong.__getattribute__(name) File "c:/Development/test/test.py", line 18, in __getattribute__ attr = self.ooops_spelled_bar_wrong.__getattribute__(name) File "c:/Development/test/test.py", line 18, in __getattribute__ attr = self.ooops_spelled_bar_wrong.__getattribute__(name) [Previous line repeated 992 more times] File "c:/Development/test/test.py", line 15, in __getattribute__ attr = super().__getattribute__(name) RecursionError: maximum recursion depth exceeded while calling a Python object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Development/test/test.py", line 26, in traceback.print_exc() File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 163, in print_exc print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 103, in print_exception for line in TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( [Previous line repeated 495 more times] RecursionError: maximum recursion depth exceeded ---------- components: Library (Lib) messages: 384551 nosy: asleep-cult priority: normal severity: normal status: open title: asyncio produces an unexpected traceback with recursive __getattribute__ type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 21:11:08 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 07 Jan 2021 02:11:08 +0000 Subject: [issue42783] asyncio.sleep(0) idiom is not documented In-Reply-To: <1609270826.19.0.331548885122.issue42783@roundup.psfhosted.org> Message-ID: <1609985468.38.0.153962667744.issue42783@roundup.psfhosted.org> Nick Coghlan added the comment: I merged the update to the 3.10 docs, but the automated backport to 3.9 to update the online docs failed. ---------- resolution: -> fixed stage: patch review -> backport needed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 21:32:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 02:32:53 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609986773.79.0.741937704329.issue42848@roundup.psfhosted.org> Guido van Rossum added the comment: Is there anything specific about __getattribute__ here? Wouldn't you have the same issue for *any* function that raises RecursionError called inside an async def? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:03:07 2021 From: report at bugs.python.org (asleep-cult) Date: Thu, 07 Jan 2021 03:03:07 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609988587.12.0.507831454569.issue42848@roundup.psfhosted.org> asleep-cult added the comment: I did test it with a simple recursive function but a more realistic test confirms that its not just __getattribute__ (which makes sense) import asyncio class Test(Exception): ... def x(): raise Test('Hello World!') def bar(): try: x() except Test as e: try: bar() except Test as e: raise e async def foo(): bar() loop = asyncio.get_event_loop() loop.create_task(foo()) loop.run_forever() Traceback: Exception in default exception handler Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1733, in call_exception_handler self.default_exception_handler(context) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1707, in default_exception_handler logger.error('\n'.join(log_lines), exc_info=exc_info) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1471, in error self._log(ERROR, msg, args, **kwargs) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1585, in _log self.handle(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1595, in handle self.callHandlers(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1665, in callHandlers lastResort.handle(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 950, in handle self.emit(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1081, in emit msg = self.format(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 925, in format return fmt.format(record) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 672, in format record.exc_text = self.formatException(record.exc_info) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 622, in formatException traceback.print_exception(ei[0], ei[1], tb, None, sio) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 103, in print_exception for line in TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( [Previous line repeated 488 more times] File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 476, in __init__ _seen.add(id(exc_value)) RecursionError: maximum recursion depth exceeded while calling a Python object The Test('Hello World') exception is suppressed entirely try: bar() except: traceback.print_exc() but when running it this way the traceback looks like this: File "c:/Development/test/test.py", line 7, in x raise Test('Hello World!') RecursionError: maximum recursion depth exceeded while calling a Python object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Development/test/test.py", line 21, in traceback.print_exc() File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 163, in print_exc print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 103, in print_exception for line in TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( [Previous line repeated 495 more times] RecursionError: maximum recursion depth exceeded ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:10:25 2021 From: report at bugs.python.org (asleep-cult) Date: Thu, 07 Jan 2021 03:10:25 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609989025.03.0.102420466732.issue42848@roundup.psfhosted.org> asleep-cult added the comment: Didn't show enough of the traceback to show that the latter does not suppress the Test exception Traceback (most recent call last): File "c:/Development/test/test.py", line 11, in bar x() File "c:/Development/test/test.py", line 7, in x raise Test('Hello World!') __main__.Test: Hello World! During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Development/test/test.py", line 19, in bar() File "c:/Development/test/test.py", line 14, in bar bar() File "c:/Development/test/test.py", line 14, in bar bar() File "c:/Development/test/test.py", line 14, in bar bar() [Previous line repeated 994 more times] File "c:/Development/test/test.py", line 11, in bar x() File "c:/Development/test/test.py", line 7, in x raise Test('Hello World!') RecursionError: maximum recursion depth exceeded while calling a Python object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Development/test/test.py", line 21, in traceback.print_exc() File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 163, in print_exc print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 103, in print_exception for line in TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\traceback.py", line 493, in __init__ context = TracebackException( [Previous line repeated 495 more times] RecursionError: maximum recursion depth exceeded ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:17:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 03:17:39 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609989459.04.0.852468249288.issue42848@roundup.psfhosted.org> Guido van Rossum added the comment: The recursion error is actually inside the traceback module. The reason is that the code there calls itself recursively for each level of context. Since bar() builds up an endless chain of contexts as it calls itself recursively, that chain is very long. Given that, do you feel comfortable trying to come up with a fix and submit a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:33:06 2021 From: report at bugs.python.org (asleep-cult) Date: Thu, 07 Jan 2021 03:33:06 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609990386.9.0.747858551074.issue42848@roundup.psfhosted.org> asleep-cult added the comment: I'm not sure I have a deep enough understanding of how this works, so no ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:52:38 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 03:52:38 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609991558.64.0.556160665257.issue42848@roundup.psfhosted.org> Guido van Rossum added the comment: No problem. Riot, are you interested in this? ---------- nosy: +Guido.van.Rossum, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 22:53:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 03:53:22 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1609991602.48.0.503970049942.issue42848@roundup.psfhosted.org> Guido van Rossum added the comment: I meant Irit. Silly autocorrect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 6 23:00:06 2021 From: report at bugs.python.org (Zhesi Huang) Date: Thu, 07 Jan 2021 04:00:06 +0000 Subject: [issue42849] pool worker can't be terminated Message-ID: <1609992006.83.0.897606551243.issue42849@roundup.psfhosted.org> New submission from Zhesi Huang : i see a case, the worker proc of pool can't be terminated, i try kill -SIGTERM or -SIGINT, but it still can't terminated the worker proc, then the pool __exit__ will hang forever ``` class NonDaemonProcess(multiprocessing.Process): # https://stackoverflow.com/questions/6974695/python-process-pool-non-daemonic # make 'daemon' attribute always return False def _get_daemon(self): return False def _set_daemon(self, value): pass daemon = property(_get_daemon, _set_daemon) def wrapper_copy_parallel(output_name, local_output_path, obs_path): log_thread('upload the content of [%s] outputs' % output_name) try: if os.path.exists(local_output_path): log_thread('%s has %d files to be uploaded' % (output_name, len(file_list))) xxxxxx log_thread('upload the content of [%s] outputs successfully' % output_name) log_thread('it can be accessed at obs path [%s]' % obs_path) else: log_thread('local output path is not found, skip upload the content of [%s] outputs' % output_name) except Exception as upload_exception: err_thread('upload the content of [%s] outputs failed: %s' % (output_name, str(upload_exception))) return 255 return 0 def upload_to_s3(): """ upload the content of local path to s3, handle action [on_completed] :return: """ outputs = [] for local_output_path, (output_name, obs_path, action, _, _) in local_to_target.items(): if action == ACTION_ON_COMPLETED: outputs.append((output_name, local_output_path, obs_path)) if len(outputs) == 0: return 0 with NonDaemonPool(processes=len(outputs)) as pool: results = pool.starmap(wrapper_copy_parallel, outputs) for result in results: if result != 0: return result return 0 ``` stdout/stderr log [ma-test Service Log][INFO][2021/01/05 03:07:49,218]: registered signal handler [ma-test Service Log][INFO][2021/01/05 03:09:40,299]: output-handler finalizing [ma-test Service Log][INFO][2021-01-05 03:09:40,309][NonDaemonPoolWorker-1]: child process calling self.run() [ma-test Service Log][INFO][2021-01-05 03:09:40,311][NonDaemonPoolWorker-1]: upload the content of [] outputs [ma-test Service Log][INFO][2021-01-05 03:09:41,331][Process-1:1]: child process calling self.run() [ma-test Service Log][INFO][2021-01-05 03:09:41,333][Process-1:2]: child process calling self.run() [ma-test Service Log][INFO][2021-01-05 03:09:41,338][Process-1:3]: child process calling self.run() [ma-test Service Log][INFO][2021-01-05 03:09:41,351][Process-1:1]: process shutting down [ma-test Service Log][INFO][2021-01-05 03:09:41,351][Process-1:1]: process exiting with exitcode 0 [ma-test Service Log][INFO][2021-01-05 03:09:41,386][Process-1:2]: process shutting down [ma-test Service Log][INFO][2021-01-05 03:09:41,386][Process-1:2]: process exiting with exitcode 0 [ma-test Service Log][INFO][2021-01-05 03:09:41,410][Process-1:3]: process shutting down [ma-test Service Log][INFO][2021-01-05 03:09:41,410][Process-1:3]: process exiting with exitcode 0 [ma-test Service Log][INFO][2021-01-05 03:09:41,415][NonDaemonPoolWorker-1]: upload the content of [] outputs successfully [ma-test Service Log][INFO][2021-01-05 03:09:41,415][NonDaemonPoolWorker-1]: it can be accessed at obs path [s3://ma-test-algorancher-intel/model_evaluation/6e5746ff-2839-400a-ba93-df38311415f4/dac957b0-b43b-43e2-ab19-0b45672a7ea0/] 18 (pid) proc python stacktrace >>> Interrupting process at following point: File "/home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py", line 396, in ret_code = upload_to_obs() File "/home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py", line 287, in upload_to_obs results = pool.starmap(wrapper_copy_parallel, outputs) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 623, in __exit__ self.terminate() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 548, in terminate self._terminate() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/util.py", line 201, in __call__ res = self._callback(*self._args, **self._kwargs) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 617, in _terminate_pool p.join() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/process.py", line 140, in join res = self._popen.wait(timeout) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 48, in wait return self.poll(os.WNOHANG if timeout == 0.0 else 0) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll pid, sts = os.waitpid(self.pid, flag) 18 (pid) proc gdb bt #0 0x00007f15c2c5ff7b in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x000055f54a8a5180 in os_waitpid_impl.isra.78 (options=0, pid=28) at /tmp/build/80754af9/python_1588882889832/work/Modules/posixmodule.c:7066 #2 os_waitpid () at /tmp/build/80754af9/python_1588882889832/work/Modules/clinic/posixmodule.c.h:3049 #3 0x000055f54a7f1b19 in _PyMethodDef_RawFastCallKeywords () at /tmp/build/80754af9/python_1588882889832/work/Objects/call.c:655 #4 0x000055f54a7f1db1 in _PyCFunction_FastCallKeywords (func=0x7f15c1f175f0, args=, nargs=, kwnames=) at /tmp/build/80754af9/python_1588882889832/work/Objects/call.c:734 28 (pid) proc python stacktrace Interrupting process at following point: File "/home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py", line 396, in ret_code = upload_to_obs() File "/home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py", line 286, in upload_to_obs with NonDaemonPool(processes=len(outputs)) as pool: File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 176, in __init__ self._repopulate_pool() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 241, in _repopulate_pool w.start() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/process.py", line 112, in start self._popen = self._Popen(self) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/context.py", line 277, in _Popen return Popen(process_obj) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 20, in __init__ self._launch(process_obj) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 74, in _launch code = process_obj._bootstrap() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/pool.py", line 110, in worker task = get() File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/queues.py", line 351, in get with self._rlock: File "/home/ma-user/miniconda3/lib/python3.7/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() 28 (pid) proc gdb bt #0 0x00007f15c2c5e827 in do_futex_wait.constprop () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f15c2c5e8d4 in __new_sem_wait_slow.constprop.0 () from /lib/x86_64-linux-gnu/libpthread.so.0 #2 0x00007f15c2c5e97a in sem_wait@@GLIBC_2.2.5 () from /lib/x86_64-linux-gnu/libpthread.so.0 #3 0x00007f15a98058b1 in semlock_acquire () at /usr/local/src/conda/python-3.7.7/Modules/_multiprocessing/semaphore.c:319 #4 0x000055f54a7f1c94 in _PyMethodDef_RawFastCallKeywords () at /tmp/build/80754af9/python_1588882889832/work/Objects/call.c:694 #5 0x000055f54a7f8aef in _PyMethodDescr_FastCallKeywords () at /tmp/build/80754af9/python_1588882889832/work/Objects/descrobject.c:288 proc list ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ps -ef UID PID PPID C STIME TTY TIME CMD ma-user 1 0 0 Jan05 ? 00:00:00 /bin/bash /home/ma-user/sidecar.sh ma-user 16 1 0 Jan05 ? 00:00:00 tail -n 0 -F /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log ma-user 18 1 0 Jan05 ? 00:00:00 python /home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py ma-user 28 18 0 Jan05 ? 00:00:00 python /home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py ma-user 102 0 0 Jan05 pts/0 00:00:00 bash ma-user 911 0 0 14:56 pts/1 00:00:00 bash ma-user 931 911 0 14:57 pts/1 00:00:00 ps -ef ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ 28 fd ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ls -alh /proc/28/fd total 0 dr-x------ 2 ma-user ma-group 0 Jan 6 20:23 . dr-xr-xr-x 9 ma-user ma-group 0 Jan 5 17:27 .. lr-x------ 1 ma-user ma-group 64 Jan 6 20:23 0 -> /dev/null l-wx------ 1 ma-user ma-group 64 Jan 6 20:23 1 -> /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log l-wx------ 1 ma-user ma-group 64 Jan 6 20:23 2 -> /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log lr-x------ 1 ma-user ma-group 64 Jan 6 20:23 3 -> /dev/urandom lr-x------ 1 ma-user ma-group 64 Jan 6 20:23 4 -> pipe:[952852668] lrwx------ 1 ma-user ma-group 64 Jan 6 20:23 5 -> socket:[952857499] lrwx------ 1 ma-user ma-group 64 Jan 6 20:23 6 -> /home/ma-user/conf/scc_logger.conf l-wx------ 1 ma-user ma-group 64 Jan 6 20:23 7 -> pipe:[952852671] lr-x------ 1 ma-user ma-group 64 Jan 6 20:23 8 -> /dev/null l-wx------ 1 ma-user ma-group 64 Jan 6 20:23 9 -> pipe:[952852675] 18 fd ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ls -alh /proc/18/fd total 0 dr-x------ 2 ma-user ma-group 0 Jan 6 20:26 . dr-xr-xr-x 9 ma-user ma-group 0 Jan 5 03:07 .. lr-x------ 1 ma-user ma-group 64 Jan 6 20:26 0 -> /dev/null l-wx------ 1 ma-user ma-group 64 Jan 6 20:26 1 -> /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log l-wx------ 1 ma-user ma-group 64 Jan 6 20:26 2 -> /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log lr-x------ 1 ma-user ma-group 64 Jan 6 20:26 3 -> /dev/urandom lr-x------ 1 ma-user ma-group 64 Jan 6 20:26 4 -> pipe:[952852668] l-wx------ 1 ma-user ma-group 64 Jan 6 20:26 5 -> pipe:[952852668] lr-x------ 1 ma-user ma-group 64 Jan 6 20:26 6 -> pipe:[952852671] l-wx------ 1 ma-user ma-group 64 Jan 6 20:26 7 -> pipe:[952852671] lr-x------ 1 ma-user ma-group 64 Jan 6 20:26 8 -> pipe:[952852675] SIGTERM / SIGINT not work ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ps -ef UID PID PPID C STIME TTY TIME CMD ma-user 1 0 0 Jan05 ? 00:00:00 /bin/bash /home/ma-user/sidecar.sh ma-user 16 1 0 Jan05 ? 00:00:00 tail -n 0 -F /home/ma-user/ma-test/log/-0---ma-platform-sidecar.log ma-user 18 1 0 Jan05 ? 00:00:00 python /home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py ma-user 28 18 0 Jan05 ? 00:00:00 python /home/ma-user/runtime-scripts-v2/init-container/outputs-handler.py ma-user 102 0 0 Jan05 pts/0 00:00:00 bash ma-user 1166 0 0 Jan06 pts/1 00:00:00 bash ma-user 1216 1166 0 10:51 pts/1 00:00:00 ps -ef ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ kill -SIGTERM 28 ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ kill -SIGINT 28 ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ ma-user at ma-test-eval-dac957b0-b43b-43e2-ab19-0b45672a7ea0-worker-0:/$ finally, pool hang ---------- components: Library (Lib) messages: 384560 nosy: huangzhesi priority: normal severity: normal status: open title: pool worker can't be terminated type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 00:55:30 2021 From: report at bugs.python.org (karl) Date: Thu, 07 Jan 2021 05:55:30 +0000 Subject: [issue19683] test_minidom has many empty tests In-Reply-To: <1385047059.66.0.790496754317.issue19683@psf.upfronthosting.co.za> Message-ID: <1609998930.22.0.922867942603.issue19683@roundup.psfhosted.org> karl added the comment: @zach.ware @r.david.murray I'm going through the source currently. I see that the test file is using: class MinidomTest(unittest.TestCase): def confirm(self, test, testname = "Test"): self.assertTrue(test, testname) Is there a specific reason to use this form instead of just directly using self.assertEqual or similar forms for new tests or reorganizing some of the tests. I see that it is used for example for giving a testname but def testAAA(self): dom = parseString("") el = dom.documentElement el.setAttribute("spam", "jam2") self.confirm(el.toxml() == '', "testAAA") testAAA is not specifically helping. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 01:13:57 2021 From: report at bugs.python.org (Robin Scheibler) Date: Thu, 07 Jan 2021 06:13:57 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package Message-ID: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> New submission from Robin Scheibler : I am having an issue with using urllib in a multiprocessing.Process when the package sounddevice (https://github.com/spatialaudio/python-sounddevice) has been already imported. The sub-process hangs upon calling urllib.request.urlopen (and methods from the requests package too). 1. If the package sounddevice is not imported, things work as expected. 2. If the package sounddevice is imported, but urllib.request.urlopen is called once prior to launching thee sub-process, then things also work as expected. I have attached a file containing code to reproduce the issue. I have run this example file in: - Python 3.7.9 (conda distribution) - Mac OS X 10.15.7 # Running the code as is reproduces the problem > python ./test_mp_req.py Nothing in the queue. Leave. wait for process to terminate... finished # Running the code with either line 8 commented *or* line 32 uncommented # gives the expected output > python ./test_mp_req.py Received https://api.github.com. Send GET request... done. Received https://www.google.com. Send GET request... done. https://api.github.com: ok https://www.google.com: ok Nothing in the queue. Leave. wait for process to terminate... finished ---------- components: Interpreter Core, Library (Lib), ctypes files: test_mp_req.py messages: 384562 nosy: fakufaku priority: normal severity: normal status: open title: Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package type: crash versions: Python 3.7 Added file: https://bugs.python.org/file49724/test_mp_req.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 01:39:43 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 07 Jan 2021 06:39:43 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. Message-ID: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> New submission from Mariusz Felisiak : We noticed a behavior change in Python3.10.0a4 (it works properly in Python3.10.0a3) when running Django's test suite[1]. Subclassing `enum.Enum` with `ipaddress.IPv4Network/IPv6Network` raises `TypeError`, e.g. >>> import enum >>> import ipaddress >>> class NewEnum(ipaddress.IPv4Address, enum.Enum): ... pass ... >>> class NewEnum(ipaddress.IPv4Network, enum.Enum): ... pass ... Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/enum.py", line 239, in __new__ enum_class.__bases__ = enum_class.__bases__[1:] #or (object, ) File "/usr/local/lib/python3.10/enum.py", line 483, in __setattr__ super().__setattr__(name, value) TypeError: __bases__ assignment: 'IPv4Network' object layout differs from '_NoInitSubclass' It still works for `ipaddress.IPv4Address/IPv6Address`. [1] https://github.com/django/django/blob/102d92fc09849e1a9004dd3f9a14a0ea9ca392cd/tests/model_enums/tests.py#L225-L235 ---------- components: Library (Lib) messages: 384563 nosy: barry, eli.bendersky, ethan.furman, felixxm priority: normal severity: normal status: open title: Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 01:47:34 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Thu, 07 Jan 2021 06:47:34 +0000 Subject: [issue42852] pprint fails in transformming non-breaking space Message-ID: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org> New submission from Xinmeng Xia : "pprint" can transform unicode like "print". However, pprint fails to transform non-breaking space('\240') . See the following example: Python 3.10.0a2 (default, Nov 24 2020, 14:18:46) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. Example 1(Results as expected): --------------------------------------------------------------------- >>> import pprint >>> print(u'\041 hello') ! hello >>> pprint.pprint(u'\041 hello') '! hello' Example 2(Results not as expected): --------------------------------------------------------------------- >>> print(u'\240 hello') hello >>> pprint.pprint(u'\240 hello') '\xa0 hello' Expected output: the output of pprint.pprint(u'\240 hello') should be consistent with output of print(u'\240 hello') ---------- components: Unicode messages: 384564 nosy: ezio.melotti, vstinner, xxm priority: normal severity: normal status: open title: pprint fails in transformming non-breaking space type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:03:09 2021 From: report at bugs.python.org (Andrew MacDonald) Date: Thu, 07 Jan 2021 08:03:09 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB Message-ID: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> New submission from Andrew MacDonald : When attempting to read a large file (> 2GB) over HTTPS the read fails with "OverflowError: signed integer is greater than maximum". This occurs with Python >=3.8 and I've been able to reproduce the problem with the below snippet of code on Linux, Mac OS X, and Windows (the remote file can be any HTTPS hosted file larger than 2GB, e.g. an empty file generated with `dd if=/dev/zero of=2g.img bs=1 count=0 seek=2G` will also do the job.). ``` import http.client connection = http.client.HTTPSConnection("mirror.aarnet.edu.au") connection.request("GET", "/pub/centos/8/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso") response = connection.getresponse() data = response.read() ``` Doing a git bisect it looks like this is the result of a change in commit d6bf6f2d0c83f0c64ce86e7b9340278627798090 (https://github.com/python/cpython/commit/d6bf6f2d0c83f0c64ce86e7b9340278627798090). Looking over the associated issue and commit message it seems like this was not an intended outcome for the change. ---------- assignee: christian.heimes components: SSL messages: 384565 nosy: amacd31, christian.heimes priority: normal severity: normal status: open title: `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:07:32 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 08:07:32 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1610006852.28.0.0489959238997.issue42853@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> methane components: +Library (Lib) -SSL nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:15:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 08:15:02 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1610007302.5.0.0628458148011.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: I cannot lift the overflow restriction until we drop support for OpenSSL 1.0.2. The function SSL_write() and SSL_read() are limited to signed 32bit int. OpenSSL 1.1.1 has new SSL_write_ex() and SSL_read_ex() functions that support size_t. Even size_t limits the maximum value to unsigned 32bit (~4GB) on 32bit systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:23:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 08:23:09 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() Message-ID: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> New submission from Christian Heimes : SSL_read() and SSL_write() are limited to int. The new SSL_write_ex() and SSL_read_ex() APIs support size_t just like read(2) and recv(2). Also see bpo-42853. int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written); int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes); Both functions return 1 for success or 0 for failure. ---------- assignee: christian.heimes components: SSL messages: 384567 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:35:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 08:35:16 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1610008516.08.0.191729164419.issue42854@roundup.psfhosted.org> Christian Heimes added the comment: As of version 3.3.1, LibreSSL does not have SSL_write_ex() and SSL_read_ex(). The read and write functions are limited to int. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:54:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 08:54:20 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1610009660.69.0.418479326161.issue42035@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 03:56:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 08:56:24 +0000 Subject: [issue42852] pprint fails in transformming non-breaking space In-Reply-To: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org> Message-ID: <1610009784.31.0.343778346586.issue42852@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 04:23:21 2021 From: report at bugs.python.org (gaborjbernat) Date: Thu, 07 Jan 2021 09:23:21 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input Message-ID: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> New submission from gaborjbernat : ? py -c "from pathlib import Path; Path('http://w.org').exists()" Traceback (most recent call last): File "", line 1, in File "C:\Python39\lib\pathlib.py", line 1407, in exists self.stat() File "C:\Python39\lib\pathlib.py", line 1221, in stat return self._accessor.stat(self) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'http:\\w.org' The above code returns correctly False on UNIX systems. ---------- components: Windows messages: 384569 nosy: gaborjbernat, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pathlib.exists on Windows raises an exception on URL like/bad input versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 04:33:57 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 07 Jan 2021 09:33:57 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610012037.67.0.505495940875.issue42855@roundup.psfhosted.org> Paul Moore added the comment: It's an invalid filename so it raises an exception. You can get the same on Unix by using an invalid filename (embedded null): >>> from pathlib import Path >>> Path("/usr/\0").exists() Traceback (most recent call last): ? File "", line 1, in ? File "/usr/lib64/python3.7/pathlib.py", line 1356, in exists ? ? self.stat() ? File "/usr/lib64/python3.7/pathlib.py", line 1178, in stat ? ? return self._accessor.stat(self) ValueError: embedded null byte You need to be prepared for exceptions if you aren't sure you have a valid path. One thing that might be useful, I guess, is a `Path.is_valid()` function. But I don't know if all platforms have a way of asking the OS "is this a valid pathname?" So catching the exception is probably best. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 04:39:34 2021 From: report at bugs.python.org (gaborjbernat) Date: Thu, 07 Jan 2021 09:39:34 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610012374.41.0.898421684526.issue42855@roundup.psfhosted.org> gaborjbernat added the comment: How come the link is invalid on Windows but valid on UNIX? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 04:45:07 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 07 Jan 2021 09:45:07 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610012707.76.0.167898269168.issue42855@roundup.psfhosted.org> Paul Moore added the comment: "http:" isn't a valid drive letter, I'd imagine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 04:55:59 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Thu, 07 Jan 2021 09:55:59 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610013359.74.0.761489517899.issue42855@roundup.psfhosted.org> Dominic Davis-Foster added the comment: Paul's example with the embedded null no longer works on Python 3.8 as Path.exists returns False on ValueError (added in gh-7695) Path.exists already ignores some Windows-specific errors, so I don't see why it shouldn't also ignore invalid paths which can't exist. ---------- nosy: +domdfcoding2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 05:29:33 2021 From: report at bugs.python.org (Yair Frid) Date: Thu, 07 Jan 2021 10:29:33 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1610015373.55.0.711916120406.issue42811@roundup.psfhosted.org> Change by Yair Frid : ---------- pull_requests: +22977 pull_request: https://github.com/python/cpython/pull/24149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 05:47:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 07 Jan 2021 10:47:41 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1610016461.28.0.566395979866.issue42848@roundup.psfhosted.org> Irit Katriel added the comment: Yes I'll have a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 05:54:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 07 Jan 2021 10:54:48 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1610016888.41.0.506205302466.issue42823@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +22978 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/24150 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:08:12 2021 From: report at bugs.python.org (karl) Date: Thu, 07 Jan 2021 11:08:12 +0000 Subject: [issue19683] test_minidom has many empty tests In-Reply-To: <1385047059.66.0.790496754317.issue19683@psf.upfronthosting.co.za> Message-ID: <1610017692.76.0.148522809597.issue19683@roundup.psfhosted.org> karl added the comment: These methods are not used anywhere in the code. https://github.com/python/cpython/blob/5c30145afb6053998e3518befff638d207047f00/Lib/xml/dom/minidom.py#L71-L80 What was the purpose when they were created? hmm maybe blame would give clue. Ah they were added a long time ago https://github.com/python/cpython/commit/73678dac48e5858e40cba6d526970cba7e7c769c#diff-365c30899ded02b18a2d8f92de47af6ca213eefe7883064c8723598da600ea42R83-R88 but never used? or was it in the spirit to reserve the keyword for future use? https://developer.mozilla.org/en-US/docs/Web/API/Node/firstChild ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:12:55 2021 From: report at bugs.python.org (karl) Date: Thu, 07 Jan 2021 11:12:55 +0000 Subject: [issue19683] test_minidom has many empty tests In-Reply-To: <1385047059.66.0.790496754317.issue19683@psf.upfronthosting.co.za> Message-ID: <1610017975.97.0.753117399675.issue19683@roundup.psfhosted.org> karl added the comment: Ah no. They ARE used through defproperty and minicompat.py get = getattr(klass, ("_get_" + name)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:21:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 11:21:06 +0000 Subject: [issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory Message-ID: <1610018466.49.0.695886938784.issue42856@roundup.psfhosted.org> New submission from STINNER Victor : The Fedora packaging policy recommends to "unbundle" bundled dependencies. "Fedora packages SHOULD make every effort to avoid having multiple, separate, upstream projects bundled together in a single package." https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling The main motivation is to ease updates when fix serious vulnerabilities (less packaging work). The ensurepip package contains bundled wheel packages of setuptools and pip: $ ls Lib/ensurepip/_bundled/ pip-20.2.3-py2.py3-none-any.whl setuptools-47.1.0-py3-none-any.whl The Fedora python3 package doesn't contain the ensurepip._bundled package: $ python3 Python 3.9.1 (default, Dec 8 2020, 00:00:00) >>> import ensurepip._bundled ModuleNotFoundError: No module named 'ensurepip._bundled' Instead, a separated RPM package python-pip-wheel provides wheel packages in /usr/share/python-wheels/ directory: $ ls /usr/share/python-wheels/ pip-20.2.2-py2.py3-none-any.whl* setuptools-49.1.3-py3-none-any.whl* wheel-0.34.2-py2.py3-none-any.whl* Fedora has a downstream patch on ensurepip (written by Miro Hron?ok) to always use /usr/share/python-wheels/: https://src.fedoraproject.org/rpms/python3.10/blob/master/f/00189-use-rpm-wheels.patch Fedora has packages of 9 CPython versions: 2.6, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10. https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html Having a separated package for wheel packages allows us to upgrade a single package (python-pip-wheel) for setuptools/pip bugfix or security vulnerability. -- I propose to add a new --with-wheel-pkg-dir=PATH option to the ./configure script. If used, ensurepip will only use wheel packages from this directory. Otherwise, the existing code is unchanged. In short, the behavior is unchanged, unless the option is used explicitly. If a directory is specified but wheel packages are missing, ensurepip fails. If the directory contains multiple wheel packages of different versions, the most recent version is used of each package. Note: In practice, the Fedora package only provides a single wheel package of each Python module. But I propose to make the Python upstream code as generic as possible. I'm working on a pull request to implement this. Downstream Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=1874803 -- Fedora (Miro) already contributed to ensurepip to make ensurepip less dependent on pip internals: commit 88f82b2b9ea3514359cb6e3218121f75334063ac Author: Miro Hron?ok Date: Tue Mar 10 22:16:28 2020 +0100 bpo-38662: ensurepip invokes pip via runpy (GH-18901) The ensurepip module now invokes pip via the runpy module. Hence it is no longer tightly coupled with the internal API of the bundled pip version, allowing easier updates to a newer pip version both internally and for distributors. This way, any changes to the internal pip API won't mean ensurepip needs to be changed as well. Also, distributors can update their pip wheels independent on CPython release schedule. Co-Authored-By: Pradyun Gedam Co-Authored-By: Miro Hron?ok This change was already related to Fedora downstream change to get wheel packages from a different directory. Fedora can use a different pip version (older or more recent) than ensurepip._bundled. ---------- components: Library (Lib) messages: 384577 nosy: vstinner priority: normal severity: normal status: open title: ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:26:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 11:26:59 +0000 Subject: [issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory In-Reply-To: <1610018466.49.0.695886938784.issue42856@roundup.psfhosted.org> Message-ID: <1610018819.99.0.177803695856.issue42856@roundup.psfhosted.org> STINNER Victor added the comment: > If used, ensurepip will only use wheel packages from this directory. An alternative is to find packages in all directories and pick the most recent version. Example with a specified directory *and* ensurepip._bundled is available: * wheel package directory: * pip 20.2.2 * setuptools 49.1.3 * wheel 0.34.2 * ensurepip._bundled * pip 20.2.3 * setuptools 47.1.0 Most recent versions: * pip 20.2.3 from ensurepip._bundled * setuptools 49.1.3 from the wheel package directory Problem: I'm not sure that pip is fully compatible with any setuptools version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:33:04 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 07 Jan 2021 11:33:04 +0000 Subject: [issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory In-Reply-To: <1610018466.49.0.695886938784.issue42856@roundup.psfhosted.org> Message-ID: <1610019184.45.0.849919086122.issue42856@roundup.psfhosted.org> Miro Hron?ok added the comment: For simplicity, I would avoid mixing wheels from 2 different directories. ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:42:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 07 Jan 2021 11:42:48 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1610019768.68.0.283644061815.issue42725@roundup.psfhosted.org> Mark Shannon added the comment: What's the process for making a decision on whether to make 'yield' in an annotation a syntax error? As a language change it should have a PEP, IMO. The PEP will be short, and shouldn't need a long-winded acceptance process. I just think that a PEP is more visible to the community than the bug tracker. I'm happy to write the PEP. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:49:48 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Thu, 07 Jan 2021 11:49:48 +0000 Subject: [issue42857] Fails to construct paths lead to "python is likely shutting down" Message-ID: <1610020188.09.0.60258603326.issue42857@roundup.psfhosted.org> New submission from Xinmeng Xia : The attached file "test_zipfile.py" is from test directory in cPython. We delete irrelevant code. Running this code on Python 3.10 will lead to the following error messages. ---------------------------------------------------------------------------------------- Exception ignored in: Traceback (most recent call last): File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree ImportError: sys.meta_path is None, Python is likely shutting down Exception ignored in: Traceback (most recent call last): File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree ImportError: sys.meta_path is None, Python is likely shutting down ---------------------------------------------------------------------------------------- The expected output should be something like" ImportError: No module named XXX" rather than "Python is likely shutting down" ---------- components: Interpreter Core files: test_zipfile.py messages: 384581 nosy: xxm priority: normal severity: normal status: open title: Fails to construct paths lead to "python is likely shutting down" type: crash versions: Python 3.10 Added file: https://bugs.python.org/file49725/test_zipfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:52:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 11:52:55 +0000 Subject: [issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory In-Reply-To: <1610018466.49.0.695886938784.issue42856@roundup.psfhosted.org> Message-ID: <1610020375.73.0.182741763062.issue42856@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes, dstufft, ncoghlan, pradyunsg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:54:25 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Thu, 07 Jan 2021 11:54:25 +0000 Subject: [issue42858] Incorrect return value for os.system() in recognizing import error Message-ID: <1610020465.58.0.34787573132.issue42858@roundup.psfhosted.org> New submission from Xinmeng Xia : Running attached "test_zipfile.py" on Python 3.10 will lead to the following error messages: ---------------------------------------------------------------------------------------------------- Exception ignored in: Traceback (most recent call last): File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree ImportError: sys.meta_path is None, Python is likely shutting down Exception ignored in: Traceback (most recent call last): File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree ImportError: sys.meta_path is None, Python is likely shutting down ---------------------------------------------------------------------------------------------------- However, if we run this program with os.system, the return value is 0 instead of 256. 0 represent no fails in this running! This is obviously incorrect. Reproduce: ========================================= import os scode = os.system('python310 test_zipfile.py') print("The system code of this execution is:", scode) ========================================= The expected output: "The system code of this execution is: 256" The actual output: "The system code of this execution is: 0" Version info: >>python310 -V Python 3.10.0a2 >>uname -v 16.04.1-Ubuntu SMP Fri Sep 13 09:56:18 UTC 2019 ---------- components: Library (Lib) files: test_zipfile.py messages: 384582 nosy: xxm priority: normal severity: normal status: open title: Incorrect return value for os.system() in recognizing import error versions: Python 3.10 Added file: https://bugs.python.org/file49726/test_zipfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:54:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 11:54:30 +0000 Subject: [issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory In-Reply-To: <1610018466.49.0.695886938784.issue42856@roundup.psfhosted.org> Message-ID: <1610020470.72.0.787235285713.issue42856@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +22979 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24151 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:54:53 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Thu, 07 Jan 2021 11:54:53 +0000 Subject: [issue42858] Incorrect return value for os.system() in recognizing import error In-Reply-To: <1610020465.58.0.34787573132.issue42858@roundup.psfhosted.org> Message-ID: <1610020493.82.0.896749626494.issue42858@roundup.psfhosted.org> Change by Xinmeng Xia : ---------- type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 06:59:56 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 07 Jan 2021 11:59:56 +0000 Subject: [issue42852] pprint fails in transformming non-breaking space In-Reply-To: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org> Message-ID: <1610020796.56.0.161864241805.issue42852@roundup.psfhosted.org> Steven D'Aprano added the comment: By the way, there is no need to use the u'' prefix on strings in Python 3. Unfortunately, I think this is a case where pprint doesn't meet your expectations. pprint is designed to print the repr of a string, while regular print prints the human-visible str: >>> print(repr('\240 hello')) '\xa0 hello' >>> print('\240 hello') ? hello Its not just non-breaking space, it also includes ASCII characters: >>> print(repr('\01 hello')) '\x01 hello' >>> print('\01 hello') hello >>> pprint.pprint('\01 hello') '\x01 hello' So this is intentional behaviour, not a bug. If you want to change the behaviour, it will probably require a re-design of the way strings are printed by the pprint module. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:04:38 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 07 Jan 2021 13:04:38 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610024678.14.0.597474308116.issue42855@roundup.psfhosted.org> Eryk Sun added the comment: > "http:" isn't a valid drive letter, I'd imagine. It's not a valid DOS drive, but that's not the problem. "http://w.org" is parsed as a relative path. The double slashes are replaced by a single backslash, and the Windows API tries to open the path relative to a handle for the current working directory. The issue is handling a path component named "http:". Some filesystems such as FAT32 reserve ":" as an invalid name character. Others such as NTFS and ReFS reserve ":" as the stream delimiter [1], and "http:" is not a valid stream name. I'm on the fence about how to handle names that the OS rejects as invalid in a boolean context (e.g. exists, isfile, etc). In one sense, returning False is reasonable because an invalid name cannot exist. But on the other hand, asking whether something that's invalid exists is a nonsense question that warrants an exception. That said, the issue has already been decided multiple times in favor of returning False, so at this point that's a pattern that should be consistently supported by the standard library. Note that a filesystem may allow ":" as name character, such as the VirtualBox shared-folder filesystem redirector. But the latter brings up yet another twist. Adding a redirector into the device stack, and thus including the MUP (multiple UNC provider) device, brings along more path-parsing baggage. In this case a component name with ":" in it fails as bad syntax, which gets mapped to WinAPI ERROR_BAD_PATHNAME (161), and thus C ENOENT, and ultimately FileNotFoundError in Python. This is the case regardless of the filesystem. For example, let's use the SMB redirector to set the "//localhost/C$" share for the "C:" drive as the working directory: >>> os.chdir('//localhost/C$') >>> os.stat('http://w.org') Traceback (most recent call last): File "", line 1, in FileNotFoundError: [WinError 161] The specified path is invalid: 'http://w.org' >>> Path('http://w.org').exists() False --- [1] https://docs.microsoft.com/en-us/windows/win32/fileio/file-streams ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:15:23 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 07 Jan 2021 13:15:23 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610025323.27.0.257879190758.issue42855@roundup.psfhosted.org> Paul Moore added the comment: So I guess the key question then is whether Path.exists() should trap exceptions and interpret them as "does not exist" (on all platforms, although it looks like the null character case in Unix has now been fixed). Which doesn't seem unreasonable, I guess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:38:33 2021 From: report at bugs.python.org (Barney Stratford) Date: Thu, 07 Jan 2021 13:38:33 +0000 Subject: [issue42513] Socket.recv hangs In-Reply-To: <1606737349.78.0.516615398151.issue42513@roundup.psfhosted.org> Message-ID: <1610026713.71.0.463056459395.issue42513@roundup.psfhosted.org> Barney Stratford added the comment: The instrumented code froze today, so I'm finally able to probe the bug. Despite what that website said, it's looking like checking the return fron the poll syscall isn't the problem here. I'm probably going to close this bug report as not a bug, but want to check fully before I do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:43:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 13:43:49 +0000 Subject: [issue42858] Incorrect return value for os.system() in recognizing import error In-Reply-To: <1610020465.58.0.34787573132.issue42858@roundup.psfhosted.org> Message-ID: <1610027029.82.0.84004945673.issue42858@roundup.psfhosted.org> Christian Heimes added the comment: The exceptions are ignored (Exception ignored in) on shutdown and therefore don't cause the interpreter to fail with an error code. Unraisable exceptions typically occur when the interpreter is mostly shut down and garbage collection, import or atexit hook is triggered as a side-effect. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:48:32 2021 From: report at bugs.python.org (karl) Date: Thu, 07 Jan 2021 13:48:32 +0000 Subject: [issue19683] test_minidom has many empty tests In-Reply-To: <1385047059.66.0.790496754317.issue19683@psf.upfronthosting.co.za> Message-ID: <1610027312.59.0.238071604785.issue19683@roundup.psfhosted.org> Change by karl : ---------- pull_requests: +22980 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/24152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 08:59:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 13:59:53 +0000 Subject: [issue42858] Incorrect return value for os.system() in recognizing import error In-Reply-To: <1610020465.58.0.34787573132.issue42858@roundup.psfhosted.org> Message-ID: <1610027993.04.0.0301047672994.issue42858@roundup.psfhosted.org> STINNER Victor added the comment: See also https://docs.python.org/dev/library/sys.html#sys.unraisablehook ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 09:35:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 07 Jan 2021 14:35:00 +0000 Subject: [issue42852] pprint fails in transformming non-breaking space In-Reply-To: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org> Message-ID: <1610030100.91.0.61587204322.issue42852@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 09:35:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 07 Jan 2021 14:35:12 +0000 Subject: [issue42852] pprint fails in transformming non-breaking space In-Reply-To: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org> Message-ID: <1610030112.21.0.178184812853.issue42852@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: fixed -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 09:39:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 07 Jan 2021 14:39:28 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1610030368.88.0.66816360282.issue42725@roundup.psfhosted.org> Serhiy Storchaka added the comment: Should not "await" and "async for" (in comprehesions) and ":=" be forbidden too? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 09:47:44 2021 From: report at bugs.python.org (Sebastian Voigt) Date: Thu, 07 Jan 2021 14:47:44 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1610030864.99.0.0755378882301.issue41837@roundup.psfhosted.org> Sebastian Voigt added the comment: The fix has only be done for 3.8, 3.9 and 3.10. Are 3.7 and 3.6 are not impacted? ---------- nosy: +squear _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 09:48:50 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 07 Jan 2021 14:48:50 +0000 Subject: [issue42783] asyncio.sleep(0) idiom is not documented In-Reply-To: <1609270826.19.0.331548885122.issue42783@roundup.psfhosted.org> Message-ID: <1610030930.73.0.0587374080768.issue42783@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +22981 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/24153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 10:06:37 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 07 Jan 2021 15:06:37 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610031997.25.0.900378546248.issue42851@roundup.psfhosted.org> Ethan Furman added the comment: That would be due to some changes to try and get `Enum` and `__init_subclass__` to work together. I'll revert those changes. Thank you for the report. ---------- assignee: -> ethan.furman priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 10:31:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 07 Jan 2021 15:31:43 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1i In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1610033503.17.0.558671333041.issue41837@roundup.psfhosted.org> Christian Heimes added the comment: They are impacted. However 3.7.9 and 3.6.8 were the last releases with binaries for Windows and macOS. All subsequent releases are source-only releases. Since we don't release binaries for 3.6 and 3.7 any more, we typically don't update them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 11:08:42 2021 From: report at bugs.python.org (Barney Stratford) Date: Thu, 07 Jan 2021 16:08:42 +0000 Subject: [issue42513] Socket.recv hangs In-Reply-To: <1606737349.78.0.516615398151.issue42513@roundup.psfhosted.org> Message-ID: <1610035722.66.0.204952984923.issue42513@roundup.psfhosted.org> Barney Stratford added the comment: Instrumented code shows that the poll is in fact working completely correctly, and I've run into a documented edge-case in an unrelated area. Hence, closing the bug report and cancelling the pull request. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 11:13:41 2021 From: report at bugs.python.org (Jakub Stasiak) Date: Thu, 07 Jan 2021 16:13:41 +0000 Subject: [issue42513] Socket.recv hangs In-Reply-To: <1606737349.78.0.516615398151.issue42513@roundup.psfhosted.org> Message-ID: <1610036021.68.0.383959363607.issue42513@roundup.psfhosted.org> Jakub Stasiak added the comment: If the edge-case is vaguely socket/file descriptor-related and not application-specific or otherwise secret do you mind sharing what is it? (I'm just curious) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 11:51:41 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 07 Jan 2021 16:51:41 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610038301.12.0.831848297329.issue42855@roundup.psfhosted.org> Steve Dower added the comment: Yeah, I think saying "return True if it provably exists and False if existence cannot be proven (and never raise)" is a good general rule for boolean-returning functions. This definitely raises some edge cases where we can infer from certain error codes that a path exists, but I don't think it obliges us to prioritise fixing those in order to handle more obvious cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 11:53:45 2021 From: report at bugs.python.org (Barney Stratford) Date: Thu, 07 Jan 2021 16:53:45 +0000 Subject: [issue42513] Socket.recv hangs In-Reply-To: <1606737349.78.0.516615398151.issue42513@roundup.psfhosted.org> Message-ID: <1610038425.1.0.0948556025131.issue42513@roundup.psfhosted.org> Barney Stratford added the comment: Sure. So, I'm using STOMP to connect to a messaging server. STOMP uses heartbeats to detect and close failed connections. The problem was that if the connection fails before the protocol has set up its heartbeats then there's nothing to stop the whole thing hanging. I had a timeout on the socket.create_connection, thinking this would protect against this edge-case, but it wasn't sufficient. STOMP is such a simple protocol that it's often worth writing your own code to handle it. Indeed, this is actively encouraged. My own STOMP code is about 250 lines in a single source file, compared to nearly 3500 lines in 13 files for stomp.py. I very much prefer to simplify things as much as possible, and smaller is almost always better in my view. Simplify! So, I kept seeing this very occasional hang-up in my code, and probing it with gdb showed that the execution was always stuck inside the poll. Of course it was, as that's where it sits to wait for something to happen. Then I was lead astray by finding that website, so I saddled up to save the world, as one does in such situations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 12:30:44 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 07 Jan 2021 17:30:44 +0000 Subject: [issue42855] pathlib.exists on Windows raises an exception on URL like/bad input In-Reply-To: <1610011401.69.0.814272139734.issue42855@roundup.psfhosted.org> Message-ID: <1610040644.84.0.270003892808.issue42855@roundup.psfhosted.org> Eryk Sun added the comment: An alternative would be to add a "strict" parameter that defaults to False. In non-strict mode, map all OSError exceptions to a False return value. In strict mode, use _ignore_error(e) to determine whether to return False or propagate the exception. The question then is whether to add ERROR_INVALID_NAME (123) to _IGNORED_WINERRORS since the error means the name can never exist. On the other hand, ERROR_ACCESS_DENIED due to a permission error would be propagated in strict mode -- because the path's existence is unknown. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 13:06:22 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 07 Jan 2021 18:06:22 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1610042782.93.0.705045460173.issue42811@roundup.psfhosted.org> miss-islington added the comment: New changeset 8c3914aef47e6e5a31b48a0b1f165ec3f4dc4c98 by Yair Frid in branch '3.9': [3.9] bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100) (GH-24149) https://github.com/python/cpython/commit/8c3914aef47e6e5a31b48a0b1f165ec3f4dc4c98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 13:07:56 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 07 Jan 2021 18:07:56 +0000 Subject: [issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__ In-Reply-To: <1609619279.01.0.578638244778.issue42811@roundup.psfhosted.org> Message-ID: <1610042876.91.0.493351400509.issue42811@roundup.psfhosted.org> Brett Cannon added the comment: New changeset ca8e96d1edbeb536f58da91e607082463398fce1 by Miss Islington (bot) in branch '3.8': bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100) (GH-24144) https://github.com/python/cpython/commit/ca8e96d1edbeb536f58da91e607082463398fce1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 14:28:50 2021 From: report at bugs.python.org (Dmitry Goldenberg) Date: Thu, 07 Jan 2021 19:28:50 +0000 Subject: [issue42859] smtplib: recipe for certifying message delivery Message-ID: <1610047730.69.0.693075661816.issue42859@roundup.psfhosted.org> New submission from Dmitry Goldenberg : Is there a reliable way to certify (ensure, track) the delivery of an email message when using smtplib? For example: Disposition-Notification-To message header which enables the e-mail reader of the recipient to send confirmation e-mail when the recipient opens the message for the first time. That e-mail reader program must support this functionality. Return-Receipt-To message header which enables the e-mail server of the recipient to send confirmation e-mail when the original e-mail gets received by that server. However, most newer e-mail servers do not support Return-Receipt-To header. Are these message headers at all reliable? The request is to enhance the documentation to provide an example of how to track a message delivery. Conversely, if it's plain not possible, the request is to state that explicitly in the docs. ---------- assignee: docs at python components: Documentation messages: 384600 nosy: dgoldenberg123, docs at python priority: normal severity: normal status: open title: smtplib: recipe for certifying message delivery type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 15:31:05 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 07 Jan 2021 20:31:05 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610051465.74.0.51107090912.issue42851@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +22982 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:01:50 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 21:01:50 +0000 Subject: [issue42859] smtplib: recipe for certifying message delivery In-Reply-To: <1610047730.69.0.693075661816.issue42859@roundup.psfhosted.org> Message-ID: <1610053310.61.0.909050008145.issue42859@roundup.psfhosted.org> Guido van Rossum added the comment: This looks more like a question than an issue. Have you tried stackoverflow or a user forum? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:07:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 21:07:44 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1610053664.67.0.22092570544.issue42725@roundup.psfhosted.org> Guido van Rossum added the comment: I wouldn?t have thought you?d need a PEP for this but if you want to write one that sounds like the right thing. Re: async and walrus: I think those are different, their presence doesn?t affect the meaning of the function like yield. We can?t hope to prevent side effects syntactically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:09:27 2021 From: report at bugs.python.org (Tobias Kohn) Date: Thu, 07 Jan 2021 21:09:27 +0000 Subject: [issue42860] Incompatible types in Python grammar Message-ID: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> New submission from Tobias Kohn : There seems to be a small type error in the Python grammar in the rule `invalid_parameters`: ``` invalid_parameters: | param_no_default* (slash_with_default | param_with_default+) param_no_default ``` While the `slash_with_default` returns a single element, the `param_with_default` returns a list/sequence. ---------- messages: 384603 nosy: tobias.kohn priority: normal severity: normal status: open title: Incompatible types in Python grammar versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:09:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 21:09:53 +0000 Subject: [issue42858] Incorrect return value for os.system() in recognizing import error In-Reply-To: <1610020465.58.0.34787573132.issue42858@roundup.psfhosted.org> Message-ID: <1610053793.83.0.239603190485.issue42858@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:11:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 21:11:57 +0000 Subject: [issue42857] Fails to construct paths lead to "python is likely shutting down" In-Reply-To: <1610020188.09.0.60258603326.issue42857@roundup.psfhosted.org> Message-ID: <1610053917.65.0.690129682152.issue42857@roundup.psfhosted.org> Guido van Rossum added the comment: You are doing something very evil during finalization here. There?s nothing that can be done reasonably. ---------- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:18:15 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 07 Jan 2021 21:18:15 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610054295.78.0.801652108199.issue42851@roundup.psfhosted.org> Ethan Furman added the comment: New changeset a581a868d97f649aedf868a1d27865a10925c73a by Ethan Furman in branch 'master': bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) https://github.com/python/cpython/commit/a581a868d97f649aedf868a1d27865a10925c73a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:25:19 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 07 Jan 2021 21:25:19 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610054719.06.0.349564548286.issue42851@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +22983 pull_request: https://github.com/python/cpython/pull/24155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:27:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 07 Jan 2021 21:27:18 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610054838.42.0.274825867348.issue42850@roundup.psfhosted.org> Guido van Rossum added the comment: I would assume it?s some interaction between threads and fork. Have you asked the authors of sound device about this? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:52:26 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 07 Jan 2021 21:52:26 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610056346.77.0.165498828571.issue42846@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I'm unable to reproduce this on Windows 10 (amd64). What's your exact locale setting? Are you compiling with HEAD at 0b858cdd5d114f0890b11b6c4d6559d0ceb468ab? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 16:56:05 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 07 Jan 2021 21:56:05 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610056565.84.0.532321274272.issue42851@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 9ab4dd452287169f08a8cf4d4c68c2139f8de714 by Ethan Furman in branch '3.9': [3.9] bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) (GH-24155) https://github.com/python/cpython/commit/9ab4dd452287169f08a8cf4d4c68c2139f8de714 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:00:25 2021 From: report at bugs.python.org (Dmitry Goldenberg) Date: Thu, 07 Jan 2021 22:00:25 +0000 Subject: [issue42859] smtplib: recipe for certifying message delivery In-Reply-To: <1610047730.69.0.693075661816.issue42859@roundup.psfhosted.org> Message-ID: <1610056825.35.0.356165169043.issue42859@roundup.psfhosted.org> Dmitry Goldenberg added the comment: Yes, it's a question which could lend itself well to a documentation issue. I've looked at things like: https://stackoverflow.com/questions/54047021/python-smtplib-how-to-use-disposition-notification-to https://stackoverflow.com/questions/40369645/detect-bounced-emails-in-python-smtplib But I'm not seeing a generic approach which would let me prove messages got to the destination. It seems Disposition-Notification-To is not always available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:06:25 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 07 Jan 2021 22:06:25 +0000 Subject: [issue42860] Incompatible types in Python grammar In-Reply-To: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> Message-ID: <1610057185.58.0.710108659377.issue42860@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:10:07 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 07 Jan 2021 22:10:07 +0000 Subject: [issue42860] Incompatible types in Python grammar In-Reply-To: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> Message-ID: <1610057407.61.0.343083196911.issue42860@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- keywords: +patch pull_requests: +22984 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:14:16 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 07 Jan 2021 22:14:16 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1610057656.1.0.245208026149.issue42837@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:18:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 22:18:28 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610057908.23.0.0613650740301.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: I can reproduce the issue on Windows configured in Japanese language: ANSI code page cp932. I managed to reproduce the bug on Linux with attached bug.py ---------- Added file: https://bugs.python.org/file49727/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:21:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 22:21:36 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610058096.59.0.339991025407.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: It took me a while to understand it, the _multibytecodec module itself is fine. The issue comes from the _codecs_jp module which uses the legacy module API: codec = _codecs_jp.getcodec('cp932') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:24:28 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 07 Jan 2021 22:24:28 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1610058268.27.0.174592242083.issue42837@roundup.psfhosted.org> Batuhan Taskaya added the comment: Well even though I still don't understand 'how this issue is different than issue42725', I don't think you actually fix the symbol table; see this one: https://bugs.python.org/msg383659 Annotations still have side effects on the symbol table (even though they shouldn't have). and I already had a fix but decided not to go for it until issue42737 is resolved since it would make the language inconsistent. Just FYI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:25:30 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 07 Jan 2021 22:25:30 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610058330.72.0.480770021379.issue42846@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: It should be sufficient to convert cjkcodecs.h to multi-phase init then? From what I can see, the support modules are state less, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:31:56 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 07 Jan 2021 22:31:56 +0000 Subject: [issue42860] Incompatible types in Python grammar In-Reply-To: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> Message-ID: <1610058716.38.0.308734138314.issue42860@roundup.psfhosted.org> miss-islington added the comment: New changeset 07dcd86ceed0bd88d1e96dcf53b1de2fea024385 by Lysandros Nikolaou in branch 'master': bpo-42860: Remove type error from grammar (GH-24156) https://github.com/python/cpython/commit/07dcd86ceed0bd88d1e96dcf53b1de2fea024385 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:33:05 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 07 Jan 2021 22:33:05 +0000 Subject: [issue42860] Incompatible types in Python grammar In-Reply-To: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> Message-ID: <1610058786.0.0.104795640676.issue42860@roundup.psfhosted.org> Lysandros Nikolaou added the comment: This is now fixed, Tobias! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:36:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 22:36:31 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610058991.51.0.592374517021.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: I'm working on a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:44:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 07 Jan 2021 22:44:26 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1610059466.77.0.632053735655.issue42725@roundup.psfhosted.org> Serhiy Storchaka added the comment: Does not walrus affect the meaning of variable? And await affects the meaning of generator expression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 17:45:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 22:45:55 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610059555.61.0.48990274045.issue42846@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +22985 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 18:05:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 23:05:41 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610060741.83.0.911035522238.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: Attached PR 24157 should fix the issue. > FAIL: test_daemon_threads_fatal_error (test.test_threading.SubinterpThreadingTests) This test runs code in a subinterpreter which is run in a subprocess. The problem is not in the code run in the subinterpreter, but the creation of sys.stdout in the subprocess. The test creates a subprocess and redirects its stdout and stderr. In this case, Python doesn't create a _io._WindowsConsoleIO for sys.stdout.buffer.raw, but a regular _io.FileIO object. When the raw I/O is a _WindowsConsoleIO instance, create_stdio() of Python/pylifecycle.c forces the usage of the UTF-8 encoding. But for FileIO, it keeps the locale encoding. If the locale encoding is "cp932", a CJK multicodec is used. In the main interpreter, it's fine. In a subinterpreter, we hit the bug of the _codecs_jp which doesn't use the new multi-phase initialization API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 18:08:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 23:08:48 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610060928.95.0.109934885023.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: Simpler way to reproduce the issue with t.py script: --- import test.support import sys import _testcapi print(f"{sys.stdout.encoding=}", file=sys.stderr) with test.support.SuppressCrashReport(): _testcapi.run_in_subinterp("pass") --- By default, UTF-8 is used, everything is fine: ----- C:\> python t.py sys.stdout.encoding='utf-8' ----- Disable _WindowsConsoleIO with PYTHONLEGACYWINDOWSSTDIO env var, we get the issue: ----- C:\> set PYTHONLEGACYWINDOWSSTDIO=1 C:\> python t.py Running Debug|x64 interpreter... sys.stdout.encoding='cp932' TypeError: codec is unexpected type Fatal Python error: (...) ----- Or redirect the output into a program or a file to disable _WindowsConsoleIO to also reproduce the issue: ----- C:\> python t.py|more sys.stdout.encoding='cp932' TypeError: codec is unexpected type (...) ----- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 18:13:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 23:13:00 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610061180.02.0.36322256817.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: Ah, if you don't want to change the ANSI code page to cp932 (Japanese language) just to reproduce the issue, you can just set the stdio encoding: ----- C:\> set PYTHONIOENCODING=cp932 C:\> python t.py|more sys.stdout.encoding='cp1250' TypeError: codec is unexpected type (...) ----- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 18:15:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 23:15:29 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610061329.84.0.657124720408.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 07f2cee93f1b619650403981c455f47bfed8d818 by Victor Stinner in branch 'master': bpo-42846: Convert CJK codec extensions to multiphase init (GH-24157) https://github.com/python/cpython/commit/07f2cee93f1b619650403981c455f47bfed8d818 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 18:18:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jan 2021 23:18:25 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610061505.24.0.678184589552.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: > 1) python -m test --verbose test_threading > 2) python -m test --verbose test_embed I ran manually these two tests with cp932 ANSI code page: they now pass with my fix. I also added a regression test to test_multibytecodec.py. Thanks for your quick bug report neonene! It's now fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:30:51 2021 From: report at bugs.python.org (Faisal Mahmood) Date: Fri, 08 Jan 2021 00:30:51 +0000 Subject: [issue42861] ipaddress - add ability to get next closet subnet of any prefix size Message-ID: <1610065851.06.0.929191666424.issue42861@roundup.psfhosted.org> New submission from Faisal Mahmood : The ipaddress module in Python is an excellent tool, but I noticed it is missing a feature that I needed several months ago, which is the ability to find the next closest subnet with a specific prefix length. For example, imagine I had a IPv4Network("10.10.0.72/30"), how would I find the next possible /25 address? It is not the most straightforward thing to do, so think it would be a great enhancement to the ipaddress library. I think this can be achieved by adding in a new method to the BaseNetwork class, the method could be defined like "next_prefix(next_prefix=None)". Calling this method would return an IPv4/v6 address that is the closest possible match with the new prefix (defined as next_prefix). Example calls: v4 = IPv4Network("10.10.0.72/30") next_network = v4.next_subnet(next_prefix=25) # Output: next_network = IPv4Network("10.10.0.128/25") v4 = IPv4Network("10.10.0.72/30") next_network = v4.next_subnet(next_prefix=30) # Output: next_network = IPv4Network("10.10.0.76/30") v4 = IPv4Network("10.10.0.72/30") next_network = v4.next_subnet() # if next_prefix is not defined it will use the existing prefix of /30, so this call is exactly the same as the previous # Output: next_network = IPv4Network("10.10.0.76/30") v6 = IPv6Network("2001:db8:aaaa:aaaa:aaaa:aaaa:aaaa:0000/112") next_network = v6.next_subnet() # Output: next_network = IPv6Network("2001:db8:aaaa:aaaa:aaaa:aaaa:aaab:0/112") v6 = IPv6Network("2001:db8:aaaa:aaaa:aaaa:aaaa:aaaa:0000/112") next_network = v6.next_subnet(next_prefix=64) # Output: next_network = IPv6Network("2001:db8:aaaa:aaab::/64") I am going to be working on this and plan to raise a PR soon. This is my first time contributing to Python, so I appreciate your help / comments / suggestions / guidance as I go along. ---------- components: Library (Lib) messages: 384623 nosy: fasial.mahmood94 priority: normal severity: normal status: open title: ipaddress - add ability to get next closet subnet of any prefix size type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:33:20 2021 From: report at bugs.python.org (Faisal Mahmood) Date: Fri, 08 Jan 2021 00:33:20 +0000 Subject: [issue42861] ipaddress - add ability to get next closet subnet of any prefix size In-Reply-To: <1610065851.06.0.929191666424.issue42861@roundup.psfhosted.org> Message-ID: <1610066000.01.0.532472580788.issue42861@roundup.psfhosted.org> Faisal Mahmood added the comment: Not sure how to edit an issue, but I made a mistake, where I said: "...Calling this method would return an IPv4/v6 address that is the closest possible match..." I meant to say: "...Calling this method would return an IPv4/v6 -NETWORK- that is the closest possible match..." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:39:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 00:39:03 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module Message-ID: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Pro: less code, less complexity, improved maintainability Con: minor performance hit PoC here: https://github.com/erlend-aasland/cpython/commits/sqlite-cache $ ./python.exe >>> import sqlite3 >>> con = sqlite3.connect(":memory:") >>> con.execute("select * from sqlite_master") >>> con.execute("select * from sqlite_master") >>> c = con.cache() >>> c.cache_info() CacheInfo(hits=1, misses=1, maxsize=128, currsize=1) The test suite runs approx. 10-20 ms slower with this change. Using _functools._lru_cache_wrapper iso. functools.lru_cache almost removes this performance regression. Berker, is it worth pursuing? ---------- components: Library (Lib) messages: 384625 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:41:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 00:41:45 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1610066505.77.0.441973169285.issue42848@roundup.psfhosted.org> Irit Katriel added the comment: So, we have a contact chain of length almost equal to the recursion limit, which is too much to process recursively in python (in c it does work, hence the difference between the outputs of the OP's two scripts). The PR removes recursion from TracebackException (in constructor as well as in format()). The code is less readable and I'm not sure this case is worth that. Should we instead truncate the output, ie add a limit on the recursion depth? (note that in this case this would remove the last "recursion depth exceeded" exception and show only some of the repetitive ones). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:42:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 00:42:38 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1610066558.54.0.176286250285.issue42848@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +22986 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 19:51:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 00:51:09 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1610067069.55.0.231455463045.issue42862@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Short diffstat: 8 files changed, 85 insertions(+), 406 deletions(-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 20:10:38 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 08 Jan 2021 01:10:38 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows Message-ID: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> New submission from Jeff Moguillansky : When creating a virtual environment on windows using venv, the folder structure: "Scripts", "Include", "Lib", is inconsistent with other platforms (e.g. "include", "lib", "bin", etc). This causes various integration issues. For example, suppose we want to build a native C library, and install it to the folder structure generated by the virtual environment. The pkg-config file assumes a folder structure of "include", "lib", "bin", and the generated pkg-config files are inconsistent with the python virtual environment folder structure. Can we have a consistent folder structure across platforms? ---------- components: Windows messages: 384628 nosy: jmoguill2, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python venv inconsistent folder structure on windows type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 21:38:02 2021 From: report at bugs.python.org (Desmond Cheong) Date: Fri, 08 Jan 2021 02:38:02 +0000 Subject: [issue14678] Update zipimport to support importlib.invalidate_caches() In-Reply-To: <1335462110.31.0.00575372691618.issue14678@psf.upfronthosting.co.za> Message-ID: <1610073482.09.0.494781658496.issue14678@roundup.psfhosted.org> Change by Desmond Cheong : ---------- keywords: +patch nosy: +desmondcheongzx nosy_count: 9.0 -> 10.0 pull_requests: +22987 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 21:38:31 2021 From: report at bugs.python.org (Robin Scheibler) Date: Fri, 08 Jan 2021 02:38:31 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610073511.74.0.191081212015.issue42850@roundup.psfhosted.org> Robin Scheibler added the comment: Thank you very much for the reply! I was indeed hesitating where to post the issue. I have now cross-posted in the sounddevice issue tracker. https://github.com/spatialaudio/python-sounddevice/issues/302 I'll update the issue if things progress on that side. The sounddevice is essentially a wrapper around the portaudio library, similar to pyaudio. I have tried the test code with an import of pyaudio rather than sounddevice, but the issue does not happen in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 22:03:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 08 Jan 2021 03:03:30 +0000 Subject: [issue42864] Improve error messages regarding unclosed parentheses Message-ID: <1610075010.91.0.684383999677.issue42864@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Consider this file: ``` x = ( ``` The error that we get is: ? python ../a.py File "/home/pablogsal/github/python/master/../a.py", line 6 ^ SyntaxError: unexpected EOF while parsin This is quite uninformative of the actual problem, which is the closed parentheses. The same happens with something like this: ( 1+2 File "/home/pablogsal/github/python/master/lel.py", line 3 ^ SyntaxError: unexpected EOF while parsing With some effort, we can include the location of the unclosed parentheses. ---------- messages: 384630 nosy: pablogsal priority: normal severity: normal status: open title: Improve error messages regarding unclosed parentheses versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 22:04:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 08 Jan 2021 03:04:15 +0000 Subject: [issue42864] Improve error messages regarding unclosed parentheses In-Reply-To: <1610075010.91.0.684383999677.issue42864@roundup.psfhosted.org> Message-ID: <1610075055.24.0.942147089867.issue42864@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +22988 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 22:04:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 08 Jan 2021 03:04:28 +0000 Subject: [issue42864] Improve error messages regarding unclosed parentheses In-Reply-To: <1610075010.91.0.684383999677.issue42864@roundup.psfhosted.org> Message-ID: <1610075068.23.0.428441120088.issue42864@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lys.nikolaou stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 22:52:18 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Fri, 08 Jan 2021 03:52:18 +0000 Subject: [issue42762] infinite loop resulted by "yield" In-Reply-To: <1609130295.32.0.912620547313.issue42762@roundup.psfhosted.org> Message-ID: <1610077938.53.0.33078172348.issue42762@roundup.psfhosted.org> Xinmeng Xia added the comment: I get a little confused. So is it a bug in Python 3.5 and 3.6? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 23:00:38 2021 From: report at bugs.python.org (Victor Lopez) Date: Fri, 08 Jan 2021 04:00:38 +0000 Subject: [issue42865] sysconfig appends CFLAGS to LD Message-ID: <1610078438.84.0.384790848261.issue42865@roundup.psfhosted.org> New submission from Victor Lopez : This should not happen as some CFLAGS are exclusive to the compiler and it will break cross-compiling linkers The proposed sysconfig is attached ---------- components: Distutils files: sysconfig.py messages: 384632 nosy: Greentwip, dstufft, eric.araujo priority: normal pull_requests: 22989 severity: normal status: open title: sysconfig appends CFLAGS to LD versions: Python 3.9 Added file: https://bugs.python.org/file49728/sysconfig.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 23:03:27 2021 From: report at bugs.python.org (Victor Lopez) Date: Fri, 08 Jan 2021 04:03:27 +0000 Subject: [issue42865] sysconfig appends CFLAGS to LD In-Reply-To: <1610078438.84.0.384790848261.issue42865@roundup.psfhosted.org> Message-ID: <1610078607.97.0.119455983331.issue42865@roundup.psfhosted.org> Victor Lopez added the comment: I'm updating this to comply with the GitHub PR policies ---------- keywords: +patch message_count: 1.0 -> 2.0 pull_requests: +22991 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 7 23:58:36 2021 From: report at bugs.python.org (naught101) Date: Fri, 08 Jan 2021 04:58:36 +0000 Subject: [issue25457] json dump fails for mixed-type keys when sort_keys is specified In-Reply-To: <1445500861.68.0.856599723102.issue25457@psf.upfronthosting.co.za> Message-ID: <1610081916.79.0.929455619641.issue25457@roundup.psfhosted.org> naught101 added the comment: I want to do something like this: hashlib.md5(json.dumps(d, sort_keys=True)) So I can check if a dict's contents are the same as a DB version, but I can't guarantee that all the keys are strings, so it breaks, annoyingly. I would very much like the apply-default-function-then-sort approach. Until then, my work-around is this: def deep_stringize_dict_keys(item): """Converts all keys to strings in a nested dictionary""" if isinstance(item, dict): return {str(k): deep_stringize_dict_keys(v) for k, v in item.items()} if isinstance(item, list): # This will check only ONE layer deep for nested dictionaries inside lists. # If you need deeper than that, you're probably doing something stupid. if any(isinstance(v, dict) for v in item): return [deep_stringize_dict_keys(v) if isinstance(v, dict) else v for v in item] # I don't care about tuples, since they don't exist in JSON return item Maybe it can be of some use for others. ---------- nosy: +naught101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 00:10:56 2021 From: report at bugs.python.org (Desmond Cheong) Date: Fri, 08 Jan 2021 05:10:56 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' In-Reply-To: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> Message-ID: <1610082656.89.0.652315548786.issue42818@roundup.psfhosted.org> Desmond Cheong added the comment: Could you provide some information about the system you're running this on? I might be wrong, but this does seem like an issue with this copy of setuptools. From the Traceback, it seems that line 2196 of /usr/lib/python3/dist-packages/pkg_resources/__init__.py runs `loader = importer.find_spec(packageName)` when trying to handle the AttributeError exception. However, this line should instead have run `loader = importer.find_module(packageName)` based on the source code https://github.com/pypa/setuptools/blob/95a9c474d30acc729b536f9ad88ead7efab62c5d/pkg_resources/__init__.py#L2190-L2197 Git blame also tells me that this fall-back has been implemented for a few years now. It also appears that the zipimporter.find_spec method is not implemented in Python3.9 and earlier. However, zipimporter.find_module has been implemented for at least Python3.8 onwards, if not earlier (https://github.com/python/cpython/blob/ca8e96d1edbeb536f58da91e607082463398fce1/Lib/zipimport.py#L139-L150). ---------- nosy: +desmondcheongzx _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 00:57:03 2021 From: report at bugs.python.org (Desmond Cheong) Date: Fri, 08 Jan 2021 05:57:03 +0000 Subject: [issue42798] pip search fails In-Reply-To: <1609442411.49.0.32642630503.issue42798@roundup.psfhosted.org> Message-ID: <1610085423.64.0.701969759045.issue42798@roundup.psfhosted.org> Desmond Cheong added the comment: Seems that this is due to PyPI's search API being disabled. https://github.com/pypa/pip/issues/5216#issuecomment-744605466 ---------- nosy: +desmondcheongzx _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 00:59:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 08 Jan 2021 05:59:05 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1610085545.46.0.472022840807.issue42725@roundup.psfhosted.org> Guido van Rossum added the comment: Oh, you?re right about walrus. And I don?t actually understand async generator expressions. This suggests that we definitely need a PEP. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 01:05:25 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 08 Jan 2021 06:05:25 +0000 Subject: [issue42836] docs: struct: clarify struct caching behaviour In-Reply-To: <1609923931.89.0.0226570295473.issue42836@roundup.psfhosted.org> Message-ID: <1610085925.85.0.879233786098.issue42836@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +22992 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24164 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 01:59:11 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Fri, 08 Jan 2021 06:59:11 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610089151.17.0.737237936077.issue42851@roundup.psfhosted.org> Mariusz Felisiak added the comment: Ethan, Thanks for the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 02:55:37 2021 From: report at bugs.python.org (Klaus Ethgen) Date: Fri, 08 Jan 2021 07:55:37 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' In-Reply-To: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> Message-ID: <1610092537.95.0.206637282745.issue42818@roundup.psfhosted.org> Klaus Ethgen added the comment: You are right. Generally I have the installation on devuan Linux, the unstable tree. But... In 2019-03-13 I started to patch this file as many python scripts started to fail due to the fact that they had the find_spec implemented. This was still true in Apr 2020, when I had to renew the patch. And let me say, many failed; not only the egg part. I don't know where I found the patch at first but it worked now for nearly two years. I did revert it now and for the moment, the scripts that I remember was failing, seems to work now. Let me say that this find_spec/find_module stuff is (or was) a bit of a mess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 02:58:17 2021 From: report at bugs.python.org (Klaus Ethgen) Date: Fri, 08 Jan 2021 07:58:17 +0000 Subject: [issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec' In-Reply-To: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org> Message-ID: <1610092697.78.0.177407991798.issue42818@roundup.psfhosted.org> Klaus Ethgen added the comment: I also tested the original bug and it seems to be gone. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 03:14:04 2021 From: report at bugs.python.org (Tobias Kohn) Date: Fri, 08 Jan 2021 08:14:04 +0000 Subject: [issue42860] Incompatible types in Python grammar In-Reply-To: <1610053767.4.0.390149770714.issue42860@roundup.psfhosted.org> Message-ID: <1610093644.69.0.862627486691.issue42860@roundup.psfhosted.org> Tobias Kohn added the comment: Great, thanks a lot! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:28:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:28:39 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references Message-ID: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> New submission from STINNER Victor : $ ./python -m test test_multibytecodec -m test.test_multibytecodec.Test_IncrementalEncoder.test_subinterp -R 3:3 (...) test_multibytecodec leaked [258, 258, 258] references, sum=774 I simplified the code. The following test leaks references: def test_subinterp(self): import _testcapi code = textwrap.dedent(""" import _codecs_jp codec = _codecs_jp.getcodec('cp932') codec = None """) _testcapi.run_in_subinterp(code) _codecs_jp.getcodec() is defined in Modules/cjkcodecs/cjkcodecs.h. Extract: cofunc = getmultibytecodec(); ... codecobj = PyCapsule_New((void *)codec, PyMultibyteCodec_CAPSULE_NAME, NULL); if (codecobj == NULL) return NULL; r = PyObject_CallOneArg(cofunc, codecobj); Py_DECREF(codecobj); getmultibytecodec() is the _multibytecodec.__create_codec() which is defined in Modules/cjkcodecs/multibytecodec.c. Simplified code: codec = PyCapsule_GetPointer(arg, PyMultibyteCodec_CAPSULE_NAME); _multibytecodec_state *state = _multibytecodec_get_state(module); self = PyObject_New(MultibyteCodecObject, state->multibytecodec_type); self->codec = codec; return (PyObject *)self; ---------- components: Library (Lib) messages: 384643 nosy: vstinner priority: normal severity: normal status: open title: test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:30:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:30:21 +0000 Subject: [issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure In-Reply-To: <1609972702.01.0.789985510588.issue42846@roundup.psfhosted.org> Message-ID: <1610098221.44.0.317441711223.issue42846@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-42846: Convert CJK codec extensions to multiphase init (GH-24157) I added a new test and new test spotted a reference leak, likely an existing one: bpo-42866 "test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:31:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:31:03 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610098263.12.0.68945149858.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: I added the test which leaks in bpo-42846. commit 07f2cee93f1b619650403981c455f47bfed8d818 Author: Victor Stinner Date: Fri Jan 8 00:15:22 2021 +0100 bpo-42846: Convert CJK codec extensions to multiphase init (GH-24157) Convert the 6 CJK codec extension modules (_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw) to the multiphase initialization API (PEP 489). Remove getmultibytecodec() local cache: always import _multibytecodec. It should be uncommon to get a codec. For example, this function is only called once per CJK codec module. Fix a reference leak in register_maps() error path. I don't think that the leak is new. It's just that it wasn't seen previously. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:32:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:32:50 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610098370.25.0.881808126231.issue42866@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +corona10, erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:33:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:33:00 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1610098380.0.0.836789432103.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset 0b858cdd5d114f0890b11b6c4d6559d0ceb468ab by Erlend Egeberg Aasland in branch 'master': > bpo-1635741: Convert _multibytecodec to multi-phase init (GH-24095) This change introduced two regressions: * bpo-42846: "Using _multibytecodec module on Windows, test_threading/embed get failure" (FIXED) * bpo-42866: "test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:34:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:34:30 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610098470.93.0.844864290252.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: By the way, I wrote an article "Leaks discovered by subinterpreters": https://vstinner.github.io/subinterpreter-leaks.html This leak may be new kind related to capsule, I'm not sure so far. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:44:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 09:44:39 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610099079.68.0.116110487155.issue42866@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thank you so much for taking the time to write these blog posts, Victor, and for explaining your fixes is such great detail. It is very helpful! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:52:17 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 08 Jan 2021 09:52:17 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1610099537.02.0.856160892754.issue42853@roundup.psfhosted.org> Ronald Oussoren added the comment: The API documentation already implies that write might not write the entire buffer because it returns the number of bytes actually written (just like os.write). A possible workaround on the SSL layer is hence to clamp the amount of bytes to write to MAX_INT (or later MAX_SSIZE_T) bytes. That said, this does require checking that users of the SSL layer write method in the stdib actually check for the number of bytes written, otherwise we'd exchange the exception to a silent error. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:58:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:58:17 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610099897.21.0.595317901043.issue42866@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +22993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 04:59:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 09:59:16 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610099956.71.0.139175634401.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: PR 24165 fix one reference leak in the getcodec() function of CJK codecs. But it doesn't fix all ref leaks of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 05:24:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 10:24:16 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610101456.16.0.91322175356.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: The leak can be simplified to: @support.cpython_only def test_subinterp(self): import _testcapi code = textwrap.dedent(""" import encodings import _codecs_jp encodings._cache['cp932'] = _codecs_jp.getcodec('cp932') """) res = _testcapi.run_in_subinterp(code) self.assertEqual(res, 0) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 05:29:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 10:29:30 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610101770.88.0.181069671381.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: Links about ref leaks related to encodings: * https://bugs.python.org/issue1635741#msg364833 * https://bugs.python.org/issue1635741#msg364968 * https://bugs.python.org/issue36854#msg357160 * https://github.com/python/cpython/compare/master...phsilva:remove-codec-caches ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 07:00:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 12:00:06 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610107206.86.0.591835282893.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-42671 "Make the Python finalization more deterministic" but it seems like PR 23826 makes the leak worse (+2000 leaked references instead of +200) :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 07:23:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 12:23:51 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610108631.55.0.0877328017147.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: > encodings._cache['cp932'] = _codecs_jp.getcodec('cp932') * encodings._cache is kept alive by encodings.search_function.__globals__ * encodings.search_function function is kept alive by PyInterpreterState.codec_search_path list. The function by _PyCodec_Register() in encodings/__init__.py: codecs.register(search_function). For example, unregistering the search function prevents the leak: import encodings import _codecs_jp encodings._cache['cp932'] = _codecs_jp.getcodec('cp932') import codecs codecs.unregister(encodings.search_function) The PyInterpreterState.codec_search_path list is cleared at Python exit by interpreter_clear(). The weird part is that the _codecs_jp.getcodec('cp932') codec object *is* deleted. I checked and multibytecodec_dealloc() is called with the object stored in the encodings cache. A _multibytecodec.MultibyteCodec instance (MultibyteCodecObject* structure in C) is a simple type: it only stores pointer to C functions and C strings. It doesn't contain any Python object. So I don't see how it could be part of a reference cycle by itself. Moreover, again, it is deleted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 07:46:13 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 12:46:13 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 Message-ID: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> New submission from John McCabe : I've built an application using tkinter (see below). I'm fairly new to tkinter, despite having substantial software experience (33 years), so the layout might be a bit odd/wrong, and the example obviously doesn't follow PEP-8 guidelines, however... Basically this application (which is a bit more than minimal, but should be easy to follow) is designed to manage pairs of text values as JSON, saving/loading from a file. When it starts, the user is asked if they want to read in an existing file of data; if they select NO, a fairly empty frame with 3 buttons showing "+", "Save" and "Quit" is displayed. At this point, if "+" is pressed, a new row with two labels and two Entry widgets is added to the frame. However (and this is the problem which appears to be identical to that reported in Issue #9673), it is not possible to set focus into either of the Entry widgets on Windows 10; there is no problem doing this on Ubuntu 16.04 (although I've only got Python 3.5 on there) If the "Save" button is then pressed, a message box pops up telling the use that no changes have been saved. Once OK has been pressed on that, it becomes possible to set focus into the Entry widgets. One of the problems with Issue #9673 was that no 'minimal' example was provided showing this behaviour, and the very minimal example given in https://bugs.python.org/issue9673#msg218765 doesn't exhibit the problem, hence the example below being a bit more than minimal, while still not being particularly complicated. ==== #!/usr/bin/python3 import os import tkinter as tk from tkinter import filedialog, messagebox import json class Application(tk.Frame): def __init__(self, master): super().__init__(master) self.master = master self.grid() self.originalJson = {} self.inFileName = "" self.leftRightEntries = [] self.fileDlgOpts = { "initialdir" : os.getcwd(), "initialfile" : "file.json", "filetypes" : (("JSON File", "*.json"), ("All Files","*.*")), "defaultextension" : '.json', "title" : "Select A File" } self.createWidgets() def openInFile(self): fileName = "" reuse = tk.messagebox.askquestion("Use An Existing File", "Do you want to load and use an existing file?") if reuse == "yes": fileName = tk.filedialog.askopenfilename(**self.fileDlgOpts) if fileName is not "": try: with open(fileName, 'r') as json_file: self.originalJson = json.load(json_file) json_file.close() except Exception: tk.messagebox.showerror("Use An Existing File", "File could not be loaded; continuing without one.") fileName = "" else: tk.messagebox.showwarning("Use An Existing File", "No existing file specified; continuing without one.") return fileName def createWidgets(self): self.inFileName = self.openInFile() # We add the buttons to some huge numbered row because we might want to insert more # rows, and the layout manager will collapse everything in between. Also we # add these first because of the way the tab order is set up self.addBtn = tk.Button(self.master, text = "+", command = self.addNew) self.addBtn.grid(row = 100, column = 0, sticky = tk.W) # Save button; pretty self-explanatory self.saveBtn = tk.Button(self.master, text = "Save", command = self.save) self.saveBtn.grid(row = 100, column = 2, sticky = tk.W) # Quit button; pretty self-explanatory self.quitBtn = tk.Button(self.master, text = "QUIT", fg = "red", command = self.quit) self.quitBtn.grid(row = 100, column = 3, sticky = tk.E) # If there is original json, work through each key and put the fields on the display rowNum = 0 for leftText in sorted(self.originalJson.keys()): self.insertRow(rowNum, leftText); rowNum = rowNum + 1 self.nextEmptyRow = rowNum self.redoPadding() def redoPadding(self): for child in self.master.winfo_children(): child.grid_configure(padx = 5, pady = 5) def focusNextWidget(self, event): event.widget.tk_focusNext().focus() return("break") def insertRow(self, rowNum, initialLeft = None): tk.Label(self.master, height = 1, text = "Left: ").grid(row = rowNum, column = 0, sticky = tk.W) leftBox = tk.Entry(self.master, width = 20) leftBox.grid(row = rowNum, column = 1, sticky = tk.W) leftBox.bind("", self.focusNextWidget) if initialLeft is not None: leftBox.insert(tk.END, initialLeft) tk.Label(self.master, height = 1, text = "Right: ").grid(row = rowNum, column = 2, sticky = tk.W) rightBox = tk.Entry(self.master, width = 20) rightBox.grid(row = rowNum, column = 3, sticky = tk.W) rightBox.bind("", self.focusNextWidget) if initialLeft is not None: rightBox.insert(tk.END, initialLeft) self.leftRightEntries.append((leftBox, rightBox)) leftBox.focus_set() def addNew(self): # Add a new row before the button self.insertRow(self.nextEmptyRow) self.nextEmptyRow = self.nextEmptyRow + 1 self.redoPadding() def getCurrent(self): # Work through the rows and check stuff current = {} for (leftEntry, rightEntry) in self.leftRightEntries: leftText = leftEntry.get() rightText = rightEntry.get() if leftText == "" and rightText == "": pass elif leftText == "": print("No leftText specified for rightText [{}]".format(rightText)) elif rightText == "": print("No rightText specified for leftText [{}]".format(leftText)) else: print("lefText: {}, rightText: {}".format(leftText, rightText)) current[leftText] = rightText return current def save(self): # Get the current values, and then dump the new json to a file, if it's changed! finalResult = self.getCurrent() if finalResult != self.originalJson: if self.inFileName == "": self.inFileName = tk.filedialog.asksaveasfilename(**self.fileDlgOpts) if self.inFileName != "": with open(self.inFileName, 'w') as json_file: json.dump(finalResult, json_file, indent = 4) self.originalJson = finalResult tk.messagebox.showinfo("Save Data", "Data saved to {}".format(self.inFileName)) else: tk.messagebox.showwarning("Save Data", "Data has not been saved; no file name was supplied!") else: tk.messagebox.showwarning("Save Data", "Data has not been saved; there are no changes") def quit(self): # Deal with quitting when the file's been modified, check original vs current JSON reallyQuit = True finalResult = self.getCurrent() if finalResult != self.originalJson: answer = tk.messagebox.askquestion("Quit", "Data has changed; do you really want to quit?", icon = "warning") if answer != "yes": reallyQuit = False if reallyQuit: self.master.destroy() if __name__ == "__main__": root = tk.Tk() root.title("Inactive Entry Example") app = Application(root) root.protocol("WM_DELETE_WINDOW", app.quit) app.mainloop() ---------- components: Tkinter messages: 384655 nosy: cosimo193 priority: normal severity: normal status: open title: Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 07:50:24 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 08 Jan 2021 12:50:24 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610110224.46.0.957483462388.issue42867@roundup.psfhosted.org> Christian Heimes added the comment: Hi, bugs.python.org is an issue tracker for bugs and feature requests. Please use platforms like Python user mailing list, stack overflow, or reddit for general help with Python and libraries. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 08:05:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 08 Jan 2021 13:05:25 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1610111125.82.0.20189778345.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: That's a good idea, Ronald! socket.c:sock_send_impl() already clamps the input length on Windows: #ifdef MS_WINDOWS if (ctx->len > INT_MAX) ctx->len = INT_MAX; ctx->result = send(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags); #else ctx->result = send(s->sock_fd, ctx->buf, ctx->len, ctx->flags); #endif I could implement a similar logic for SSLSocket. Applications have to check the return value of send() any way or use sendall(). The socket.send() method / send(2) libc function may also write less bytes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 08:12:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 13:12:48 +0000 Subject: [issue14655] traceback module docs should show how to print/fomat an exception object In-Reply-To: <1335216172.17.0.173976069373.issue14655@psf.upfronthosting.co.za> Message-ID: <1610111568.25.0.164259846566.issue14655@roundup.psfhosted.org> Irit Katriel added the comment: In issue 26389 the api was changed so that now format_exception(exc) works. ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Expand traceback module API to accept just an exception as an argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 08:35:18 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 13:35:18 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610112918.89.0.605565196902.issue42867@roundup.psfhosted.org> John McCabe added the comment: Is behaviour that differs between platforms, using components that are listed in the "classification" -> "Components" section NOT a bug then? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 08:59:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 13:59:38 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610114378.27.0.714696476113.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: Calling gc.collect() twice works around the issue, which sounds like a missing traverse function somewhere. diff --git a/Python/pystate.c b/Python/pystate.c index c791b23999..66bbe1bf7d 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -321,6 +321,7 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) /* Last garbage collection on this interpreter */ _PyGC_CollectNoFail(tstate); + _PyGC_CollectNoFail(tstate); _PyGC_Fini(tstate); /* We don't clear sysdict and builtins until the end of this function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:01:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:01:49 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610114509.41.0.030375722357.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e542d417b96077d04aec089505eacb990c9799ae by Victor Stinner in branch 'master': bpo-42866: Fix refleak in CJK getcodec() (GH-24165) https://github.com/python/cpython/commit/e542d417b96077d04aec089505eacb990c9799ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:02:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:02:53 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610114573.65.0.0066839409145.issue42866@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +22994 pull_request: https://github.com/python/cpython/pull/24166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:04:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 08 Jan 2021 14:04:00 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610114640.52.0.670762481033.issue42867@roundup.psfhosted.org> Christian Heimes added the comment: Can your produce the issue with Python 3.8 or newer on any platform? 3.6 and 3.7 are in security fix-only mode. If it's truly a bug in Python, then we won't fix the issue any way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:09:12 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 14:09:12 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610114952.04.0.966440319508.issue42867@roundup.psfhosted.org> John McCabe added the comment: It's reproducible in both 3.8 and 3.9 on Windows 10. ---------- versions: +Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:12:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 14:12:48 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115168.89.0.0533559208302.issue42866@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Don't you need to free memory using PyObject_GC_Del when you allocate using PyObject_GC_New? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:13:30 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 14:13:30 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610115210.66.0.699072932327.issue42867@roundup.psfhosted.org> John McCabe added the comment: In addition, changing "Entry" to "Text" (+ necessary associated changes) makes no difference to the outcome. Removing the call to tk.messagebox.askquestion() does. It appears that tk.messagebox.askquestion() is screwing something up on Windows; perhaps it's locking some resources, or not correctly releasing them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:13:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 14:13:55 +0000 Subject: [issue30701] Exception parsing certain invalid email address headers In-Reply-To: <1497864347.44.0.160991763633.issue30701@psf.upfronthosting.co.za> Message-ID: <1610115235.15.0.236424100426.issue30701@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:14:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 14:14:03 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115243.76.0.297469000732.issue42866@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ref. https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_HAVE_GC ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:22:07 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 08 Jan 2021 14:22:07 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610115727.11.0.626376590059.issue42867@roundup.psfhosted.org> Christian Heimes added the comment: I'm involving TJ and Serhiy. They might have free resources and might be able to assist. I initially suggested to get assistance in user forums, because we have very limited resources. To give you an impression, there are more than 7,500 open bugs on BPO and more than 1,400 open PRs on Github.. ---------- nosy: +serhiy.storchaka, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:23:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:23:23 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115803.19.0.746476625385.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: > Don't you need to free memory using PyObject_GC_Del when you allocate using PyObject_GC_New? My PR uses the generic tp->tp_free which PyObject_GC_Del(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:23:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:23:42 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115822.79.0.556355217302.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: typo: My PR uses the generic tp->tp_free which *is* PyObject_GC_Del(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:24:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 08 Jan 2021 14:24:52 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115892.45.0.478439412824.issue42866@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +22995 pull_request: https://github.com/python/cpython/pull/24167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:26:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 08 Jan 2021 14:26:04 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610115964.03.0.858479020262.issue42866@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +22996 pull_request: https://github.com/python/cpython/pull/24168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:29:01 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 14:29:01 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610116141.08.0.768613372173.issue42866@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ah, thanks! I also found that info in the docs: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_free ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:29:52 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 14:29:52 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610116192.69.0.130126105887.issue42867@roundup.psfhosted.org> John McCabe added the comment: Thank you. Wrt to your initial suggestion, I recognise Python's popularity will make things busy, and I will ask if anyone knows of a workaround in other fora, but a bug's a bug and, IMO, if something behaves differently on different platforms, using packages that are part of the Python install, for no apparent reason, then that's a bug! (Especially as the same thing was reported over 10 years ago, on what would be a very different version of Python). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:44:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:44:10 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610117050.9.0.726271609013.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 11ef53aefbecfac18b63cee518a7184f771f708c by Victor Stinner in branch 'master': bpo-42866: Add traverse func to _multibytecodec.MultibyteCodec (GH-24166) https://github.com/python/cpython/commit/11ef53aefbecfac18b63cee518a7184f771f708c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:46:35 2021 From: report at bugs.python.org (Jin-oh Kang) Date: Fri, 08 Jan 2021 14:46:35 +0000 Subject: [issue42868] SpooledTemporaryFile.__iter__ is not transparent to rollover Message-ID: <1610117195.08.0.928321664408.issue42868@roundup.psfhosted.org> New submission from Jin-oh Kang : In tempfile, SpooledTemporaryFile.__iter__ is defined as follows: # file protocol def __iter__(self): return self._file.__iter__() A rollover would switch the underlying _file object from a BytesIO to a TemporaryFile, thereby leaving the original iterator stale. This may be fixed by: def __iter__(self): while True: line = self._file.readline() if not line: break yield line Or perhaps: def __iter__(self): while True: file = self._file for line in file: yield line if file is not self._file: break else: break ---------- components: Library (Lib) messages: 384674 nosy: jinoh.kang.kr priority: normal severity: normal status: open title: SpooledTemporaryFile.__iter__ is not transparent to rollover type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 09:49:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 14:49:29 +0000 Subject: [issue42866] test test_multibytecodec: Test_IncrementalEncoder.test_subinterp() leaks references In-Reply-To: <1610098119.51.0.27659926103.issue42866@roundup.psfhosted.org> Message-ID: <1610117369.22.0.385110952501.issue42866@roundup.psfhosted.org> STINNER Victor added the comment: Ok, it's now fixed. To make sure that a heap type can be deleted, it must by a GC type, has a traverse function, and it must track its instances. We should take this in account when we convert static types to heap types. In practice, deleting a type is mostly an issue when we check for reference leak and an instance is kept alive until the last GC collection, at the end of Py_EndInterpreter(). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 10:41:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 15:41:40 +0000 Subject: [issue31213] __context__ reset to None in nested exception In-Reply-To: <1502819039.28.0.810222147268.issue31213@psf.upfronthosting.co.za> Message-ID: <1610120500.48.0.485618385539.issue31213@roundup.psfhosted.org> Irit Katriel added the comment: This seems to be deliberately done here in order to prevent context cycles from forming: https://github.com/python/cpython/blob/fe6e5e7cfd68eeaa69fd1511f354a1b4d8d90990/Python/errors.c#L148 In your code you are creating a cycle where foo is the context (and cause) for bar which is the context (and cause) of the second time foo is raised. If you create a new instance of foo for the second raise then there is no cycle and you get what you expect: try: try: raise Exception('foo') except Exception as foo: print("1--", foo, foo.__context__, foo.__cause__) try: raise Exception('bar') from foo except Exception as bar: print("2--", bar, bar.__context__, bar.__context__.__context__) raise Exception('foo2') from bar except Exception as foo: wat = foo print("3--", wat, wat.__context__, wat.__context__.__context__) print("4--", wat, wat.__cause__, wat.__cause__.__context__) print("5--", wat, wat.__cause__, wat.__cause__.__cause__) Output is: 1-- foo None None 2-- bar foo None 3-- foo2 bar foo 4-- foo2 bar foo 5-- foo2 bar foo I think the bug is in your code - you can't create an exception chain that contains the same exception instance more than once. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 10:48:11 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 08 Jan 2021 15:48:11 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1610120891.92.0.308459605932.issue9694@roundup.psfhosted.org> Miro Hron?ok added the comment: Coudl this please be mentioned on https://docs.python.org/3.10/whatsnew/3.10.html ? At least two packages fail tests because of the change (ipython and sphinxcontrib-autoprogram). ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 10:55:48 2021 From: report at bugs.python.org (lcy) Date: Fri, 08 Jan 2021 15:55:48 +0000 Subject: [issue42269] Add ability to set __slots__ in dataclasses In-Reply-To: <1604590694.08.0.0173517280171.issue42269@roundup.psfhosted.org> Message-ID: <1610121348.68.0.421985416639.issue42269@roundup.psfhosted.org> Change by lcy : ---------- nosy: +lcy0321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:06:50 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 08 Jan 2021 16:06:50 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610122010.8.0.302943281887.issue42867@roundup.psfhosted.org> E. Paine added the comment: This is a Tk/Windows issue, not tkinter. I tested the following on Windows 10 using Tk 8.6.9: # Our entry pack [entry .e] # Causes the entry to fail #tk_messageBox -title Title -message Message #after 0 tk_messageBox -title Title -message Message # Does not cause the entry to fail #after 1 tk_messageBox -title Title -message Message after idle tk_messageBox -title Title -message Message I have not tried on a later version of Tk so it may be fixed but it also may be a fundamental Windows issue. The workaround would be to either use .after(1, ...) or .after_idle(...) ---------- nosy: +epaine versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:34:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 08 Jan 2021 16:34:29 +0000 Subject: [issue41742] Request for docs.python.org/3/library/configparser.html#exceptions improvement In-Reply-To: <1599554715.27.0.66152205525.issue41742@roundup.psfhosted.org> Message-ID: <1610123669.96.0.82260689966.issue41742@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:39:38 2021 From: report at bugs.python.org (seb) Date: Fri, 08 Jan 2021 16:39:38 +0000 Subject: [issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries In-Reply-To: <1593100264.48.0.613850075185.issue41116@roundup.psfhosted.org> Message-ID: <1610123978.72.0.587186886289.issue41116@roundup.psfhosted.org> seb added the comment: I am running macOS Big Sur Version 11.1 on Silicon and still get the error about the missing lzma.h file. I can confirm that I use the latest Python 3.9.1 version which includes the patches of this issue. gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I. -I/usr/local/include -I/Users/dev/Downloads/Python-3.9.1/Include -I/Users/dev/Downloads/Python-3.9.1 -c /Users/dev/Downloads/Python-3.9.1/Modules/_lzmamodule.c -o build/temp.macosx-11.1-arm64-3.9/Users/dev/Downloads/Python-3.9.1/Modules/_lzmamodule.o /Users/dev/Downloads/Python-3.9.1/Modules/_lzmamodule.c:16:10: fatal error: 'lzma.h' file not found #include Is this supposed to be still the case? Thank you! ---------- nosy: +seb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:43:53 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 08 Jan 2021 16:43:53 +0000 Subject: [issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries In-Reply-To: <1593100264.48.0.613850075185.issue41116@roundup.psfhosted.org> Message-ID: <1610124233.38.0.832296114161.issue41116@roundup.psfhosted.org> Ned Deily added the comment: > I am running macOS Big Sur Version 11.1 on Silicon and still get the error about the missing lzma.h file. Unfortunately, Apple does not include the XZ library with macOS so, to build that module, you will need to supply a copy from another source, either build it yourself or from a third-party library provider like Homebrew or MacPorts. The Python Developer's Guid has some suggestions: https://devguide.python.org/setup/#macos-and-os-x ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:54:47 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 08 Jan 2021 16:54:47 +0000 Subject: [issue42798] pip search fails In-Reply-To: <1609442411.49.0.32642630503.issue42798@roundup.psfhosted.org> Message-ID: <1610124887.61.0.73713731155.issue42798@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 11:59:47 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 08 Jan 2021 16:59:47 +0000 Subject: [issue42865] sysconfig appends CFLAGS to LD In-Reply-To: <1610078438.84.0.384790848261.issue42865@roundup.psfhosted.org> Message-ID: <1610125187.32.0.150299162392.issue42865@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 12:25:29 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 08 Jan 2021 17:25:29 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610126729.84.0.0677276669263.issue42850@roundup.psfhosted.org> Ned Deily added the comment: Also note that there are known problems with using the "fork" start method of multiprocessing on macOS. As of Python 3.8, the default start methord on macOS is now "spawn": https://docs.python.org/3.9/library/multiprocessing.html#contexts-and-start-methods Try using "spawn" and/or upgrade to a more recent version of Python 3 (3.9.1 is current). ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 12:41:15 2021 From: report at bugs.python.org (John McCabe) Date: Fri, 08 Jan 2021 17:41:15 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610127675.59.0.889965737609.issue42867@roundup.psfhosted.org> John McCabe added the comment: @epaine Thank you for your comments. Although the order of events in the example you quoted isn't the same as in the application I'm using (tk.messagebox.askquestion() is called a long time before the Enter widget is created in the application, not the other way round), what you've suggested, and a bit of extra thought, has led to a solution for me. I wrapped the self.createWidgets call in self.after_idle() (so self.after_idle(self.createWidgets)) and that appears to do the job. Many thanks; it's appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 12:53:26 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 08 Jan 2021 17:53:26 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610128406.22.0.153595554298.issue42863@roundup.psfhosted.org> Steve Dower added the comment: I'm afraid not, at least not without breaking everyone who has hardcoded the paths already. And I'm pretty sure that include directory is never used anymore, either (at least not by distutils, and not by default). The sysconfig module provides the programmatic interface to the directory structure - I'd suggest using "sysconfig.get_paths()" to find the locations where files may be written to. I'd also suggest building your native C library to a wheel and then installing that into the virtual environment, as that's the supported way of adding files. In that case, there's other tooling for specifying the destination for particular files, and it all already takes into account the layout on different platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:01:27 2021 From: report at bugs.python.org (paul j3) Date: Fri, 08 Jan 2021 18:01:27 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1610128887.4.0.354789984545.issue9694@roundup.psfhosted.org> paul j3 added the comment: Since this issue is closed it might be a good idea to open a new one with this problem. And if possible identify the failed tests. We forgot to allow for the fact that working code/tests might be checking for specific help messages, checks the will fail when this group label is changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:02:04 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 08 Jan 2021 18:02:04 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610128924.96.0.69467387913.issue42863@roundup.psfhosted.org> Jeff Moguillansky added the comment: To give more context regarding this issue: I'm currently using meson build system to generate the pkg-config files, and it seems that the paths "include", "lib" are hardcoded. >From the perspective of the overall system, I think it would simplify integration and reduce complexity if we normalize folder structures across platforms instead of having different folder structures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:13:45 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 08 Jan 2021 18:13:45 +0000 Subject: [issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError. In-Reply-To: <1610001583.18.0.772940964765.issue42851@roundup.psfhosted.org> Message-ID: <1610129625.43.0.182161262402.issue42851@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:13:56 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 08 Jan 2021 18:13:56 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610129636.27.0.787438596844.issue42863@roundup.psfhosted.org> Steve Dower added the comment: > From the perspective of the overall system, I think it would simplify integration and reduce complexity if we normalize folder structures across platforms instead of having different folder structures. I agree. But from the perspective of not breaking every existing system out there, it makes more sense to not suddenly change it. If you'd like to champion the 2-3 year (a.k.a. 2-3 release) migration effort to get there, I'm more than happy to make sure you're taken seriously by the rest of the core team. I'm just not prepared to champion it myself :) I have other concerns to use my OSS time for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:34:00 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 18:34:00 +0000 Subject: [issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 In-Reply-To: <1434627103.24.0.34027869681.issue24464@psf.upfronthosting.co.za> Message-ID: <1610130840.16.0.4389426132.issue24464@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +22997 pull_request: https://github.com/python/cpython/pull/24170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 13:34:18 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 08 Jan 2021 18:34:18 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610130858.1.0.887865465829.issue42863@roundup.psfhosted.org> Jeff Moguillansky added the comment: Maybe we can consider adding additional params and a new code path to python -m venv? This way we don't break any existing functionality? e.g. -includedir=... -libdir=... -bindir=... ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 14:04:24 2021 From: report at bugs.python.org (Paul Moore) Date: Fri, 08 Jan 2021 19:04:24 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610132664.85.0.316146363865.issue42863@roundup.psfhosted.org> Paul Moore added the comment: Many tools hard code the "if windows then 'Scripts' else 'bin'" logic. They will simply fail to work with environments that don't have that layout. Yes, they probably should use sysconfig, but many don't (and sometimes for arguably good reasons, for example tools run using one Python interpreter that manipulate the environment of a different one). It's something that *could* be changed, but the cost would be significant, the work needed to manage the transition is non-trivial, and the benefit isn't particularly obvious - "consistency" is never very compelling in isolation, and "works better with meson" is likely to be met with the argument that Python's layout has been around longer than meson, so it's on meson to accommodate Python, not the other way around. I'm not actively against the idea, but neither do I particularly support it (I'm pretty sure it would require work for pip, for no benefit to pip's existing users, so it's a net loss for me personally). If you're interested in pushing for this change go for it - I suspect that it would probably need a PEP, and at the very least it would need a community discussion - but be prepared for it to meet with a certain amount of resistance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 14:13:56 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 08 Jan 2021 19:13:56 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1610133236.85.0.746747929924.issue42863@roundup.psfhosted.org> Jeff Moguillansky added the comment: Thanks for the feedback, I understand ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 15:40:14 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 08 Jan 2021 20:40:14 +0000 Subject: [issue42269] Add ability to set __slots__ in dataclasses In-Reply-To: <1604590694.08.0.0173517280171.issue42269@roundup.psfhosted.org> Message-ID: <1610138414.79.0.541883954752.issue42269@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 5.0 -> 6.0 pull_requests: +22998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 15:44:20 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 08 Jan 2021 20:44:20 +0000 Subject: [issue42269] Add ability to set __slots__ in dataclasses In-Reply-To: <1604590694.08.0.0173517280171.issue42269@roundup.psfhosted.org> Message-ID: <1610138660.41.0.581206024411.issue42269@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Hi Eric, I tried to help you with this feature and have opened a PR. I thought that you are too busy to implement this feature, so that's why I decided to help you (It almost two months since your last message in this thread). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 15:53:10 2021 From: report at bugs.python.org (cptpcrd) Date: Fri, 08 Jan 2021 20:53:10 +0000 Subject: [issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux In-Reply-To: <1609262318.62.0.976413615492.issue42780@roundup.psfhosted.org> Message-ID: <1610139190.69.0.934326523959.issue42780@roundup.psfhosted.org> Change by cptpcrd : ---------- pull_requests: +22999 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 16:11:44 2021 From: report at bugs.python.org (Erik Soma) Date: Fri, 08 Jan 2021 21:11:44 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ In-Reply-To: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> Message-ID: <1610140304.52.0.0161886399673.issue42840@roundup.psfhosted.org> Change by Erik Soma : ---------- keywords: +patch pull_requests: +23000 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 16:25:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 21:25:45 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1610141145.4.0.365175111393.issue42862@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: $ python3.10 -m timeit -s 'import sqlite3; con = sqlite3.connect(":memory:"); query="select * from sqlite_master"' 'con.execute(query); con.execute(query)' 100000 loops, best of 5: 2.95 usec per loop $ ./python.exe -m timeit -s 'import sqlite3; con = sqlite3.connect(":memory:"); query="select * from sqlite_master"' 'con.execute(query); con.execute(query)' 100000 loops, best of 5: 2.68 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 16:34:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 21:34:29 +0000 Subject: [issue42807] smtplib send_message should gives more clear exception if the msg is None In-Reply-To: <1609561396.29.0.629926386929.issue42807@roundup.psfhosted.org> Message-ID: <1610141669.41.0.903861027247.issue42807@roundup.psfhosted.org> Terry J. Reedy added the comment: I am not familiar with either smtp or email, but I can make some general comments. 1. "AttributeError: 'NoneType' object has no attribute 'get_all'" seems pretty straightforward to me. Hard to debug? Depends on knowledge and experience. When coming from library code, it nearly always means that one called a library function with an invalid argument. None, with only standard dunder attributes, is perhaps the most common bad argument. Look in the traceback to find the bad call in one's own code, where one must have passed None, even if not by that name. In this case, if one does not know that 'get_all' is a method of the two email message classes, this can be discovered in the document index. 2. It is not a bug for a function to expect users to know the above and in effect say "Don't do that!" when an attribute reference fails. So I see this as an enhancement request, not a bugfix report. But why add a check for None to this particular function? 3. Python functions often use duck-typing, allowing arguments that act sufficiently well like the documented requirement. While https://docs.python.org/3/library/smtplib.html#smtplib.SMTP.send_message says that msg should be a Message object, this may not be an exact requirement. Indeed, https://docs.python.org/3/library/smtplib.html#smtplib.SMTP.send_message starts with "The Message class is very similar to the EmailMessage class ...". So I wonder, "Is EmailMessage is also allowed?" Or, "Do any users pass instances of custom message classes?" If so, perhaps the doc should be augmented. But checking only for Message would be wrong, and would break code passing non-Message instances. ---------- nosy: +barry, maxking, r.david.murray, terry.reedy stage: -> test needed type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 16:40:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 21:40:09 +0000 Subject: [issue42812] @overload-ing method of parent class without actual implementation In-Reply-To: <1609653092.18.0.893619520042.issue42812@roundup.psfhosted.org> Message-ID: <1610142009.96.0.747628716483.issue42812@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 16:55:55 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 08 Jan 2021 21:55:55 +0000 Subject: [issue42869] pydoc does not append .html to documentation Message-ID: <1610142955.15.0.664460414569.issue42869@roundup.psfhosted.org> New submission from Julien Palard : Running `python3 -m pydoc ensurepip` gives me: https://docs.python.org/3.9/library/ensurepip but it should be: https://docs.python.org/3.9/library/ensurepip.html Issue is in getdocloc function on the line: docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower()) But it previously worked as the nginx config for the doc server contains: # Emulate Apache's content-negotiation. Was a temporary measure, # but now people are using it like a feature. location ~ ^/((2|3)(\.[0-8])?|dev)/\w+/[\d\w\.]+(?!\.html)$ { if (-f "${request_filename}.html") { return 301 https://$host:$request_uri.html; } } (So yes "people are using it like a feature" contains pydoc :)) Notice the [0-8], which does not match for my /3.9/. I propose to fix the issue on both sides: - On psf-salt to allow 3.9 to get the "temporary" measure. - pydoc side to simplify the code ---------- assignee: docs at python components: Documentation messages: 384693 nosy: docs at python, mdk priority: normal severity: normal status: open title: pydoc does not append .html to documentation versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 17:08:45 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 08 Jan 2021 22:08:45 +0000 Subject: [issue42869] pydoc does not append .html to documentation In-Reply-To: <1610142955.15.0.664460414569.issue42869@roundup.psfhosted.org> Message-ID: <1610143725.08.0.875815319577.issue42869@roundup.psfhosted.org> Change by Julien Palard : ---------- keywords: +patch pull_requests: +23001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 17:11:03 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 08 Jan 2021 22:11:03 +0000 Subject: [issue42869] pydoc does not append .html to documentation In-Reply-To: <1610142955.15.0.664460414569.issue42869@roundup.psfhosted.org> Message-ID: <1610143863.0.0.724768207167.issue42869@roundup.psfhosted.org> Julien Palard added the comment: This is now fixed on the docs server thanks to [1], so it should work for already release Python 3.9 :) [1]: https://github.com/python/psf-salt/pull/198 I still did a PR on cpython to avoid a redirection, and get cpython itself out of the "people use this temporary fix as a feature now". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 17:44:05 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 08 Jan 2021 22:44:05 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1610145845.03.0.736929728515.issue1635741@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +23002 pull_request: https://github.com/python/cpython/pull/24175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 17:59:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 22:59:56 +0000 Subject: [issue42820] Sphinx conf.py needs_version entry is outdated In-Reply-To: <1609723694.82.0.961390909546.issue42820@roundup.psfhosted.org> Message-ID: <1610146796.99.0.0775544186083.issue42820@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:27:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 23:27:30 +0000 Subject: [issue42825] Build libraries with "/OPT:REF" linker optimization on Windows In-Reply-To: <1609782160.13.0.0224895080942.issue42825@roundup.psfhosted.org> Message-ID: <1610148450.86.0.588542851436.issue42825@roundup.psfhosted.org> Terry J. Reedy added the comment: The PR says that this deletes "uncalled code". I imagine that this is safe for a .exe. But for a .dll? As i understand it, one can, from python code, access any function via ctypes, so it seems to me that there is no way for the linker to know which callable functions in a .dll can be safely deleted. Am I missing something? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:35:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 23:35:25 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1610148925.25.0.674978067413.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0e2a0f72cc9af0899eacb5604e44a563c0b06110 by Victor Stinner in branch 'master': bpo-42802: Remove distutils bdist_wininst command (GH-24043) https://github.com/python/cpython/commit/0e2a0f72cc9af0899eacb5604e44a563c0b06110 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:35:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 23:35:42 +0000 Subject: [issue42820] Sphinx conf.py needs_version entry is outdated In-Reply-To: <1609723694.82.0.961390909546.issue42820@roundup.psfhosted.org> Message-ID: <1610148942.57.0.817987673334.issue42820@roundup.psfhosted.org> Terry J. Reedy added the comment: This is related to #42843, which is about deciding what the min sphinx should be. Since the alternative to 3.2 is some 2.x, 1,8 is certainly wrong. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:38:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 08 Jan 2021 23:38:15 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1610149095.53.0.895817584579.issue42802@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:42:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jan 2021 23:42:29 +0000 Subject: [issue42849] pool worker can't be terminated In-Reply-To: <1609992006.83.0.897606551243.issue42849@roundup.psfhosted.org> Message-ID: <1610149349.81.0.418324980541.issue42849@roundup.psfhosted.org> Terry J. Reedy added the comment: 3.7 has not gotten bug fixes for a couple of years. This needs to be verified on a current release. ---------- nosy: +davin, pitrou, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:50:53 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 08 Jan 2021 23:50:53 +0000 Subject: [issue42870] Document changed argparse output wrt optional arguments in What's new in Python 3.10 Message-ID: <1610149853.78.0.949568295376.issue42870@roundup.psfhosted.org> New submission from Miro Hron?ok : A followup from https://bugs.python.org/issue9694 Could the change in output please be mentioned on https://docs.python.org/3.10/whatsnew/3.10.html ? In Fedora, at least 3 packages fail tests because of the change: ipython: https://github.com/ipython/ipython/pull/12759 m2r: https://github.com/miyakogi/m2r/pull/62 sphinxcontrib-autoprogram: https://bugzilla.redhat.com/show_bug.cgi?id=1914341 Thanks. ---------- assignee: docs at python components: Documentation messages: 384699 nosy: docs at python, hroncok, paul.j3, rhettinger priority: normal severity: normal status: open title: Document changed argparse output wrt optional arguments in What's new in Python 3.10 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 18:51:14 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 08 Jan 2021 23:51:14 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1610149874.33.0.792829918605.issue9694@roundup.psfhosted.org> Miro Hron?ok added the comment: https://bugs.python.org/issue42870 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 19:18:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 09 Jan 2021 00:18:24 +0000 Subject: [issue9673] Entry Widget Not Editable under Windows XP with dialog call. In-Reply-To: <1282672182.44.0.886074830019.issue9673@psf.upfronthosting.co.za> Message-ID: <1610151504.01.0.40024090803.issue9673@roundup.psfhosted.org> Terry J. Reedy added the comment: My testing was inadequate. From #42867, it appears that 0. the bug is limited to Windows; 1. opening a canned dialog or message box is part of getting the buggy behavior; 2. timing is involved; 3. the bug can be exhibited on Windows directly with wish/tk, so that it is a 3rd party tcl/tk issue and not a tkinter issue. Hence changing the issue resolution. A workaround mentioned in both the referenced tkinter thread and #42867 is to call after_idle() at some point. ---------- resolution: out of date -> third party title: Entry Widget Not Editable under Windows XP -> Entry Widget Not Editable under Windows XP with dialog call. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 19:44:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 09 Jan 2021 00:44:15 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610153055.92.0.305532049972.issue42867@roundup.psfhosted.org> Terry J. Reedy added the comment: I added this note to #9673 after rereading the posts and the 2010 tkinter list thread. "My testing was inadequate. From #42867, it appears that 0. the bug is limited to Windows; 1. opening a canned dialog or message box is part of getting the buggy behavior; 2. timing is involved; 3. the bug can be exhibited on Windows directly with wish/tk, so that it is a 3rd party tcl/tk issue and not a tkinter issue. Hence changing the issue resolution. A workaround mentioned in both the referenced tkinter thread and #42867 is to call after_idle() at some point." Paine, thank you for verifying both the bug and workaround directly with tk. I am closing this also as 3rd party. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:25:31 2021 From: report at bugs.python.org (Renji) Date: Sat, 09 Jan 2021 01:25:31 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier Message-ID: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> New submission from Renji : I can compile "((a)|b\2)*" expression and this expression successfully return captures from first repetition and second repetition in one time. But if I write (b\2|(a))* expression, I get "invalid group reference 2 at position 3" error. Either first or second behavior incorrect. python3 --version Python 3.7.3 import re text="aba" #match=re.search(r"(b\2|(a))*",text) - not worked match=re.search(r"((a)|b\2)*",text) if(match): #show aba ba a print(match.group(0)+" "+match.group(1)+" "+match.group(2)) ---------- components: Regular Expressions messages: 384703 nosy: Renji, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Regex compilation crashed if I change order of alternatives under quantifier type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:26:20 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sat, 09 Jan 2021 01:26:20 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610155580.9.0.723786689947.issue42800@roundup.psfhosted.org> Ryan Hileman added the comment: traceback's `tb_code` attribute also allows you to bypass the `object.__getattr__` audit event for `__code__`. Perhaps accessing a traceback object's `tb_code` and `tb_frame` should both raise an `object.__getattr__` event? ---------- nosy: +lunixbochs2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:38:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 09 Jan 2021 01:38:21 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610156301.73.0.601198167126.issue42800@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:42:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 09 Jan 2021 01:42:42 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610156562.67.0.026179574784.issue42800@roundup.psfhosted.org> STINNER Victor added the comment: I don't think that audit hooks should be seen as a way to build a robust sandbox. https://www.python.org/dev/peps/pep-0578/#why-not-a-sandbox ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:44:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 09 Jan 2021 01:44:13 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610156653.11.0.350778345881.issue42800@roundup.psfhosted.org> STINNER Victor added the comment: Even if no audit hook is registered, adding an audit event on a function has a cost on runtime performance. object.__getattr__() is a core Python function, if an event is added, we should properly measure the performance overhead to decide if it's acceptable or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 20:49:33 2021 From: report at bugs.python.org (Erik Soma) Date: Sat, 09 Jan 2021 01:49:33 +0000 Subject: [issue42840] `type` takes **kwargs for __init_subclass__ In-Reply-To: <1609946481.51.0.225785046936.issue42840@roundup.psfhosted.org> Message-ID: <1610156973.51.0.359644766766.issue42840@roundup.psfhosted.org> Erik Soma added the comment: Seems I misframed the issue a bit. I didn't realize keyword arguments besides 'metaclass' were introduced with PEP 3115 with Python 3.0. In any case I've posted a PR to update the docs and typeshed. Typeshed PR for reference: https://github.com/python/typeshed/pull/4918 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 21:00:02 2021 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 09 Jan 2021 02:00:02 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier In-Reply-To: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> Message-ID: <1610157602.53.0.966446615795.issue42871@roundup.psfhosted.org> Matthew Barnett added the comment: It's not a crash. It's complaining that you're referring to group 2 before defining it. The re module doesn't support forward references to groups, but only backward references to them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 21:11:40 2021 From: report at bugs.python.org (Renji) Date: Sat, 09 Jan 2021 02:11:40 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier In-Reply-To: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> Message-ID: <1610158300.37.0.864062525446.issue42871@roundup.psfhosted.org> Renji added the comment: In my example reference and capture group presents in two difference alternatives. They don't follow each other, but executed in random order. If this don't supported in one case, why it supported in other case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 21:25:37 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sat, 09 Jan 2021 02:25:37 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610159137.46.0.282032297041.issue42800@roundup.psfhosted.org> Ryan Hileman added the comment: I'm definitely not proposing to hook all of object.__getattr__, as my intuition says that would be very slow. I simply refer to "object.__getattr__" as the event name used by a couple of rare event audit hooks. This is how getting __code__ is emitted: https://github.com/python/cpython/blob/7301979b23406220510dd2c7934a21b41b647119/Objects/funcobject.c#L250 However, there's not much point in the sys._getframe and func.__code__ family of audit hooks right now as tracebacks expose the same information (and may even do so accidentally). I am personally interested in these hooks for non sandbox reasons in a production application that cares about perf, FWIW. I think this would be implemented by extending the traceback object's getters to include tb_code and tb_frame: https://github.com/python/cpython/blob/7301979b23406220510dd2c7934a21b41b647119/Python/traceback.c#L156-L159 I project it won't have any noticeable perf impact (especially if the audit hook is written in C), as most reasons to inspect a traceback object will be exceptional and not in critical paths. I'd be happy to write a proposed patch if that would help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 21:38:37 2021 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 09 Jan 2021 02:38:37 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier In-Reply-To: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> Message-ID: <1610159917.5.0.99181953023.issue42871@roundup.psfhosted.org> Matthew Barnett added the comment: Example 1: ((a)|b\2)* ^^^ Group 2 ((a)|b\2)* ^^ Reference to group 2 The reference refers backwards to the group. Example 2: (b\2|(a))* ^^^ Group 2 (b\2|(a))* ^^ Reference to group 2 The reference refers forwards to the group. As I said, the re module doesn't support forward references to groups. If you have a regex where forward references are unavoidable, try the 3rd-party 'regex' module instead. It's available on PyPI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 22:04:21 2021 From: report at bugs.python.org (Renji) Date: Sat, 09 Jan 2021 03:04:21 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier In-Reply-To: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> Message-ID: <1610161461.71.0.510956607457.issue42871@roundup.psfhosted.org> Renji added the comment: I through "forward reference" is "\1 (abcd)". Not "some sort of reference in second repetition to data from first repetition". Ok. In other words refers from on repetition to other supported, but with purely formal restrictions. And remove this restrictions don't planned. Than this issue may be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 8 23:16:21 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sat, 09 Jan 2021 04:16:21 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610165781.54.0.483466612863.issue42800@roundup.psfhosted.org> Ryan Hileman added the comment: Oops, by tb_code I meant traceback.tb_frame.f_code. So you can get to a frame from traceback.tb_frame (without triggering audit) or sys._getframe (which has an audit hook already), and you can get to __code__ from a frame via frame.f_code (without triggering audit). Here's a patch for both frame.f_code and traceback.tb_frame: https://github.com/lunixbochs/cpython/commit/2334a00c833874b7a2427e88abc9b51315bb010c --- Benchmarks follow this section, made using the commit I linked (and the parent commit without the patch for comparison). My takeaways from playing around: 1. You probably shouldn't install a Python audit hook if you care about performance. 2. C audit hook performance impact shows up in microbenchmarking but only have a small impact on real workloads (see the traceback.format_tb benchmark at the end). 3. Performance impact of this change when you _don't_ have an audit hook installed is very small. 4. This seems to mostly impact debugging and test code. A quick check of the stdlib shows: - traceback.tb_frame usage seems to be entirely in debugger, traceback, and testing code: https://github.com/python/cpython/search?l=Python&p=3&q=tb_frame - frame.f_code primarily has similar debug use (dis, warnings, profiling, inspect): https://github.com/python/cpython/search?l=Python&p=3&q=f_code Attached (c_audit_ext.zip) is the empty C audit hook I used for the benchmarks. `python3 setup.py build_ext` builds a `c_audit` module which registers an empty audit hook on import. ################################################################################ #### frame.f_code object.__getattr__ audit hook # Testing frame.f_code impact (no audit hook installed): ./python.exe -m timeit -s 'frame = sys._getframe()' -- 'frame.f_code' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 19.1 nsec per loop 20000000 loops, best of 5: 18.7 nsec per loop 20000000 loops, best of 5: 19.1 nsec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 17 nsec per loop 20000000 loops, best of 5: 16.7 nsec per loop 20000000 loops, best of 5: 17 nsec per loop # Testing frame.f_code impact (C audit hook installed): python.exe -m timeit -s 'import c_audit; frame = sys._getframe()' -- 'frame.f_code' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 5000000 loops, best of 5: 66.1 nsec per loop 5000000 loops, best of 5: 66.1 nsec per loop 5000000 loops, best of 5: 66.5 nsec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 16.9 nsec per loop 20000000 loops, best of 5: 16.9 nsec per loop 20000000 loops, best of 5: 16.8 nsec per loop # Testing frame.f_code impact (pure Python audit hook installed): ./python.exe -m timeit -s 'frame = sys._getframe(); sys.addaudithook(lambda *a: None)' -- 'frame.f_code' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 500000 loops, best of 5: 1.02 usec per loop 500000 loops, best of 5: 1.04 usec per loop 500000 loops, best of 5: 1.02 usec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 16.8 nsec per loop 20000000 loops, best of 5: 17.1 nsec per loop 20000000 loops, best of 5: 16.8 nsec per loop ################################################################################ #### tb.tb_frame object.__getattr__ audit hook # Testing tb.tb_frame impact (no audit hook installed) ./python.exe -m timeit -s "$(echo -e "try: a\nexcept Exception as e: tb = e.__traceback__")" -- 'tb.tb_frame' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 19.2 nsec per loop 20000000 loops, best of 5: 18.9 nsec per loop 20000000 loops, best of 5: 18.9 nsec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 17 nsec per loop 20000000 loops, best of 5: 16.7 nsec per loop 20000000 loops, best of 5: 16.8 nsec per loop # Testing tb.tb_frame impact (C audit hook installed) ./python.exe -m timeit -s "$(echo -e "import c_audit\ntry: a\nexcept Exception as e: tb = e.__traceback__")" -- 'tb.tb_frame' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 5000000 loops, best of 5: 64.8 nsec per loop 5000000 loops, best of 5: 64.8 nsec per loop 5000000 loops, best of 5: 64.8 nsec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 16.7 nsec per loop 20000000 loops, best of 5: 16.9 nsec per loop 20000000 loops, best of 5: 16.9 nsec per loop # Testing tb.tb_frame impact (pure Python audit hook installed) ./python.exe -m timeit -s "$(echo -e "sys.addaudithook(lambda *a: None)\ntry: a\nexcept Exception as e: tb = e.__traceback__")" -- 'tb.tb_frame' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 500000 loops, best of 5: 1.04 usec per loop 500000 loops, best of 5: 1.02 usec per loop 500000 loops, best of 5: 1.04 usec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 20000000 loops, best of 5: 16.9 nsec per loop 20000000 loops, best of 5: 16.9 nsec per loop 20000000 loops, best of 5: 17.2 nsec per loop ################################################################################ #### tb.tb_frame object.__getattr__ audit hook, traceback.format_tb() # Testing tb.tb_frame impact on traceback.format_tb (no audit hook installed) with patch 2334a00c833874b7a2427e88abc9b51315bb010c 100000 loops, best of 5: 3 usec per loop 100000 loops, best of 5: 3.03 usec per loop 100000 loops, best of 5: 3 usec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 100000 loops, best of 5: 2.99 usec per loop 100000 loops, best of 5: 3.02 usec per loop 100000 loops, best of 5: 2.99 usec per loop # Testing tb.tb_frame impact on traceback.format_tb (C audit hook installed) ./python.exe -m timeit -s "$(echo -e "import c_audit\nimport traceback\ntry: a\nexcept Exception as e: tb = e.__traceback__")" -- 'traceback.format_tb(tb)' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 100000 loops, best of 5: 3.13 usec per loop 100000 loops, best of 5: 3.13 usec per loop 100000 loops, best of 5: 3.12 usec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 100000 loops, best of 5: 3.06 usec per loop 100000 loops, best of 5: 3.06 usec per loop 100000 loops, best of 5: 3.05 usec per loop # Testing tb.tb_frame impact on traceback.format_tb (pure Python audit hook installed) ./python.exe -m timeit -s "$(echo -e "sys.addaudithook(lambda *a: None)\nimport traceback\ntry: a\nexcept Exception as e: tb = e.__traceback__")" -- 'traceback.format_tb(tb)' with patch 2334a00c833874b7a2427e88abc9b51315bb010c 50000 loops, best of 5: 5.1 usec per loop 50000 loops, best of 5: 5.18 usec per loop 50000 loops, best of 5: 5.06 usec per loop without patch 2334a00c833874b7a2427e88abc9b51315bb010c 100000 loops, best of 5: 3 usec per loop 100000 loops, best of 5: 3 usec per loop 100000 loops, best of 5: 3 usec per loop ---------- Added file: https://bugs.python.org/file49729/c_audit_ext.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 00:50:57 2021 From: report at bugs.python.org (Robin Scheibler) Date: Sat, 09 Jan 2021 05:50:57 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610171457.44.0.408822367421.issue42850@roundup.psfhosted.org> Robin Scheibler added the comment: Thanks for the suggestion. I had indeed run into some issues with fork vs spawn before. I have tested with 3.8.5 and 3.9.1 and the bug doesn't occur with these more recent versions. Should I leave the bug open since 3.7 is still supported ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 03:15:26 2021 From: report at bugs.python.org (Hong Xu) Date: Sat, 09 Jan 2021 08:15:26 +0000 Subject: [issue42872] Inconsistent exception thrown by mkdir on different OSes Message-ID: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> New submission from Hong Xu : Consider the following code: ------------------------- import pathlib def main(): pathlib.Path('tmp').touch() pathlib.Path('tmp/tmp_sub').mkdir(parents=True) main() ------------------------ Run the code above in an empty directory. On Linux, it throws a `NotADirectory` exception: Traceback (most recent call last): File "", line 1, in File "main.py", line 5, in main pathlib.Path('tmp/tmp_sub').mkdir(parents=True) File "/usr/lib/python3.8/pathlib.py", line 1287, in mkdir self._accessor.mkdir(self, mode) NotADirectoryError: [Errno 20] Not a directory: 'tmp/tmp_sub' ----------------------------- On Windows, it throws a FileExistsError exception: Traceback (most recent call last): File "C:\Users\hong\anaconda3\lib\pathlib.py", line 1284, in mkdir self._accessor.mkdir(self, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'tmp\\tmp_sub' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "main.py", line 7, in main() File "main.py", line 5, in main pathlib.Path('tmp/tmp_sub').mkdir(parents=True) File "C:\Users\hong\anaconda3\lib\pathlib.py", line 1288, in mkdir self.parent.mkdir(parents=True, exist_ok=True) File "C:\Users\hong\anaconda3\lib\pathlib.py", line 1284, in mkdir self._accessor.mkdir(self, mode) FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'tmp ---------- components: Library (Lib), Windows messages: 384715 nosy: Hong Xu, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Inconsistent exception thrown by mkdir on different OSes versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 03:17:22 2021 From: report at bugs.python.org (Hong Xu) Date: Sat, 09 Jan 2021 08:17:22 +0000 Subject: [issue42872] Inconsistent exceptions thrown by mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610180242.37.0.712950240982.issue42872@roundup.psfhosted.org> Change by Hong Xu : ---------- title: Inconsistent exception thrown by mkdir on different OSes -> Inconsistent exceptions thrown by mkdir on different OSes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 03:17:38 2021 From: report at bugs.python.org (Hong Xu) Date: Sat, 09 Jan 2021 08:17:38 +0000 Subject: [issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610180258.7.0.221421579525.issue42872@roundup.psfhosted.org> Change by Hong Xu : ---------- title: Inconsistent exceptions thrown by mkdir on different OSes -> Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 04:27:41 2021 From: report at bugs.python.org (John McCabe) Date: Sat, 09 Jan 2021 09:27:41 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610184461.67.0.924122752859.issue42867@roundup.psfhosted.org> John McCabe added the comment: Thank you all for your time. I hope you don't feel it has been wasted since, at the very least, it confirms an issue in tkinter usage, albeit that the actual cause of the issue is TK itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 06:26:02 2021 From: report at bugs.python.org (Berker Peksag) Date: Sat, 09 Jan 2021 11:26:02 +0000 Subject: [issue24464] "sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 In-Reply-To: <1434627103.24.0.34027869681.issue24464@psf.upfronthosting.co.za> Message-ID: <1610191562.17.0.142855476002.issue24464@roundup.psfhosted.org> Berker Peksag added the comment: New changeset d16f6176abdecbb7ab231dc78beccfaa095beff6 by Erlend Egeberg Aasland in branch 'master': bpo-24464: Fix sqlite3.enable_shared_cache() deprecation wrapper (GH-24170) https://github.com/python/cpython/commit/d16f6176abdecbb7ab231dc78beccfaa095beff6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:00:18 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 09 Jan 2021 12:00:18 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks Message-ID: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> New submission from Mark Dickinson : tl;dr - contrived (but relatively short) code involving nested try/finally blocks can produce disproportionately large bytecode. I'm not expecting or suggesting any action here, but the situation seemed at least worth noting. Feel free to close this issue as a "well don't do that, then" (a.k.a. "wont fix") Longer: Python 3.9 changed the way that bytecode was generated for try/finally (see #33387). For a "try" block body that can do any of raise, return or fall-off-the-end-of-the-block, the corresponding finally block gets three separate paths in the bytecode. If such trys are nested times, we get 3^n separate paths in the bytecode. Example code: ---------------- def f(): try: if something(): return finally: try: if something(): return finally: try: if something(): return finally: try: if something(): return finally: try: if something(): return finally: do_cleanup() import dis dis.dis(f) ---------------- On my machine, running this and counting the do_cleanup invocations gives, as expected, a result of 243 = 3**5 % python3.9 nested_finally.py | grep do_cleanup | wc -l 243 That's fairly benign, but if I scale up to 10 nested blocks, the dis.dis call takes over 10 minutes to complete (the compilation itself still only takes a fraction of a second). The bytecode object is correspondingly large: >>> len(f.__code__.co_code) 1741356 With 15 levels of nesting, compilation takes several seconds, and the generated code is (again as expected) a couple of orders of magnitude larger: >>> len(f.__code__.co_code) 533859040 I didn't try pushing this further than 15 levels of nesting. As I said above, it's not clear to me whether this is actually an issue that needs to be addressed in practice. It seems unlikely that "real code" :TM: would run into this, but the effect seemed worth noting. ---------- components: Interpreter Core messages: 384718 nosy: Mark.Shannon, mark.dickinson priority: normal severity: normal status: open title: Exponential time and space requirements for compilation of nested try/finally blocks type: performance versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:00:21 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 09 Jan 2021 12:00:21 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610193621.72.0.163411707445.issue42800@roundup.psfhosted.org> Steve Dower added the comment: That's the same patch that I'd write, and I agree, we should hook this. If the fields are documented anywhere, we should add the audit event data to get them into the table in the docs. Otherwise, that patch looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:14:13 2021 From: report at bugs.python.org (Martin Wheatley) Date: Sat, 09 Jan 2021 12:14:13 +0000 Subject: [issue42874] configure errors Message-ID: <1610194453.5.0.66216438534.issue42874@roundup.psfhosted.org> New submission from Martin Wheatley : I'm installin Python 3.91. on a Solaris 10 system (I known it's 'old' but I have a legacy installation to support). Running ./configure the following errors are seen... checking PROFILE_TASK... -m test --pgo checking for --with-lto... no checking for llvm-profdata... no grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . checking for -Wextra... yes checking whether /usr/sfw/bin/gcc accepts and needs -fno-strict-aliasing... yes checking if we can turn off /usr/sfw/bin/gcc unused result warning... no checking if we can turn off /usr/sfw/bin/gcc unused parameter warning... yes and checking aligned memory access is required... yes checking for --with-hash-algorithm... default checking for --with-tzpath... grep: illegal option -- q grep: illegal option -- E Usage: grep -hblcnsviw pattern file . . . "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo" checking for --with-address-sanitizer... no checking for --with-memory-sanitizer... no checking for --with-undefined-behavior-sanitizer... no checking for t_open in -lnsl... yes checking for socket in -lsocket... yes ---------- components: Installation messages: 384720 nosy: martin.wheatley.home priority: normal severity: normal status: open title: configure errors type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:19:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 09 Jan 2021 12:19:47 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks In-Reply-To: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> Message-ID: <1610194787.38.0.499632365338.issue42873@roundup.psfhosted.org> Mark Dickinson added the comment: For extra fun, you can add `break` and `continue` paths into the mix to get a 5-fold instead of 3-fold code size increase per level of nesting. It's still contrived code, though. Example where do_cleanup() ends up with 5**4 = 625 paths: ---- def f(): while True: try: if something(): break elif something_else(): continue elif yet_something_else(): return finally: try: if something(): break elif something_else(): continue elif yet_something_else(): return finally: try: if something(): break elif something_else(): continue elif yet_something_else(): return finally: try: if something(): break elif something_else(): continue elif yet_something_else(): return finally: do_cleanup() ---- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:31:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 09 Jan 2021 12:31:38 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks In-Reply-To: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> Message-ID: <1610195498.11.0.690369363841.issue42873@roundup.psfhosted.org> Serhiy Storchaka added the comment: And there may be more than one return/break/continue statement in the try block. It increases the base of the degree. At least for "return" we perhaps can merge different cases. But it would complicate the compiler and cannot help in other cases. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:37:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 09 Jan 2021 12:37:30 +0000 Subject: [issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610195850.24.0.213310459951.issue42872@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, some operations can raise instances of different OSError subclasses on different platforms, because the corresponding C function sets different errno. It is so, and we cannot do anything with this. It is just a part of the difference between plaforms. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:38:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 09 Jan 2021 12:38:15 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks In-Reply-To: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> Message-ID: <1610195895.73.0.37307081195.issue42873@roundup.psfhosted.org> Mark Shannon added the comment: I don't see what the problem is here. People just don't write code like that, at least not if they do code review ;) And even, in the *extremely* rare case that they do, the code executes correctly and reasonably quickly. It just uses a bit of extra memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:38:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 09 Jan 2021 12:38:21 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks In-Reply-To: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> Message-ID: <1610195901.28.0.640825510805.issue42873@roundup.psfhosted.org> Mark Dickinson added the comment: > And there may be more than one return/break/continue statement in the try block. It increases the base of the degree. Ah, interesting. My understanding was that that can't happen, but I'll double check. In the control flow, all 'return' statements that leave a try block are going to the same place, so only one 'finally' branch needs to be generated no matter how many returns you have. And similarly for 'break' and 'continue'. IOW, what matters is the possible paths that can be taken when the finally block exits, and there are only up to 5 of those (for raise, return, break, continue, and leaving normally). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 07:42:13 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 09 Jan 2021 12:42:13 +0000 Subject: [issue42873] Exponential time and space requirements for compilation of nested try/finally blocks In-Reply-To: <1610193618.87.0.555969864656.issue42873@roundup.psfhosted.org> Message-ID: <1610196133.18.0.17906106633.issue42873@roundup.psfhosted.org> Mark Dickinson added the comment: > I don't see what the problem is here. People just don't write code like that. Yes, agreed; as I said in the original post, I'm not expecting any action, but the effect did seem interesting enough to be worth noting in an issue (if only so that it can be recorded as a known "feature" and the resolution can be recorded for the future). I'll close as won't fix. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 08:06:23 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 09 Jan 2021 13:06:23 +0000 Subject: [issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610197583.63.0.493292568979.issue42872@roundup.psfhosted.org> Eryk Sun added the comment: NT filesystems are specified to fail with STATUS_OBJECT_PATH_NOT_FOUND (0xC000003A) if a parent component in a path either does not exist or is not a directory. In the Windows API, this translates to ERROR_PATH_NOT_FOUND (3), which in the C runtime translates to ENOENT (2), which in Python is raised as FileNotFoundError. The design of Path.mkdir() assumes POSIX behavior, which splits the above two cases respectively into ENOENT and ENOTDIR. Thus it assumes that FileNotFoundError means a parent component does not exist. This eliminates the race condition of having to test whether the parent path exists. In Windows, it's not possible to differentiate the two cases by error code alone, so unfortunately Path.mkdir() tries to create the parent path when it contains a non-directory component, and thus a nested FileExistsError exception is raised. The design of os.makedirs() instead checks whether the parent exists before trying to create it, and ignores FileExitsError if creating the parent tree fails due to a race condition. This design behaves a bit more consistently across platforms, but it still fails with a different exception on Windows vs POSIX, i.e. FileNotFoundError vs NotADirectoryError. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 08:29:22 2021 From: report at bugs.python.org (Johan Dahlin) Date: Sat, 09 Jan 2021 13:29:22 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1610198962.23.0.946316979652.issue42115@roundup.psfhosted.org> Change by Johan Dahlin : ---------- nosy: +Johan Dahlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 09:34:59 2021 From: report at bugs.python.org (Pavel Ditenbir) Date: Sat, 09 Jan 2021 14:34:59 +0000 Subject: [issue42875] argparse incorrectly shows help string on a new line in case of long command string Message-ID: <1610202899.54.0.332342565241.issue42875@roundup.psfhosted.org> New submission from Pavel Ditenbir : Steps to reproduce. Run the attached script: $ python3 argparse-indent-sample.py --help The output is: usage: argparse-indent-sample.py [-h] CMD ... optional arguments: -h, --help show this help message and exit service: CMD command to use add add something remove remove something a-very-long-command command that does something Expected output is: usage: argparse-indent-sample.py [-h] CMD ... optional arguments: -h, --help show this help message and exit service: CMD command to use add add something remove remove something a-very-long-command command that does something ---------- components: Library (Lib) files: argparse-indent-sample.py messages: 384728 nosy: DiPaolo priority: normal severity: normal status: open title: argparse incorrectly shows help string on a new line in case of long command string type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49730/argparse-indent-sample.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 09:44:44 2021 From: report at bugs.python.org (CrouZ) Date: Sat, 09 Jan 2021 14:44:44 +0000 Subject: [issue38822] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1610203484.28.0.572388275825.issue38822@roundup.psfhosted.org> CrouZ added the comment: The problem exists in Python 3.8 as well, with the difference that ``os.path.isdir("D:\\System Volume Information\\")`` also returns False. Tested with Python 3.8.2 and 3.8.7. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 10:22:29 2021 From: report at bugs.python.org (Philippe Ombredanne) Date: Sat, 09 Jan 2021 15:22:29 +0000 Subject: [issue4963] mimetypes.guess_extension result changes after mimetypes.init() In-Reply-To: <1232107494.83.0.0570958889295.issue4963@psf.upfronthosting.co.za> Message-ID: <1610205749.4.0.880904129747.issue4963@roundup.psfhosted.org> Philippe Ombredanne added the comment: The changes introduced by this ticket in https://github.com/python/cpython/commit/9fc720e5e4f772598013ea48a3f0d22b2b6b04fa#r45794801 are problematic. I discovered this from having tests failing when testing on Python 3.7 and up The bug is that calling mimetypes.init(files) will NOT use my files, but instead use both my files and knownfiles. This was not the case before as knownfiles would be ignored as expected when I provide my of files list. This is a breaking API change IMHO and introduces a buggy unstability : even if I want to ignore knownfiles by providing my list of of files, knownfiles will always be added and this results in erratic and buggy behaviour as the content of "knownfiles" is completely random based on the OS version and else. The code I am using is here https://github.com/nexB/typecode/blob/ba07c04d23441d3469dc5de911376d408514ebd8/src/typecode/contenttype.py#L308 I think we should reopen to fix (or create a new ticket) ---------- nosy: +pombredanne _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 10:29:27 2021 From: report at bugs.python.org (Philippe Ombredanne) Date: Sat, 09 Jan 2021 15:29:27 +0000 Subject: [issue4963] mimetypes.guess_extension result changes after mimetypes.init() In-Reply-To: <1232107494.83.0.0570958889295.issue4963@psf.upfronthosting.co.za> Message-ID: <1610206167.75.0.153728965862.issue4963@roundup.psfhosted.org> Philippe Ombredanne added the comment: Actually this is problematic on multiples counts: 1. the behaviour changes and this is a regression 2. even if that new buggy behaviour was the one to use, it should not give preference to knownfiles ovr init-provided files, but at least take the provided files first and knownfiles second. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 11:19:40 2021 From: report at bugs.python.org (Faisal Mahmood) Date: Sat, 09 Jan 2021 16:19:40 +0000 Subject: [issue42861] ipaddress - add ability to get next closet network of any prefix size In-Reply-To: <1610065851.06.0.929191666424.issue42861@roundup.psfhosted.org> Message-ID: <1610209180.12.0.133914214217.issue42861@roundup.psfhosted.org> Faisal Mahmood added the comment: Updated the title and method naming, I previously mentioned the "next subnet" and called the method "next_subnet", but technically this is wrong. What this method should be doing is finding the next closest network of prefix size n. So I guess the method definition should be: `next_network(self, next_network=None)` ---------- title: ipaddress - add ability to get next closet subnet of any prefix size -> ipaddress - add ability to get next closet network of any prefix size _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 11:32:45 2021 From: report at bugs.python.org (Ammar Askar) Date: Sat, 09 Jan 2021 16:32:45 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610209965.89.0.465839779286.issue42800@roundup.psfhosted.org> Ammar Askar added the comment: `tb_frame` is documented under https://docs.python.org/3/reference/datamodel.html > Special read-only attributes: tb_frame points to the execution frame of the current level `tb_code` can similarly be documented here and the note about the audit event can be added. Thanks for the patch Ryan, would you like to add the documentation change Steve suggested and create a pull request out of it and contribute it? (https://devguide.python.org/pullrequest/) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 12:04:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 09 Jan 2021 17:04:35 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610211875.25.0.066579488231.issue42850@roundup.psfhosted.org> Guido van Rossum added the comment: No, let's leave 3.7 alone -- it's in security-fixes-only mode. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 12:19:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 09 Jan 2021 17:19:18 +0000 Subject: [issue42870] Document changed argparse output wrt optional arguments in What's new in Python 3.10 In-Reply-To: <1610149853.78.0.949568295376.issue42870@roundup.psfhosted.org> Message-ID: <1610212758.45.0.758820943904.issue42870@roundup.psfhosted.org> Guido van Rossum added the comment: Quickest way to get that done is to send in a PR that updates whatsnew. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 13:21:34 2021 From: report at bugs.python.org (Pavel Ditenbir) Date: Sat, 09 Jan 2021 18:21:34 +0000 Subject: [issue42875] argparse incorrectly shows help string on a new line in case of long command string In-Reply-To: <1610202899.54.0.332342565241.issue42875@roundup.psfhosted.org> Message-ID: <1610216494.15.0.706178353705.issue42875@roundup.psfhosted.org> Change by Pavel Ditenbir : ---------- keywords: +patch pull_requests: +23003 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 13:40:48 2021 From: report at bugs.python.org (Andreas Zeller) Date: Sat, 09 Jan 2021 18:40:48 +0000 Subject: [issue42876] '''"""''' != '""""' Message-ID: <1610217648.49.0.452941613308.issue42876@roundup.psfhosted.org> New submission from Andreas Zeller : The following line of code fails in Python 3.6, which I find surprising. >>> assert '''"""''' == '""""' # Fails Note that the following all pass as expected: >>> assert """'''""" == "'''" # Passes >>> assert '''""''' == '""' # Passes ---------- components: Interpreter Core messages: 384736 nosy: andreas-zeller priority: normal severity: normal status: open title: '''"""''' != '""""' type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 13:42:06 2021 From: report at bugs.python.org (mattip) Date: Sat, 09 Jan 2021 18:42:06 +0000 Subject: [issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem) In-Reply-To: <1609023821.09.0.189504509221.issue42752@roundup.psfhosted.org> Message-ID: <1610217726.77.0.728697349321.issue42752@roundup.psfhosted.org> mattip added the comment: In the expert index https://devguide.python.org/experts/ it lists @davin, @pitrou as referrents for multiprocessing. Adding then to the Nosy list ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 14:11:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 09 Jan 2021 19:11:00 +0000 Subject: [issue42877] TracebackException saves more data than it needs Message-ID: <1610219460.26.0.944321944788.issue42877@roundup.psfhosted.org> New submission from Irit Katriel : TracebackException saves both __cause__ and __context__ even though format() ignores the __context__ if there is __cause__. If we change the constructor to save only what format() needs, it will save space and simplify the code. ---------- components: Library (Lib) messages: 384738 nosy: iritkatriel priority: normal severity: normal status: open title: TracebackException saves more data than it needs type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 14:14:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 09 Jan 2021 19:14:18 +0000 Subject: [issue42877] TracebackException saves more data than it needs In-Reply-To: <1610219460.26.0.944321944788.issue42877@roundup.psfhosted.org> Message-ID: <1610219658.98.0.960300597432.issue42877@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +23005 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 14:15:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 09 Jan 2021 19:15:18 +0000 Subject: [issue42877] TracebackException saves more data than it needs In-Reply-To: <1610219460.26.0.944321944788.issue42877@roundup.psfhosted.org> Message-ID: <1610219718.35.0.61956672729.issue42877@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 14:20:54 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 09 Jan 2021 19:20:54 +0000 Subject: [issue42876] '''"""''' != '""""' In-Reply-To: <1610217648.49.0.452941613308.issue42876@roundup.psfhosted.org> Message-ID: <1610220054.59.0.610345767106.issue42876@roundup.psfhosted.org> Eryk Sun added the comment: > assert '''"""''' == '""""' # Fails The left-hand side is a triple-quote string literal [1][2] that contains 3 double-quote characters. The right-hand side is a single-quote string literal that contains 4 double-quote characters. Use the interactive shell to check the values. For example: >>> list('''"""''') ['"', '"', '"'] >>> list('""""') ['"', '"', '"', '"'] If you have difficulty understanding an aspect of the language syntax, please ask a question in an appropriate forum such as python-tutor, python-list, or Stack Overflow. --- [1] https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals [2] https://docs.python.org/3/tutorial/introduction.html#strings ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 14:36:24 2021 From: report at bugs.python.org (Faisal Mahmood) Date: Sat, 09 Jan 2021 19:36:24 +0000 Subject: [issue42861] ipaddress - add ability to get next closet network of any prefix size In-Reply-To: <1610065851.06.0.929191666424.issue42861@roundup.psfhosted.org> Message-ID: <1610220984.62.0.713952884403.issue42861@roundup.psfhosted.org> Change by Faisal Mahmood : ---------- keywords: +patch pull_requests: +23006 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24180 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 15:31:09 2021 From: report at bugs.python.org (Yair Frid) Date: Sat, 09 Jan 2021 20:31:09 +0000 Subject: [issue42766] urllib.request.HTTPPasswordMgr uses commonprefix instead of commonpath In-Reply-To: <1609170153.96.0.504551551924.issue42766@roundup.psfhosted.org> Message-ID: <1610224269.49.0.0616801033073.issue42766@roundup.psfhosted.org> Change by Yair Frid : ---------- keywords: +patch nosy: +Fongeme nosy_count: 1.0 -> 2.0 pull_requests: +23007 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24181 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 16:23:37 2021 From: report at bugs.python.org (Yair Frid) Date: Sat, 09 Jan 2021 21:23:37 +0000 Subject: [issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order Message-ID: <1610227417.16.0.538971054996.issue42878@roundup.psfhosted.org> New submission from Yair Frid : In docs, it mentions that the function returns true if the base is a 'suburi' of test, but in reality, if is_suburi(base, test) then is_suburi(test, base) which is wrong in most cases (other than where base ~= test, meaning they are the same location) I am unsure which versions of python are affected, but i suspect most of them (although we probably shouldn't backport this fix?) ---------- components: Library (Lib) messages: 384741 nosy: Fongeme priority: normal pull_requests: 23009 severity: normal status: open title: urllib.request.HTTPPasswordMgr.is_suburi does not care about order _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 17:45:17 2021 From: report at bugs.python.org (Timothy Geiser) Date: Sat, 09 Jan 2021 22:45:17 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610232317.38.0.00811342199429.issue33065@roundup.psfhosted.org> Timothy Geiser added the comment: This issue is still open, 8.5 months after identifying the underlying cause. What needs done to get a fix for this merged? Manual testing, or adding test cases? Anything I can do to help? I have 3.9.1 successfully built on a Raspberry Pi that I can reproduce the issue on, as well as reproduce the fix Terry suggested in msg366981. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 17:50:07 2021 From: report at bugs.python.org (Jason Oliver) Date: Sat, 09 Jan 2021 22:50:07 +0000 Subject: [issue42879] SystemError from class 'int' Message-ID: <1610232607.93.0.155495951465.issue42879@roundup.psfhosted.org> New submission from Jason Oliver : This is my first bug report so I hope that this is correctly formatted. I am learning how to use pygame and encountered the following error: SystemError: returned a result with an error set I googled the error message and came across the following answer on stackoverflow: https://stackoverflow.com/a/53796516 This stated that the problem could exist within the implementation of python and that I should file a bug report here. I am using the following software installed through pip/pip3: Python 3.8.4 pygame 2.0.1 OS Edition: Windows 10 Pro OS Version: 20H2 OS build: 19042.685 The bug can be reproduced deterministically. ---------- files: Movement.py messages: 384743 nosy: jollyoliver657 priority: normal severity: normal status: open title: SystemError from class 'int' versions: Python 3.8 Added file: https://bugs.python.org/file49731/Movement.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 17:52:14 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 09 Jan 2021 22:52:14 +0000 Subject: [issue42531] importlib.resources.path() raises TypeError for packages without __file__ In-Reply-To: <1606890702.39.0.177441013455.issue42531@roundup.psfhosted.org> Message-ID: <1610232734.05.0.344436223876.issue42531@roundup.psfhosted.org> Jason R. Coombs added the comment: > Regardless of whether PR 23611 is accepted, the test that it adds should be added to Python master to guard against regressions. I can submit that as a separate PR. Before I do that, do I need to create a new bpo ticket, or can I just reference this one? For that, please submit a PR to importlib_resources and it will get synced to CPython later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 18:21:01 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 09 Jan 2021 23:21:01 +0000 Subject: [issue42531] importlib.resources.path() raises TypeError for packages without __file__ In-Reply-To: <1606890702.39.0.177441013455.issue42531@roundup.psfhosted.org> Message-ID: <1610234461.84.0.57947599526.issue42531@roundup.psfhosted.org> Jason R. Coombs added the comment: Can you tell me more about the use-case that exhibited this undesirable behavior? That is, what loader is it that supports `open_binary` but not `is_resource` and doesn't have a `__origin__`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 19:09:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 10 Jan 2021 00:09:46 +0000 Subject: [issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610237386.8.0.972890116354.issue42872@roundup.psfhosted.org> Irit Katriel added the comment: See also issue41737. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 20:13:33 2021 From: report at bugs.python.org (Robin Scheibler) Date: Sun, 10 Jan 2021 01:13:33 +0000 Subject: [issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package In-Reply-To: <1610000036.98.0.246954881352.issue42850@roundup.psfhosted.org> Message-ID: <1610241213.06.0.641936663163.issue42850@roundup.psfhosted.org> Robin Scheibler added the comment: Thank you very much for your help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 20:14:50 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 10 Jan 2021 01:14:50 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610241290.63.0.87158722131.issue42800@roundup.psfhosted.org> Change by Ryan Hileman : ---------- keywords: +patch pull_requests: +23010 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 20:17:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 01:17:47 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610241467.05.0.321757982311.issue42867@roundup.psfhosted.org> Terry J. Reedy added the comment: No problem. While your failing example was 'too long', you *did* search and find the appropriate previous issue, with my inadequate response and incorrect resolution, even though closed. I appreciate having my understanding fixed. IDLE uses several entry boxes in dialogs. I have partially replaced error message boxes with error messages in the dialog. For example, Open Module (Alt-M at least on Windows) opens a dialog to open a module. Enter a bad name and "Error: module not found" is printed in red below, leaving the cursor in the entry box so the user can correct it (or Cancel). As is turn out, this avoids any possibility of running into this bug. I might have run into it before I replaced most old dialog + error box uses, but I now know to watch out in those remaining. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 20:46:04 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 10 Jan 2021 01:46:04 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1610243164.31.0.598948519852.issue42800@roundup.psfhosted.org> Ryan Hileman added the comment: PR submitted, waiting on CLA process. I added documentation at the field sites, but the audit event table generation does not handle attributes or object.__getattr__ very well at all, so I'm not updating the audit table for now. The `.. audit-event:: object.__getattr__ obj,name frame-objects` sphinx directive right now just inserts a canned string """Raises an :ref:`auditing event ` object.__getattr__ with arguments obj,name.""", which would need additional boilerplate to describe these attributes properly. It also only adds a footnote style link to the audit table under __getattr__, and even moves object.__getattribute__ from the first [1] link position to a later number which is IMO is more confusing than not even linking them. I think to make attributes look good in the table we would need a special sphinx directive for audited object.__getattr__ attributes, for example by modifying the template generator to fit each attribute on its own line under object.__getattr__ in the table. For now I did not use the audit-event sphinx directive and manually inserted strings like this near the original attribute description in the docs: """Accessing ``f_code`` raises an :ref:`auditing event ` ``object.__getattr__`` with arguments ``obj`` and ``"f_code"``.""" I think audit table improvements should be handled in a separate issue, and by someone more familiar with that part of the doc generator, as cleaning it up looks like maybe a bigger scope than the current contribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 21:17:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 02:17:07 +0000 Subject: [issue4963] mimetypes.guess_extension result changes after mimetypes.init() In-Reply-To: <1232107494.83.0.0570958889295.issue4963@psf.upfronthosting.co.za> Message-ID: <1610245027.47.0.292383517518.issue4963@roundup.psfhosted.org> Terry J. Reedy added the comment: Phillipe: I was the first to comment, but had no futher involvement with this issue until now. Multiple people, including coredevs, considered the old behavior to be buggy and multiple people, including coredevs, contributed to the fix. You are unlikely to prevail arguing that the change is totally a mistake and should be totally reverted. > the behaviour changes and this is a regression Code bug fixes are supposed to change behavior. We know that the change will break code that depends on the buggy behavior. That is why we include an updated change log with each release. The intended change is *not* a regression in itself. A regression in a bug fix is an unintended change to some other behavior. I don't believe (but could be mistaken) that you have argued or shown this. Assuming that you are not asking for complete reversion, I suggest that you open a new issue, referencing this one, but taking the current behavior as the given. Propose a revised behavior and argue that it is even better. If you want to argue that the current behavior is buggy (compared to the current docs) so that your proposed revision should be backported, make that a separate argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 9 21:29:29 2021 From: report at bugs.python.org (Hong Xu) Date: Sun, 10 Jan 2021 02:29:29 +0000 Subject: [issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes In-Reply-To: <1610180126.52.0.315552258683.issue42872@roundup.psfhosted.org> Message-ID: <1610245769.93.0.265781044177.issue42872@roundup.psfhosted.org> Hong Xu added the comment: Should we update the document at least? The document doesn't mention NotADirectoryError or its super classes at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 01:35:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 06:35:11 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610260511.04.0.856405459431.issue33065@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +23011 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/24183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 01:39:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 06:39:17 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610260757.01.0.777539609498.issue33065@roundup.psfhosted.org> Terry J. Reedy added the comment: I am reluctant to make changes without adding tests, and until I focused again on how to do so, because of your ping, I had no idea how to do so. The added test results in the same error, "AttributeError: 'BinData' object has no attribute 'length'" without the patch and passes with it. ---------- stage: patch review -> commit review versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 01:59:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 06:59:54 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610261994.69.0.500003330776.issue33065@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 81f87bbf9f65702062021a78abd9b8f82c98a414 by Terry Jan Reedy in branch 'master': bpo-33065: Fix problem debugging user classes with __repr__ method (GH-24183) https://github.com/python/cpython/commit/81f87bbf9f65702062021a78abd9b8f82c98a414 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:00:28 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 10 Jan 2021 07:00:28 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610262028.63.0.146517777256.issue33065@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +23012 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/24184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:00:38 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 10 Jan 2021 07:00:38 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610262038.27.0.600560403527.issue33065@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23013 pull_request: https://github.com/python/cpython/pull/24185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:31:11 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 10 Jan 2021 07:31:11 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610263871.95.0.0469592531123.issue33065@roundup.psfhosted.org> miss-islington added the comment: New changeset 5ded7efa6a7a232dd4a41e6e65e4dae47146514b by Miss Islington (bot) in branch '3.8': bpo-33065: Fix problem debugging user classes with __repr__ method (GH-24183) https://github.com/python/cpython/commit/5ded7efa6a7a232dd4a41e6e65e4dae47146514b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:31:11 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 10 Jan 2021 07:31:11 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610263871.68.0.504031235365.issue33065@roundup.psfhosted.org> miss-islington added the comment: New changeset 799f8489d418b7f9207d333eac38214931bd7dcc by Miss Islington (bot) in branch '3.9': bpo-33065: Fix problem debugging user classes with __repr__ method (GH-24183) https://github.com/python/cpython/commit/799f8489d418b7f9207d333eac38214931bd7dcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:41:58 2021 From: report at bugs.python.org (Ziqiao Kong) Date: Sun, 10 Jan 2021 07:41:58 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon Message-ID: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> New submission from Ziqiao Kong : Hello! Thanks for your contribution on porting python to native Apple Silicon. I have noticed that there is an issue https://bugs.python.org/issue41100 and corresponding Github PR https://github.com/python/cpython/pull/22855 stating that variadic functions ABI has been corrected. However, during our test, it still doesn't work on Apple Silicon with brew-installed python 3.9.1 and python 3..10.0a4 built from sources. The details are as follows: A x86_64 Mojave Macmini with python 3.8: ``` /tmp $ python3 --version Python 3.8.6 /tmp $ uname -a Darwin *** 18.7.0 Darwin Kernel Version 18.7.0: Mon Apr 27 20:09:39 PDT 2020; root:xnu-4903.278.35~1/RELEASE_X86_64 x86_64 /tmp $ cat main.c #include #include #include void test(uint64_t end, ...){ int a; va_list valist; va_start(valist, end); a = va_arg(valist, int); va_end(valist); printf("%d\n", a); return; } /tmp $ cc -shared -g main.c -o ./main.dylib /tmp $ cat test_main.py from ctypes import * d = CDLL("./main.dylib") d.test.restype = None d.test(c_uint64(12), c_int(34)) /tmp $ python3 test_main.py 34 /tmp $ ``` An M1 Macbook Pro with brew-installed python 3.9.1 ``` kabeor at kamino /tmp % python3 --version Python 3.9.1 kabeor at kamino /tmp % cat main.c #include #include #include void test(uint64_t end, ...){ int a; va_list valist; va_start(valist, end); a = va_arg(valist, int); va_end(valist); printf("%d\n", a); return; } kabeor at kamino /tmp % cc -shared -g main.c -o ./main.dylib kabeor at kamino /tmp % cat test_main.py from ctypes import * d = CDLL("./main.dylib") d.test.restype = None d.test(c_uint64(12), c_int(34)) kabeor at kamino /tmp % python3 test_main.py 48144104 kabeor at kamino /tmp % ``` An M1 Macbook Pro with python 3.10.0a4 built from Github release tarball ``` kabeor at kamino cpython-3.10.0a4 % ./python.exe --version Python 3.10.0a4 kabeor at kamino cpython-3.10.0a4 % cp /tmp/main.c ./ kabeor at kamino cpython-3.10.0a4 % cp /tmp/test_main.py ./ kabeor at kamino cpython-3.10.0a4 % ./python.exe --version Python 3.10.0a4 kabeor at kamino cpython-3.10.0a4 % cat ./main.c #include #include #include void test(uint64_t end, ...){ int a; va_list valist; va_start(valist, end); a = va_arg(valist, int); va_end(valist); printf("%d\n", a); return; } kabeor at kamino cpython-3.10.0a4 % cc -shared -g main.c -o ./main.dylib kabeor at kamino cpython-3.10.0a4 % cat test_main.py from ctypes import * d = CDLL("./main.dylib") d.test.restype = None d.test(c_uint64(12), c_int(34)) kabeor at kamino cpython-3.10.0a4 % ./python.exe test_main.py 3 kabeor at kamino cpython-3.10.0a4 % ``` Thanks in advance! ---------- components: ctypes messages: 384756 nosy: lawrence-danna-apple, lazymio priority: normal severity: normal status: open title: ctypes: variadic function call still doesn't work on Apple Silicon versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 02:43:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 07:43:30 +0000 Subject: [issue33065] IDLE debugger: failure stepping through module loading In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1610264610.01.0.170857947817.issue33065@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 03:51:29 2021 From: report at bugs.python.org (hai shi) Date: Sun, 10 Jan 2021 08:51:29 +0000 Subject: [issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API In-Reply-To: <1600265269.2.0.881235166904.issue41798@roundup.psfhosted.org> Message-ID: <1610268689.6.0.0225762228968.issue41798@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +23014 pull_request: https://github.com/python/cpython/pull/24186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 05:07:19 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 10 Jan 2021 10:07:19 +0000 Subject: [issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac In-Reply-To: <1607682860.38.0.598588089863.issue42619@roundup.psfhosted.org> Message-ID: <1610273239.69.0.273897281209.issue42619@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- keywords: +patch pull_requests: +23015 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 05:10:17 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 10 Jan 2021 10:10:17 +0000 Subject: [issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac In-Reply-To: <1607682860.38.0.598588089863.issue42619@roundup.psfhosted.org> Message-ID: <1610273417.63.0.787585322192.issue42619@roundup.psfhosted.org> 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 arm64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 05:34:42 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 10 Jan 2021 10:34:42 +0000 Subject: [issue42619] python 3.9.1 failed to create .so files as universal2 (arm64, x86_64) on Mac In-Reply-To: <1607682860.38.0.598588089863.issue42619@roundup.psfhosted.org> Message-ID: <1610274882.97.0.596013952014.issue42619@roundup.psfhosted.org> 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: # Use the original CFLAGS value, if available, so that we # return the same machine type for the platform string. # Otherwise, distutils may consider this a cross-compiling # case and disallow installs. That indicates that fixing the value of sysconfig.get_platform() when using a "universal2" python on a system that doesn't support arm64 might break distils. I haven't done further research on this. In general I'd prefer to create the correct platform tag, but not if that results in not being able to install extensions. ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 06:05:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 10 Jan 2021 11:05:03 +0000 Subject: [issue42879] SystemError from class 'int' In-Reply-To: <1610232607.93.0.155495951465.issue42879@roundup.psfhosted.org> Message-ID: <1610276703.55.0.883898296048.issue42879@roundup.psfhosted.org> 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 exception, that function should return NULL or -1.) That then leaves things in an inconsistent state, and Python doesn't notice that inconsistent state until the "int" call happens. Please could you report to the Pygame folks, if you haven't done so already? It certainly is *possible* that it's actually a core Python bug, but even then the first step would be to eliminate the Pygame component from the code-to-reproduce. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 06:29:52 2021 From: report at bugs.python.org (Larry Hastings) Date: Sun, 10 Jan 2021 11:29:52 +0000 Subject: [issue42881] Should typing.get_type_hints change None annotations? Message-ID: <1610278192.15.0.512262305909.issue42881@roundup.psfhosted.org> 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 typing.get_type_hints() on your __init__ function, you'll find it has turned "None" into "type(None)". git blame suggests get_type_hints' behavior was in the initial checkin of typing.py (46dbb7d1032c19163f37785509b8f5b3004416e8). So it's always behaved this way. Is "None" still considered the correct return annotation of an __init__? If so, should typing.get_type_hints() really be changing it to type(None)? ---------- components: Library (Lib) messages: 384760 nosy: eric.smith, gvanrossum, larry priority: low severity: normal stage: test needed status: open title: Should typing.get_type_hints change None annotations? type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 08:00:18 2021 From: report at bugs.python.org (Yannick Jadoul) Date: Sun, 10 Jan 2021 13:00:18 +0000 Subject: [issue42882] Restarting the interpreter causes UB on 3.10.0a4 Message-ID: <1610283618.64.0.475556781159.issue42882@roundup.psfhosted.org> 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 machine: ``` #include int main() { Py_InitializeEx(1); Py_Finalize(); Py_InitializeEx(1); PyRun_SimpleString("class Widget: pass\n" "class DerivedWidget(Widget):\n" " def __init__(self):\n" " super().__init__()\n"); Py_Finalize(); printf("Works\n"); return 0; } ``` Removing the two lines in the middle that restart the interpreter makes the example work. I've also bisected CPython to find the issue (3.10.0a3 is fine, 3.10.0a4 is not), and arrived at https://github.com/python/cpython/pull/20058 (ba3d67c2fb04a7842741b1b6da5d67f22c579f33 being the first commit that breaks the example above). But I am not entirely sure where to start debugging. The reproducing example above consistently crashes on my local machine (SIGABRT, exit code 134): ``` Fatal Python error: compiler_make_closure: lookup '__class__' in DerivedWidget 5 -1 freevars of __init__: ('__class__',) Python runtime state: initialized Current thread 0x00007f036485b680 (most recent call first): Aborted (core dumped) ``` But note that in the pybind11 tests, the underlying issue causes a different error (Python throwing a weird, seemingly unrelated exception). So something seems to be messed up in the interpreter internals, and the above example just triggers it. ---------- components: Interpreter Core messages: 384761 nosy: YannickJadoul priority: normal severity: normal status: open title: Restarting the interpreter causes UB on 3.10.0a4 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 08:45:21 2021 From: report at bugs.python.org (Jason Oliver) Date: Sun, 10 Jan 2021 13:45:21 +0000 Subject: [issue42879] SystemError from class 'int' In-Reply-To: <1610232607.93.0.155495951465.issue42879@roundup.psfhosted.org> Message-ID: <1610286321.47.0.323633251993.issue42879@roundup.psfhosted.org> Jason Oliver added the comment: I will submit the bug report to the pygame bug tracker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 09:04:58 2021 From: report at bugs.python.org (karl) Date: Sun, 10 Jan 2021 14:04:58 +0000 Subject: [issue41748] HTMLParser: comma in attribute values with/without space In-Reply-To: <1599602370.01.0.842812753139.issue41748@roundup.psfhosted.org> Message-ID: <1610287498.01.0.497536332422.issue41748@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 09:33:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 10 Jan 2021 14:33:00 +0000 Subject: [issue42879] SystemError from class 'int' In-Reply-To: <1610232607.93.0.155495951465.issue42879@roundup.psfhosted.org> Message-ID: <1610289180.37.0.452546537733.issue42879@roundup.psfhosted.org> 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) ^ (PyErr_Occurred() != NULL)' failed. Fatal Python error: Aborted Current thread 0x00007fc3d0b6e280 (most recent call first): File "Movement.py", line 47 in writeGridToSurface File "Movement.py", line 100 in It is very likely a bug in Pygame. Perhaps it was always here, just Python 3.8 is more strict to programming errors in extensions. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 09:36:26 2021 From: report at bugs.python.org (hai shi) Date: Sun, 10 Jan 2021 14:36:26 +0000 Subject: [issue42875] argparse incorrectly shows help string on a new line in case of long command string In-Reply-To: <1610202899.54.0.332342565241.issue42875@roundup.psfhosted.org> Message-ID: <1610289386.57.0.972065576121.issue42875@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 09:43:44 2021 From: report at bugs.python.org (Haoyang) Date: Sun, 10 Jan 2021 14:43:44 +0000 Subject: [issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty Message-ID: <1610289824.57.0.574510344597.issue42883@roundup.psfhosted.org> 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__ function with default value empty list. Every time I create a new instance of this class and append one new variable to "self.a", the default value of "b" changed at the next time I create another instance of class A. The outcome of this code snippet is a = [] [1] a = [1] [1, 1] a = [1, 1] [1, 1, 1] I am new to python. Is it a legal behavior in python? If yes, what is the principle beneath it? Thanks in advance! ---------- files: test.py messages: 384765 nosy: haoyang9804 priority: normal severity: normal status: open title: __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49732/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 09:58:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 10 Jan 2021 14:58:42 +0000 Subject: [issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty In-Reply-To: <1610289824.57.0.574510344597.issue42883@roundup.psfhosted.org> Message-ID: <1610290722.49.0.0935357861152.issue42883@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 10:00:28 2021 From: report at bugs.python.org (Haoyang) Date: Sun, 10 Jan 2021 15:00:28 +0000 Subject: [issue42883] __init__ function may incur an incorrect behavior if passing a list as a parameter and set its default value as empty In-Reply-To: <1610289824.57.0.574510344597.issue42883@roundup.psfhosted.org> Message-ID: <1610290828.86.0.706924159743.issue42883@roundup.psfhosted.org> Haoyang added the comment: Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 11:25:35 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 10 Jan 2021 16:25:35 +0000 Subject: [issue42881] Should typing.get_type_hints change None annotations? In-Reply-To: <1610278192.15.0.512262305909.issue42881@roundup.psfhosted.org> Message-ID: <1610295935.07.0.23823996581.issue42881@roundup.psfhosted.org> 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: https://www.python.org/dev/peps/pep-0484/#using-none "When used in a type hint, the expression None is considered equivalent to type(None)." But I find it odd that get_type_hints would make this determination for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 11:32:35 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 10 Jan 2021 16:32:35 +0000 Subject: [issue42881] Should typing.get_type_hints change None annotations? In-Reply-To: <1610278192.15.0.512262305909.issue42881@roundup.psfhosted.org> Message-ID: <1610296355.44.0.225087591856.issue42881@roundup.psfhosted.org> 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 only correct spelling? There should one -- and preferably only one -- obvious way to do it etc." Despite the fact that I'd also like to see only one way to do things, other than tests that will break when using get_type_hints instead of looking at annotations directly, I'm not sure it makes much difference. People already need to treat type(None) as equivalent to None for annotations: we're late to the game for making a change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 12:47:48 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 10 Jan 2021 17:47:48 +0000 Subject: [issue42129] Support resources in namespace packages In-Reply-To: <1603469006.87.0.128715336786.issue42129@roundup.psfhosted.org> Message-ID: <1610300868.57.0.56373394338.issue42129@roundup.psfhosted.org> 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 (https://importlib-resources.readthedocs.io/en/latest/history.html#v5-0-0). Applying these changes to cpython and running the tests, there appear to be two emergent failure modes: ``` cpython master $ http --follow https://github.com/python/importlib_resources/archive/cpython.zip | bsdtar --strip-components 1 -x $ ./python.exe Tools/scripts/run_tests.py test.test_importlib 2>&1 | gist -Pc https://gist.github.com/dde7d5a951d92726380dced21503f843 ``` In my estimation, the first two failures are due to the change in the abc.ResourceReader for contents to raise FileNotFoundError. And the latter failures are seemingly due to the built-in NamespaceLoader not having a resource reader. I suspect the fix here is to add a .get_resource_reader() method to _NamespaceLoader to return a NamespaceReader. (hint: when updating _bootstrap_external.py, you'll need to run `make regen-importlib` or `make regen-all` and recompile). Filipe, would you be interested in exploring these issues and propose some fixes and prepare the PR that applies the changes to CPython? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 12:49:48 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 17:49:48 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610300988.12.0.898682236477.issue42880@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:01:31 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 18:01:31 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610301691.48.0.176256816881.issue42880@roundup.psfhosted.org> 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 sure the brew Pythons are using the macOS 11 system libffi and not their own or older version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:17:53 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 18:17:53 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610302673.7.0.159708845286.issue42880@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 13:20:25 2021 From: report at bugs.python.org (Ziqiao Kong) Date: Sun, 10 Jan 2021 18:20:25 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610302673.7.0.159708845286.issue42880@roundup.psfhosted.org> Message-ID: 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.org at roundup.psfhosted.org on behalf of Ned Deily Sent: Monday, January 11, 2021 2:17:53 AM To: ziqiaokong at gmail.com Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon 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 _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:24:32 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 18:24:32 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610303072.58.0.0673161139693.issue42880@roundup.psfhosted.org> 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 version 1.0.0, current version 27.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.106.0) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:29:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 10 Jan 2021 18:29:48 +0000 Subject: [issue42882] Restarting the interpreter causes UB on 3.10.0a4 In-Reply-To: <1610283618.64.0.475556781159.issue42882@roundup.psfhosted.org> Message-ID: <1610303388.07.0.85228418.issue42882@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:30:29 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 18:30:29 +0000 Subject: [issue42874] running configure on Solaris 10 gives grep "illegal option" errors In-Reply-To: <1610194453.5.0.66216438534.issue42874@roundup.psfhosted.org> Message-ID: <1610303429.49.0.386694208295.issue42874@roundup.psfhosted.org> Change by Ned Deily : ---------- title: configure errors -> running configure on Solaris 10 gives grep "illegal option" errors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 13:30:55 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 10 Jan 2021 18:30:55 +0000 Subject: [issue42874] running configure on Solaris 10 gives grep "illegal option" errors In-Reply-To: <1610194453.5.0.66216438534.issue42874@roundup.psfhosted.org> Message-ID: <1610303455.35.0.729244630581.issue42874@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Build -Installation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 14:51:50 2021 From: report at bugs.python.org (Daniel Nicorici) Date: Sun, 10 Jan 2021 19:51:50 +0000 Subject: [issue42884] array.index() missing start and end Message-ID: <1610308310.47.0.185082010282.issue42884@roundup.psfhosted.org> 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 occurrence of x in the array). For example, bytearray.index() has start and end and list.index() has also start and end, but for some reason start and end are missing from array.index. ---------- messages: 384775 nosy: daniel.nicorici priority: normal severity: normal status: open title: array.index() missing start and end type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 14:53:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 10 Jan 2021 19:53:22 +0000 Subject: [issue34804] Repetition of 'for example' in documentation In-Reply-To: <1537939388.49.0.545547206417.issue34804@psf.upfronthosting.co.za> Message-ID: <1610308402.78.0.122273538307.issue34804@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 15:13:17 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 10 Jan 2021 20:13:17 +0000 Subject: [issue42129] Support resources in namespace packages In-Reply-To: <1603469006.87.0.128715336786.issue42129@roundup.psfhosted.org> Message-ID: <1610309597.22.0.271455051406.issue42129@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 15:15:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 10 Jan 2021 20:15:05 +0000 Subject: [issue42884] array.index() missing start and end In-Reply-To: <1610308310.47.0.185082010282.issue42884@roundup.psfhosted.org> Message-ID: <1610309705.41.0.841203621576.issue42884@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 15:44:30 2021 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 10 Jan 2021 20:44:30 +0000 Subject: [issue42884] array.index() missing start and end In-Reply-To: <1610308310.47.0.185082010282.issue42884@roundup.psfhosted.org> Message-ID: <1610311470.91.0.377764438189.issue42884@roundup.psfhosted.org> Zackery Spytz added the comment: This seems like a duplicate of bpo-31956. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 15:58:40 2021 From: report at bugs.python.org (Roland Hieber) Date: Sun, 10 Jan 2021 20:58:40 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1610312320.64.0.981002547344.issue13501@roundup.psfhosted.org> Change by Roland Hieber : ---------- pull_requests: +23016 pull_request: https://github.com/python/cpython/pull/24189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 16:14:18 2021 From: report at bugs.python.org (John McCabe) Date: Sun, 10 Jan 2021 21:14:18 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610313258.29.0.996658636226.issue42867@roundup.psfhosted.org> 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 than necessary cutting it down. However, for the record, hope the below example is better. As before, changing: self.createWidgets() to: self.after_idle(self.createWidgets()) avoids the issue. ----- #!/usr/bin/python3 import tkinter as tk from tkinter import messagebox class Application(tk.Frame): def __init__(self, master): super().__init__(master) self.master = master self.pack() self.createWidgets() def createWidgets(self): tk.messagebox.askquestion("Use An Existing File", "Do you want to load and use an existing file?") tk.Entry(self.master, width = 20).pack() if __name__ == "__main__": root = tk.Tk() app = Application(root) app.mainloop() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 16:16:39 2021 From: report at bugs.python.org (John McCabe) Date: Sun, 10 Jan 2021 21:16:39 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610313399.51.0.503424821586.issue42867@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 16:30:03 2021 From: report at bugs.python.org (Roland Hieber) Date: Sun, 10 Jan 2021 21:30:03 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1610314203.06.0.18216808726.issue13501@roundup.psfhosted.org> 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 to the current master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 16:45:24 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 10 Jan 2021 21:45:24 +0000 Subject: [issue42129] Support resources in namespace packages In-Reply-To: <1603469006.87.0.128715336786.issue42129@roundup.psfhosted.org> Message-ID: <1610315124.97.0.673106083039.issue42129@roundup.psfhosted.org> 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 _______________________________________ From report at bugs.python.org Sun Jan 10 16:58:21 2021 From: report at bugs.python.org (Arnim Rupp) Date: Sun, 10 Jan 2021 21:58:21 +0000 Subject: [issue42885] Regex performance problem with ^ aka AT_BEGINNING Message-ID: <1610315901.41.0.467379667553.issue42885@roundup.psfhosted.org> 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' * 1000000000) It takes longer, the longer the string is. The string handling is not the problem, checking if it starts which an A takes just 0.00014 seconds. See output and code below: 3.10.0a4+ (heads/master:d16f617, Jan 9 2021, 13:24:45) [GCC 7.5.0] testing string len: 100000 re_test_false: 0.0008246829966083169 testing string len: 1000000000 re_test_false: 7.317708015005337 testing string len: 1000000000 re_test_true: 0.00014710200048284605 import re, timeit, functools, sys def re_test_true(string): print("testing string len: ", len(string)) re.search(r'^A', string) def re_test_false(string): print("testing string len: ", len(string)) re.search(r'^x', string) print(sys.version) huge_string = 'A' * 100000 print('re_test_false: ', timeit.timeit(functools.partial(re_test_false, huge_string), number=1)) huge_string = 'A' * 1000000000 print('re_test_false: ', timeit.timeit(functools.partial(re_test_false, huge_string), number=1)) print('re_test_true: ', timeit.timeit(functools.partial(re_test_true, huge_string), number=1)) ---------- components: Library (Lib) files: regex_timeit.py messages: 384782 nosy: another_try priority: normal severity: normal status: open title: Regex performance problem with ^ aka AT_BEGINNING type: performance versions: Python 3.10 Added file: https://bugs.python.org/file49733/regex_timeit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 17:44:43 2021 From: report at bugs.python.org (Camion) Date: Sun, 10 Jan 2021 22:44:43 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions Message-ID: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> 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 >>> f=fractions.Fraction(math.factorial(10000), math.factorial(20000)+1) >>> math.log(f.numerator)-math.log(f.denominator) -95966.69390038431 >>> math.log(f) Traceback (most recent call last): File "", line 1, in math.log(f) ValueError: math domain error >>> math.log10(f.numerator)-math.log10(f.denominator) -41677.80560743537 >>> math.log10(f) Traceback (most recent call last): File "", line 1, in math.log10(f) ValueError: math domain error ---------- components: Library (Lib) messages: 384783 nosy: Camion priority: normal severity: normal status: open title: math.log and math.log10 domain error on very large Fractions versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 18:09:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 10 Jan 2021 23:09:41 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610320181.77.0.718669371821.issue42886@roundup.psfhosted.org> 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 denominator. In your example, the result is smaller than the smallest representable positive float (2**-1074), so the result gets rounded down to 0.0. The log10() function isn't defined for zero: >>> f = Fraction(factorial(10000), factorial(20000)+1) >>> float(f) 0.0 >>> log10(f) Traceback (most recent call last): ... ValueError: math domain error Short of adding a log10() method to the Fraction class, there isn't a straight forward way to accommodate getting this to work. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 18:20:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jan 2021 23:20:31 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610320831.27.0.0607767456286.issue42867@roundup.psfhosted.org> 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. When the message box is dismissed and mainloop() is called, the root window is displayed apparently with focus but it is unresponsive to mouse click on the entry box, hence the entry box never gets focus and never gets keypresses. This is a bug somewhere between tk and Windows window manager and focus management. Adding after_idle delays the message box and entry creation until after the mainloop call, and clicking on the entry now works. In this case, the (unfocused) root window is *not* displayed. If the entry box is the proper default focused widget when the message box is dismissed, an even better fix, to me, is to bind the entry box and explicitly give it the focus. According to the tk docs, focus_set should work. But it does not on Windows (and I suspect that this is related to clicking not working). focus_force does work. Another solution is to add master.update() before createWidgets. Clicking on then works. Putting self.master.update() after the messagebox call does not work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 18:47:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 10 Jan 2021 23:47:32 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610322452.23.0.954489215514.issue42886@roundup.psfhosted.org> 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 wish we had kept the math module for C doubles (Python floats) only -- I fear that it has become a mash-up of such functions with random other things people may remember from their high school math classes such as factorial(). This is just asking for misunderstandings like this. :-( ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 18:51:43 2021 From: report at bugs.python.org (Camion) Date: Sun, 10 Jan 2021 23:51:43 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610322703.84.0.851430287132.issue42886@roundup.psfhosted.org> 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(10000)) 35659.45427452078 >>> math.log10(math.factorial(1000000)) 5565708.917186718 >>> math.log10(float(math.factorial(10000))) Traceback (most recent call last): File "", line 1, in math.log10(float(math.factorial(10000))) OverflowError: int too large to convert to float ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 18:58:50 2021 From: report at bugs.python.org (Camion) Date: Sun, 10 Jan 2021 23:58:50 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610323130.08.0.683485060684.issue42886@roundup.psfhosted.org> 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 heavy change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 19:00:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 11 Jan 2021 00:00:58 +0000 Subject: [issue42881] Should typing.get_type_hints change None annotations? In-Reply-To: <1610278192.15.0.512262305909.issue42881@roundup.psfhosted.org> Message-ID: <1610323258.81.0.169145353452.issue42881@roundup.psfhosted.org> 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 whenever we wrote None. I personally don't care because I never use get_type_hints() -- I don't use annotations at runtime (which may also be how this snuck into get_type_hints() in the first place -- some misguided idea that it should return a "type"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 19:28:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 11 Jan 2021 00:28:44 +0000 Subject: [issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order In-Reply-To: <1610227417.16.0.538971054996.issue42878@roundup.psfhosted.org> Message-ID: <1610324924.75.0.598065076573.issue42878@roundup.psfhosted.org> Guido van Rossum added the comment: Cheryl, do you have time to review this? ---------- nosy: +cheryl.sabella, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 19:50:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 11 Jan 2021 00:50:46 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610326246.51.0.288196865288.issue42886@roundup.psfhosted.org> 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 result, so floats will enter the picture at some point. Unlike Fractions which don't have size limits, floats are range limited, so some overflows and underflows will still happen regardless. > ... but this would be a heavy change. There's the rub. We could create a dunder method for every math function and require that every numeric type to support every dunder method. That's a somewhat major design change and it's far above my pay grade to say whether that would be worth it ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 21:32:56 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 11 Jan 2021 02:32:56 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610332376.99.0.483885182279.issue42886@roundup.psfhosted.org> 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 impossible to add a new module anymore: python-ideas can't maintain any focus, python-dev has become an eternal circular debating society, and "put it on pyPI first to see whether it's adopted" has become a go-to bait-&-switch scam (e.g., witness Grant Jenks's `sortedcontainers` module, which is absolutely first rate, and widely used, but "why add it to the core? it's already on pyPI" has shut down any suggestion to fold it in - although I don't know that Grant would _want_ to fold it in). OTOH, I don't agree `math` should be limited solely to floats. It would be, e.g., pointlessly annoying for things like `pow(x, 4)` or `atan(1)` to blow up just because an argument is an int instead of a float. I have no problem with limiting `math` functions to the simple scalar types that also work in C libm calls (where ints aren't a problem because the compiler inserts coercions to double). As a slight extension then, I have no problem either with log(1 << 1000000) working, because Python doesn't have C's distinctions between integer sizes. So, overall, "floats or ints, but generally just the functions C's defines". Which is pretty much how `math` started. But I don't see a realistic way to get there from here. Even though I'm retired now, I don't _want_ to spend 16 hours arguing every day for months - that's a major percentage of my remaining expected life ;-) For other approaches, people doing serious work already solve it the obvious way. For example, the spiffy arbitrary-precision `mpmath` binary float module supplies its own versions of libm functions, that work on the numeric types it defines. It's not a real problem in real life that they don't also work on Fraction or Decimal. In fact, I'm glad they don't! It would usually be "an error" in my code if I tried to pass a Decimal to an mpmath function, because I'm using mpmath to begin with precisely because I _intend_ to work specifically and only with mpmath's numeric types for the duration. So we can keep this report open forever waiting for a miracle, or yield to reality and close it as "sorry - won't fix" now ;-) ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 22:04:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 11 Jan 2021 03:04:28 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610334268.01.0.137623009301.issue42886@roundup.psfhosted.org> 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). This works well unless the ratio of x to y is outside the range supported by floats. What is desired is that for extreme values of x and y, that log10() will treat the fraction differently and compute log10(x) - log10(y) instead of log10(x / y). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 10 22:33:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 11 Jan 2021 03:33:35 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610336015.63.0.763238776883.issue42886@roundup.psfhosted.org> 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 somewhat problematic. I think people who work a lot with fractions and want to compute their logarithm just need to use the formula that the OP gave. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 01:19:12 2021 From: report at bugs.python.org (Ziqiao Kong) Date: Mon, 11 Jan 2021 06:19:12 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610345952.23.0.237413960568.issue42880@roundup.psfhosted.org> Ziqiao Kong added the comment: Seems that we are getting the same libffi.dylib. kabeor at 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: /usr/lib/libffi.dylib (compatibility version 1.0.0, current version 27.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 01:24:26 2021 From: report at bugs.python.org (Ziqiao Kong) Date: Mon, 11 Jan 2021 06:24:26 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610346266.68.0.194946542496.issue42880@roundup.psfhosted.org> Ziqiao Kong added the comment: BTW, uname for the M1 MBP. ``` kabeor at 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 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 02:38:04 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 11 Jan 2021 07:38:04 +0000 Subject: [issue42887] Multiple assignments of attribute "__sizeof__" will cause a segfault Message-ID: <1610350684.08.0.491719857036.issue42887@roundup.psfhosted.org> 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 parser when dealing build-in attribute assignment. program 1: ========================= mystr = "hello123" for x in range(1000000): mystr = mystr.__sizeof__() print(mystr) ========================= 56 28 28 ....... 28 28 Output: work well as expected. program 2: ========================== mystr = "hello123" for x in range(1000000): mystr = mystr.__sizeof__ print(mystr) ========================== ...... Segmentation fault (core dumped) Expected output: no segfault. ---------- components: Interpreter Core messages: 384797 nosy: xxm priority: normal severity: normal status: open title: Multiple assignments of attribute "__sizeof__" will cause a segfault type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 02:40:22 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 11 Jan 2021 07:40:22 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= Message-ID: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> 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? =================================== import socket from threading import Thread class thread(Thread): def run(self): for res in socket.getaddrinfo('www.google.com',8080): sock = socket.socket() sock.connect(res[4]) for i in range(2000): thread().start() ==================================== Error message: --------------------------------------------------------------- ........ Exception in thread Thread-1346: Traceback (most recent call last): File "/usr/local/python310/lib/python3.10/threading.py", line 960, in _bootstrap_inner File "/usr/local/python310/lib/python3.10/threading.py", line 960, in _bootstrap_inner Exception in thread Thread-1172: Traceback (most recent call last): ....... Exception in thread Thread-1509: Exception in thread Thread-1510: libgcc_s.so.1 must be installed for pthread_cancel to work Exception in thread Thread-1511: Traceback (most recent call last): Aborted (core dumped) --------------------------------------------------------------- ---------- components: Interpreter Core messages: 384798 nosy: xxm priority: normal severity: normal status: open title: Not installed ?libgcc_s.so.1? causes parser crash. type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 02:45:39 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 11 Jan 2021 07:45:39 +0000 Subject: [issue42889] Incorrect behavior of Python parser after ast node of test program being modified Message-ID: <1610351139.91.0.540037450972.issue42889@roundup.psfhosted.org> 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)" can be compiled without error message. And more surprisingly, the execution result of "print(1)" is 2 ! ! ==================================== import ast class RewriteName(ast.NodeTransformer): def visit_Name(self, node): if node.id != "print": node.id = str(node.lineno) return node code = "a = 2;print(a)" myast = ast.parse(code) transformer = RewriteName() newast = transformer.visit(myast) # print(ast.dump(newast)) print("new code:","------------") print(ast.unparse(newast)) print("------------") c = compile(newast,'','exec') exec(c) ================================= output result: new code: ------------ 1 = 2 print(1) ------------ 2 Expected result: (1). Syntax error during compilation. "1" should not be the correct identifier of program, even if it's forcely transformed to string. (2). The output of execution should be "1" , since the parameter of "print()" in the new code is string "1". This incorrect behaviors exists on all version of Python(from Python2 to Python 3). ---------- components: Interpreter Core messages: 384799 nosy: xxm priority: normal severity: normal status: open title: Incorrect behavior of Python parser after ast node of test program being modified type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 02:56:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 07:56:52 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1610351812.79.0.146706321153.issue42888@roundup.psfhosted.org> Christian Heimes added the comment: What's your platform and distribution? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 03:06:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 08:06:17 +0000 Subject: [issue42887] Multiple assignments of attribute "__sizeof__" will cause a segfault In-Reply-To: <1610350684.08.0.491719857036.issue42887@roundup.psfhosted.org> Message-ID: <1610352377.47.0.0254149781332.issue42887@roundup.psfhosted.org> Christian Heimes added the comment: I can reproduce the issue. The stack trace is several hundred thousand (!) levels deep. #0 _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #1 _Py_XDECREF (op=) at ./Include/object.h:514 #2 meth_dealloc (m=0x7fffe6070470) at Objects/methodobject.c:170 #3 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #4 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #5 _Py_XDECREF (op=) at ./Include/object.h:514 #6 meth_dealloc (m=0x7fffe60704d0) at Objects/methodobject.c:170 #7 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #8 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #9 _Py_XDECREF (op=) at ./Include/object.h:514 #10 meth_dealloc (m=0x7fffe6070530) at Objects/methodobject.c:170 #11 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #12 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #13 _Py_XDECREF (op=) at ./Include/object.h:514 #14 meth_dealloc (m=0x7fffe6070590) at Objects/methodobject.c:170 #15 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #16 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #17 _Py_XDECREF (op=) at ./Include/object.h:514 #18 meth_dealloc (m=0x7fffe60705f0) at Objects/methodobject.c:170 #19 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #20 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #21 _Py_XDECREF (op=) at ./Include/object.h:514 #22 meth_dealloc (m=0x7fffe6070650) at Objects/methodobject.c:170 ... #509737 _Py_XDECREF (op=) at ./Include/object.h:514 #509738 meth_dealloc (m=0x7fffe54ca6b0) at Objects/methodobject.c:170 #509739 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #509740 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #509741 _Py_XDECREF (op=) at ./Include/object.h:514 #509742 meth_dealloc (m=0x7fffe54ca710) at Objects/methodobject.c:170 #509743 0x0000000000466a99 in _Py_Dealloc (op=) at Objects/object.c:2209 #509744 0x00000000005da2fa in _Py_DECREF (op=, lineno=514, filename=0x6570af "./Include/object.h") at ./Include/object.h:448 #509745 _Py_XDECREF (op=) at ./Include/object.h:514 #509746 meth_dealloc (m=0x7fffe54ca770) at Objects/methodobject.c:170 ... ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 03:17:41 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 11 Jan 2021 08:17:41 +0000 Subject: [issue42887] Multiple assignments of attribute "__sizeof__" will cause a segfault In-Reply-To: <1610350684.08.0.491719857036.issue42887@roundup.psfhosted.org> Message-ID: <1610353061.04.0.92453154016.issue42887@roundup.psfhosted.org> Ronald Oussoren added the comment: This is a recursion problem, "mystr" will be equivalent to 'hello123'.__sizeof__.__sizeof__. ...(100K repetition)... .__sizeof__. The dealloc of "mystr" will cause recursive calls to tp_dealloc along the entire chain and that can exhaust the C stack. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 03:22:38 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 11 Jan 2021 08:22:38 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610353358.18.0.522151834007.issue42886@roundup.psfhosted.org> Mark Dickinson added the comment: @Camion: Can you say more about your use-case? One thing that's on my would-be-nice-to-do-one-day list is 'e', 'f' and 'g'-style decimal formatting for Fraction objects. Without that, it's often hard to get a quick sense of the magnitude of a Fraction without conversion to float. Would that formatting capability help at all with your use-case, or are you doing something entirely different? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 04:01:14 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 11 Jan 2021 09:01:14 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1610355674.93.0.580283185413.issue42888@roundup.psfhosted.org> Xinmeng Xia added the comment: >>python310 -V Python 3.10.0a2 >>uname -v #73~16.04.1-Ubuntu SMP Fri Sep 13 09:56:18 UTC 2019 Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 04:27:24 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 11 Jan 2021 09:27:24 +0000 Subject: [issue42885] Regex performance problem with ^ aka AT_BEGINNING In-Reply-To: <1610315901.41.0.467379667553.issue42885@roundup.psfhosted.org> Message-ID: <1610357244.89.0.141507859611.issue42885@roundup.psfhosted.org> Steven D'Aprano added the comment: I'm getting similar results in Python 3.9. [steve ~]$ python3.9 -m timeit -s "a = 'A'*10000" -s "import re" "re.search('^x', a)" 5000 loops, best of 5: 67.3 usec per loop [steve ~]$ python3.9 -m timeit -s "a = 'A'*100000" -s "import re" "re.search('^x', a)" 500 loops, best of 5: 639 usec per loop [steve ~]$ python3.9 -m timeit -s "a = 'A'*1000000" -s "import re" "re.search('^x', a)" 50 loops, best of 5: 6.27 msec per loop [steve ~]$ python3.9 -m timeit -s "a = 'A'*10000000" -s "import re" "re.search('^x', a)" 5 loops, best of 5: 62.8 msec per loop [steve ~]$ python3.9 -m timeit -s "a = 'A'*100000000" -s "import re" "re.search('^x', a)" 1 loop, best of 5: 654 msec per loop It looks like the time is roughly linear in the length of the string. I get the same result as far back as Python 2.7 (I haven't tried older versions). [steve ~]$ python2.7 -m timeit -s "a = 'A'*10000" -s "import re" "re.search('^x', a)" 10000 loops, best of 3: 75.7 usec per loop [steve ~]$ python2.7 -m timeit -s "a = 'A'*10000000" -s "import re" "re.search('^x', a)" 10 loops, best of 3: 73.4 msec per loop I would have expected essentially constant time, as in re.match: [steve ~]$ python3.9 -m timeit -s "a = 'A'*10000" -s "import re" "re.match('x', a)" 500000 loops, best of 5: 560 nsec per loop [steve ~]$ python3.9 -m timeit -s "a = 'A'*100000000" -s "import re" "re.match('x', a)" 500000 loops, best of 5: 561 nsec per loop ---------- nosy: +steven.daprano versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 04:49:08 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 11 Jan 2021 09:49:08 +0000 Subject: [issue42886] math.log and math.log10 domain error on very large Fractions In-Reply-To: <1610318683.55.0.0487505722004.issue42886@roundup.psfhosted.org> Message-ID: <1610358548.24.0.488067132841.issue42886@roundup.psfhosted.org> Steven D'Aprano added the comment: Guido wrote: > it would require the math.log function to recognize rationals I don't think it would. You don't need a type-check, you just need to check for a pair of numerator and denominator attributes. So we could do something like this, except in C: try: return log(float(x)) except DomainError: try: a = x.numerator b = x.denominator except AttributeError: pass else: return log(a) - log(b) raise ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 05:26:19 2021 From: report at bugs.python.org (Wlodek) Date: Mon, 11 Jan 2021 10:26:19 +0000 Subject: [issue42890] bug float to int Message-ID: <1610360779.86.0.614039765509.issue42890@roundup.psfhosted.org> New submission from Wlodek : Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f=0.1234/100 >>> f2= f*10**8 >>> i2= int(f2) >>> print("float=%f, float_2=%f, int(float_2)=%d" % (f, f2, int(f2))) float=0.001234, float_2=123400.000000, int(float_2)=123399 ---------- components: Library (Lib) messages: 384807 nosy: wlodek priority: normal severity: normal status: open title: bug float to int versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 05:27:51 2021 From: report at bugs.python.org (John McCabe) Date: Mon, 11 Jan 2021 10:27:51 +0000 Subject: [issue42867] Entry Widget not editable on Windows 10, but is on Linux Ubuntu 16.04 In-Reply-To: <1610109973.36.0.703695549775.issue42867@roundup.psfhosted.org> Message-ID: <1610360871.89.0.627559861462.issue42867@roundup.psfhosted.org> John McCabe added the comment: Thank you for that information and analysis Terry. As you can see, at the end of the addNew() function in the original example, I'd added: --- if initialLeft is not None: rightBox.insert(tk.END, initialLeft) self.leftRightEntries.append((leftBox, rightBox)) leftBox.focus_set() --- and, as you've noticed, that makes no difference on Windows. I hadn't tried focus_force(), but will try to bear that in mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:09:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 12:09:08 +0000 Subject: [issue42890] bug float to int In-Reply-To: <1610360779.86.0.614039765509.issue42890@roundup.psfhosted.org> Message-ID: <1610366948.99.0.0206249609484.issue42890@roundup.psfhosted.org> Christian Heimes added the comment: Rounding errors are to be expected. Python uses IEEE-754 double precision floats. See https://docs.python.org/3/tutorial/floatingpoint.html ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:12:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 12:12:28 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1610367148.68.0.735615430441.issue42888@roundup.psfhosted.org> Christian Heimes added the comment: Please provide more information. What Linux distribution and distro version are you using? How did you install Python? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:17:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 12:17:54 +0000 Subject: [issue42874] running configure on Solaris 10 gives grep "illegal option" errors In-Reply-To: <1610194453.5.0.66216438534.issue42874@roundup.psfhosted.org> Message-ID: <1610367474.48.0.878920371573.issue42874@roundup.psfhosted.org> Christian Heimes added the comment: Paul, please take a look. You added the code in commit 62972d9d73e. ---------- nosy: +christian.heimes, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:22:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:22:36 +0000 Subject: [issue42327] Add PyModule_Add() In-Reply-To: <1605126914.46.0.774673816158.issue42327@roundup.psfhosted.org> Message-ID: <1610367756.87.0.271316513336.issue42327@roundup.psfhosted.org> STINNER Victor added the comment: Note for myself: I added PyModule_AddObjectRef() to https://github.com/pythoncapi/pythoncapi_compat If it's renamed, pythoncapi_compat must also be updated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:50:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:50:19 +0000 Subject: [issue41771] bdist_wininst doesn't execute postinstall script In-Reply-To: <1599884205.28.0.064503063783.issue41771@roundup.psfhosted.org> Message-ID: <1610369419.98.0.871412996115.issue41771@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:50:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:50:49 +0000 Subject: [issue809846] bdist_wininst doesn't clean up read-only files in build dir Message-ID: <1610369449.59.0.16243775609.issue809846@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:50:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:50:37 +0000 Subject: [issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows In-Reply-To: <1295450896.02.0.86964827296.issue10945@psf.upfronthosting.co.za> Message-ID: <1610369437.7.0.521739410307.issue10945@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:50:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:50:57 +0000 Subject: [issue13123] bdist_wininst uninstaller does not remove pycache directories In-Reply-To: <1318000960.21.0.140069466315.issue13123@psf.upfronthosting.co.za> Message-ID: <1610369457.75.0.451938890868.issue13123@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:05 +0000 Subject: [issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express In-Reply-To: <1300472926.52.0.331223446631.issue11598@psf.upfronthosting.co.za> Message-ID: <1610369465.56.0.334972449754.issue11598@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:21 +0000 Subject: [issue13276] bdist_wininst-created installer does not run the postinstallation script when uninstalling In-Reply-To: <1319729455.78.0.312367178712.issue13276@psf.upfronthosting.co.za> Message-ID: <1610369481.38.0.178812101563.issue13276@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:13 +0000 Subject: [issue7833] bdist_wininst installers fail to load extensions built with Issue4120 patch In-Reply-To: <1265062373.01.0.461114831555.issue7833@psf.upfronthosting.co.za> Message-ID: <1610369473.08.0.780341241128.issue7833@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:28 +0000 Subject: [issue9456] Apparent memory leak in PC/bdist_wininst/install.c In-Reply-To: <1280781943.93.0.297912103498.issue9456@psf.upfronthosting.co.za> Message-ID: <1610369488.63.0.877681009008.issue9456@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:35 +0000 Subject: [issue26554] PC\bdist_wininst\install.c: Missing call to fclose() In-Reply-To: <1457949701.38.0.834751371072.issue26554@psf.upfronthosting.co.za> Message-ID: <1610369495.2.0.999445945173.issue26554@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:41 +0000 Subject: [issue8171] bdist_wininst builds wrongly for --plat-name=win-amd64 In-Reply-To: <1268913911.34.0.452575740724.issue8171@psf.upfronthosting.co.za> Message-ID: <1610369501.8.0.548960711825.issue8171@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:47 +0000 Subject: [issue4480] bdist_msi and bdist_wininst are missing an uninstaller icon In-Reply-To: <1228122344.22.0.401809698411.issue4480@psf.upfronthosting.co.za> Message-ID: <1610369507.32.0.7488547965.issue4480@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:51:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:51:55 +0000 Subject: [issue13038] bdist_wininst installers should warn if target dir is read-only In-Reply-To: <1316816072.59.0.865990615621.issue13038@psf.upfronthosting.co.za> Message-ID: <1610369515.29.0.837454059445.issue13038@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:03 +0000 Subject: [issue4878] post installer script's message is not shown to user with bdist_wininst In-Reply-To: <1231407894.66.0.157123159421.issue4878@psf.upfronthosting.co.za> Message-ID: <1610369523.0.0.691910802994.issue4878@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:11 +0000 Subject: [issue4636] bdist_wininst installer with install script raises exception In-Reply-To: <1229030167.98.0.0716327891895.issue4636@psf.upfronthosting.co.za> Message-ID: <1610369531.56.0.558561176395.issue4636@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:17 +0000 Subject: [issue17419] bdist_wininst installer should allow install in user directory In-Reply-To: <1363280284.95.0.229024940465.issue17419@psf.upfronthosting.co.za> Message-ID: <1610369537.77.0.639369642997.issue17419@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:38 +0000 Subject: [issue12200] bdist_wininst install_script not run on uninstall In-Reply-To: <1306548527.55.0.138367912737.issue12200@psf.upfronthosting.co.za> Message-ID: <1610369558.64.0.948204079477.issue12200@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:43 +0000 Subject: [issue1109963] bdist_wininst ignores build_lib from build command Message-ID: <1610369563.82.0.394655782461.issue1109963@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:25 +0000 Subject: [issue15321] bdist_wininst installers may terminate with "close failed in file object destructor:\nsys.excepthook is missing\nlost sys.stderr" In-Reply-To: <1341965309.27.0.878027505194.issue15321@psf.upfronthosting.co.za> Message-ID: <1610369545.74.0.592366882903.issue15321@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:52:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:52:32 +0000 Subject: [issue14877] No option to run bdist_wininst against newer msvc versions on non-windows systems In-Reply-To: <1337650583.73.0.740719723595.issue14877@psf.upfronthosting.co.za> Message-ID: <1610369552.07.0.0388692905965.issue14877@roundup.psfhosted.org> STINNER Victor added the comment: The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 07:53:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 12:53:38 +0000 Subject: [issue42802] distutils: Remove bdist_wininst command In-Reply-To: <1609511307.58.0.913169413627.issue42802@roundup.psfhosted.org> Message-ID: <1610369618.87.0.207974033686.issue42802@roundup.psfhosted.org> STINNER Victor added the comment: I closed the 19 open issues which contained "wininst" in their title as "wont fix" with the message: "The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802." You can simply search for closed issue which contains "wininst" in their title if you want to list them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 08:22:48 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 11 Jan 2021 13:22:48 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1610371368.77.0.285488949212.issue42888@roundup.psfhosted.org> Xinmeng Xia added the comment: >>uname -a Linux xxm-System-Product-Name 4.15.0-64-generic #73~16.04.1-Ubuntu SMP Fri Sep 13 09:56:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux >>uname -r 4.15.0-64-generic >>lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial I download Python from https://www.python.org/downloads/. Then I extract it,run install command ./configure,make,sudo make install. I also try the versions of Python 3.5-3.10 and even cPython on GitHub. The results are the same. But when I try this program on Python 2, the program will not cause core dump. I think Python 2 is initially installed with the system, not by me. So I guess no link is referred to libgcc_s.so.1 when I install new version of Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 08:47:35 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 11 Jan 2021 13:47:35 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_parser_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1610372855.95.0.431764617363.issue42888@roundup.psfhosted.org> Christian Heimes added the comment: It might be a packaging or documentation issue. I'm assiging the ticket to Matthias. He is the Debian and Ubuntu package maintainer. ---------- assignee: -> doko nosy: +doko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:02:38 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 11 Jan 2021 14:02:38 +0000 Subject: [issue7833] bdist_wininst installers fail to load extensions built with Issue4120 patch In-Reply-To: <1265062373.01.0.461114831555.issue7833@psf.upfronthosting.co.za> Message-ID: <1610373758.46.0.000213687844675.issue7833@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:32:03 2021 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBIcm7EjWlhcg==?=) Date: Mon, 11 Jan 2021 14:32:03 +0000 Subject: [issue42870] Document changed argparse output wrt optional arguments in What's new in Python 3.10 In-Reply-To: <1610149853.78.0.949568295376.issue42870@roundup.psfhosted.org> Message-ID: <1610375523.2.0.0997976061457.issue42870@roundup.psfhosted.org> Change by Tom?? Hrn?iar : ---------- keywords: +patch nosy: +hrnciar nosy_count: 5.0 -> 6.0 pull_requests: +23017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:46:31 2021 From: report at bugs.python.org (Xavier Hausherr) Date: Mon, 11 Jan 2021 14:46:31 +0000 Subject: [issue33972] AttributeError in email.message.iter_attachments() In-Reply-To: <1530024211.47.0.56676864532.issue33972@psf.upfronthosting.co.za> Message-ID: <1610376391.78.0.866813583746.issue33972@roundup.psfhosted.org> Xavier Hausherr added the comment: The problem still occurs with the _find_body method. The "part.is_attachment()" method can trigger an AttributeError too "AttributeError: 'str' object has no attribute 'is_attachment'" https://github.com/python/cpython/blob/3.9/Lib/email/message.py#L978 ---------- nosy: +xavier2 versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:48:27 2021 From: report at bugs.python.org (Amirouche Boubekki) Date: Mon, 11 Jan 2021 14:48:27 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings Message-ID: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> New submission from Amirouche Boubekki : Here is a simple way to reproduce: from lsm import LSM db = LSM('db.sqlite') def app(environ, start_response): """Simplest possible application object""" for (index, (key, value)) in enumerate(db[b'\x00':b'\xFF']): pass start_response(b'200', {}) return b'' db.close() In my real program, if I add 'global db' in the function `app`, it does not segfault. program: https://git.sr.ht/~amirouche/segfault trace: https://wyz.fr/0I-MO ---------- messages: 384836 nosy: amirouche priority: normal severity: normal status: open title: segfault with gunicorn and a library made with cython bindings type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:51:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 11 Jan 2021 14:51:45 +0000 Subject: [issue33972] AttributeError in email.message.iter_attachments() In-Reply-To: <1530024211.47.0.56676864532.issue33972@psf.upfronthosting.co.za> Message-ID: <1610376705.86.0.658409340622.issue33972@roundup.psfhosted.org> Irit Katriel added the comment: Xavier, I think it would be best if you could open a new issue for that, and also include code to reproduce the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 09:55:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 14:55:47 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings In-Reply-To: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> Message-ID: <1610376947.12.0.438032511008.issue42891@roundup.psfhosted.org> STINNER Victor added the comment: I put the code in a "bla.p" script and I ran it with Python 3.8 on Fedora 33: python3.8 -m venv env env/bin/python -m pip install lsm-db env/bin/python bla.py It doesn't crash. Please provide a script reproducing the issue. Note: lsm-db cannot be installed in Python 3.9 (errors about the removed PyTypeObject.tp_print member in C). ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 10:01:04 2021 From: report at bugs.python.org (Amirouche Boubekki) Date: Mon, 11 Jan 2021 15:01:04 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings In-Reply-To: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> Message-ID: <1610377264.56.0.730653513784.issue42891@roundup.psfhosted.org> Amirouche Boubekki added the comment: You need to run the program with the following: python -X dev -c "from gunicorn.app.wsgiapp import run; run()" --workers=1 foobar:app where foobar.py is the code from the previous message. The crash happen when, the function `app` is executed, hence you need to call in another console: curl http://localhost:8000 note: lsm package can be installed with pip install lsm-db note2: lsm db can not be installed with py3.9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 10:16:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 15:16:34 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings In-Reply-To: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> Message-ID: <1610378194.73.0.745880963671.issue42891@roundup.psfhosted.org> STINNER Victor added the comment: I get a crash without any code, just by running gunicorn. It looks like a bug in gunicorn. --- $ python3.8 -m venv env $ env/bin/python -m pip install gunicorn (..) Successfully installed gunicorn-20.0.4 $ ./env/bin/python -X dev -c 'from gunicorn.app.wsgiapp import run; run()' foobar:app ...) [2021-01-11 16:14:11 +0100] [32107] [ERROR] Exception in worker process Traceback (most recent call last): (...) File "/home/vstinner/z/env/lib64/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp return util.import_app(self.app_uri) File "/home/vstinner/z/env/lib64/python3.8/site-packages/gunicorn/util.py", line 358, in import_app mod = importlib.import_module(module) (...) ModuleNotFoundError: No module named 'foobar' [2021-01-11 16:14:11 +0100] [32107] [INFO] Worker exiting (pid: 32107) sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback Debug memory block at address p=0x55cfa92154a0: API '1' 3271705103877500672 bytes originally requested The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfd): at p-7: 0x00 *** OUCH at p-6: 0x00 *** OUCH at p-5: 0x00 *** OUCH at p-4: 0x00 *** OUCH at p-3: 0x00 *** OUCH at p-2: 0x00 *** OUCH at p-1: 0x00 *** OUCH Because memory is corrupted at the start, the count of bytes requested may be bogus, and checking the trailing pad bytes may segfault. The 8 pad bytes at tail=0x2d67c444d794c3a0 are [2021-01-11 16:14:11 +0100] [32113] [INFO] Booting worker with pid: 32113 (...) --- You should report the issue to gunicorn: https://github.com/benoitc/gunicorn/issues ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 10:18:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 11 Jan 2021 15:18:15 +0000 Subject: [issue42848] asyncio produces an unexpected traceback with recursive __getattribute__ In-Reply-To: <1609985412.09.0.749639106788.issue42848@roundup.psfhosted.org> Message-ID: <1610378295.55.0.974210860901.issue42848@roundup.psfhosted.org> Irit Katriel added the comment: I've simplified the format() code in the PR, based on the observation that only one chained exception is ever emitted. I think it's reasonably simple now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 10:24:15 2021 From: report at bugs.python.org (Peixing Xin) Date: Mon, 11 Jan 2021 15:24:15 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1610378655.0.0.146369812153.issue31904@roundup.psfhosted.org> Change by Peixing Xin : ---------- pull_requests: +23018 pull_request: https://github.com/python/cpython/pull/24191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 10:39:41 2021 From: report at bugs.python.org (Amirouche Boubekki) Date: Mon, 11 Jan 2021 15:39:41 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings In-Reply-To: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> Message-ID: <1610379581.75.0.85530213621.issue42891@roundup.psfhosted.org> Amirouche Boubekki added the comment: > ModuleNotFoundError: No module named 'foobar' That is not a segfault. The problem I am reporting is a segfault. It can be reproduced with uvicorn as follow: from lsm import LSM db = LSM('db.sqlite') async def app(scope, receive, send): assert scope['type'] == 'http' global db for (index, (key, value)) in enumerate(db[b'\x00':b'\xFF']): pass await send({ 'type': 'http.response.start', 'status': 200, 'headers': [ [b'content-type', b'text/plain'], ], }) await send({ 'type': 'http.response.body', 'body': b'Hello, world!', }) db.close() Run the above program with: python -X dev -m uvicorn bobo:app Then in another console: curl http://localhost:8000/ Here is the output: $ python -X dev -m uvicorn bobo:app INFO: Started server process [3580316] INFO: Waiting for application startup. INFO: ASGI 'lifespan' protocol appears unsupported. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) Fatal Python error: Segmentation fault Current thread 0x00007fbb6e49b740 (most recent call first): File "./bobo.py", line 10 in app File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45 in __call__ File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 394 in run_asgi File "/usr/lib/python3.8/asyncio/events.py", line 81 in _run File "/usr/lib/python3.8/asyncio/base_events.py", line 1851 in _run_once File "/usr/lib/python3.8/asyncio/base_events.py", line 570 in run_forever File "/usr/lib/python3.8/asyncio/base_events.py", line 603 in run_until_complete File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/server.py", line 48 in run File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/main.py", line 386 in run File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/main.py", line 362 in main File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/click/core.py", line 610 in invoke File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/click/core.py", line 1066 in invoke File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/click/core.py", line 782 in main File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/click/core.py", line 829 in __call__ File "/home/amirouche/.cache/pypoetry/virtualenvs/lsmdb-cTe2806J-py3.8/lib/python3.8/site-packages/uvicorn/__main__.py", line 4 in File "/usr/lib/python3.8/runpy.py", line 87 in _run_code File "/usr/lib/python3.8/runpy.py", line 194 in _run_module_as_main Segmentation fault (core dumped) ---------- resolution: third party -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:10:47 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 11 Jan 2021 16:10:47 +0000 Subject: [issue42880] ctypes: variadic function call still doesn't work on Apple Silicon In-Reply-To: <1610264518.97.0.0227668442163.issue42880@roundup.psfhosted.org> Message-ID: <1610381447.62.0.178180174006.issue42880@roundup.psfhosted.org> Ned Deily added the comment: > Seems that we are getting the same libffi.dylib. I suppose it is still possible that another libffi is being found first. To be absolutely sure, you could ask dyld to print the loaded libraries: $ DYLD_PRINT_LIBRARIES=1 python3.9 test_main.py [...] dyld: loaded: <003A027D-9CE3-3794-A319-88495844662D> /usr/lib/system/libxpc.dylib dyld: loaded: <7FBC5290-B2B3-3312-B69A-77378C539520> /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so dyld: loaded: <943473A5-A82B-3E21-8EB3-0BBDF5E605AA> /usr/lib/libffi.dylib dyld: loaded: <58910956-4F2F-363A-80E5-D5E1C71DD83E> /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_struct.cpython-39-darwin.so dyld: loaded: <3444F392-DB43-3AEF-8596-2BFFBBD8EC0C> ./main.dylib 34 But, more importantly, the uname -a output for my M1 is: Darwin ankl.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 x86_64 Perhaps you have not updated to macOS 11.1 yet? By the way, in your original message's last example, is the output really "3"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:22:17 2021 From: report at bugs.python.org (Amirouche Boubekki) Date: Mon, 11 Jan 2021 16:22:17 +0000 Subject: [issue42891] segfault with gunicorn and a library made with cython bindings In-Reply-To: <1610376507.28.0.240401298439.issue42891@roundup.psfhosted.org> Message-ID: <1610382137.19.0.868080809927.issue42891@roundup.psfhosted.org> Amirouche Boubekki added the comment: I tried to reduce the program by replacing gunicorn / uvicorn dependency with threading.Thread and multiprocess.Pool without success. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:37:33 2021 From: report at bugs.python.org (seb) Date: Mon, 11 Jan 2021 16:37:33 +0000 Subject: [issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries In-Reply-To: <1593100264.48.0.613850075185.issue41116@roundup.psfhosted.org> Message-ID: <1610383053.89.0.838780897146.issue41116@roundup.psfhosted.org> seb added the comment: Thanks for the help! I tried the instructions, without success. I installed xz through homebrew (which needs to be installed on Silicon under /opt/homebrew). I can confirm the existance of: /opt/homebrew/Cellar/xz/5.2.5/include/lzma.h I used CPPFLAGS and also modified the system_include_dirs variable in the setup.py file, in both cases lzma.h seems to be ignored. > system_include_dirs = ['opt/homebrew/include', '/opt/homebrew/Cellar/xz/5.2.5/include'] Am I missing something obvious here? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:45:57 2021 From: report at bugs.python.org (Xavier Hausherr) Date: Mon, 11 Jan 2021 16:45:57 +0000 Subject: [issue42892] AttributeError in email.message.get_body() Message-ID: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> New submission from Xavier Hausherr : Following this issue: https://bugs.python.org/issue33972 Same bug apply to email.message.get_body() with attached email example and the following code: from email.policy import default import email with open('email_bad_formatted.eml', 'rb') as fp: msg = email.message_from_binary_file(fp, policy=default) body = msg.get_body() > Result: E AttributeError: 'str' object has no attribute 'is_attachment' /usr/local/lib/python3.9/email/message.py:978: AttributeError ---------- components: email files: email_bad_formatted.eml messages: 384847 nosy: barry, iritkatriel, r.david.murray, xavier2 priority: normal severity: normal status: open title: AttributeError in email.message.get_body() versions: Python 3.9 Added file: https://bugs.python.org/file49734/email_bad_formatted.eml _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:49:48 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 11 Jan 2021 16:49:48 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1610383788.21.0.346268300468.issue42892@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +23019 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 11:52:14 2021 From: report at bugs.python.org (Xavier Hausherr) Date: Mon, 11 Jan 2021 16:52:14 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1610383934.5.0.313561807244.issue42892@roundup.psfhosted.org> Xavier Hausherr added the comment: Attached PR fix the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 12:00:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 11 Jan 2021 17:00:10 +0000 Subject: [issue41433] Logging libraries BufferingHandler flushed twice at shutdown In-Reply-To: <1596002244.65.0.208232248615.issue41433@roundup.psfhosted.org> Message-ID: <1610384410.23.0.915882975404.issue41433@roundup.psfhosted.org> Irit Katriel added the comment: I'm assuming the link solved your issue. If you are still having a problem please create a new issue, and include a code snippet to show what you are doing exactly. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 12:03:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 17:03:50 +0000 Subject: [issue42882] Restarting the interpreter causes UB on 3.10.0a4 In-Reply-To: <1610283618.64.0.475556781159.issue42882@roundup.psfhosted.org> Message-ID: <1610384630.58.0.382578410847.issue42882@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +23020 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 12:05:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 11 Jan 2021 17:05:18 +0000 Subject: [issue42882] Restarting the interpreter causes UB on 3.10.0a4 In-Reply-To: <1610283618.64.0.475556781159.issue42882@roundup.psfhosted.org> Message-ID: <1610384718.55.0.629763678103.issue42882@roundup.psfhosted.org> STINNER Victor added the comment: Oh. In _PyUnicode_FromId(), I made the assumption that _PyRuntime is left unchanged when Py_Initialize()Py_Finalize() is called multiple times. But I was wrong, it is always reset to zero. So I wrote PR 24193 to explicitly save/restore _PyRuntime.unicode_ids.next_index value. Using PR 24193, msg384761 example displays "Works" instead of failing with a Python fatal error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 11 12:12:45 2021 From: report at bugs.python.org (robpats) Date: Mon, 11 Jan 2021 17:12:45 +0000 Subject: [issue42893] Strange XPath search behavior of xml.etree.ElementTree.Element.find Message-ID: <1610385165.69.0.550442509332.issue42893@roundup.psfhosted.org> New submission from robpats : Python 3.6.8 / 3.7.9 / 3.8.7 >>> import xml.etree.ElementTree >>> e = xml.etree.ElementTree.fromstring('