[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-29 Thread Ananthakrishnan A S
Ananthakrishnan A S added the comment: I agree with Vedran Čačić.As the modules are not made for one person but it is for the ease of coding.There are so many functions which i don't use but used by other people.We are using functions to make coding easy and if lcm function is added many peop

[issue39482] Write 2to3 fixer for collections.abc imports

2020-01-29 Thread Miro Hrončok
Change by Miro Hrončok : -- nosy: +hroncok title: Write 2to3 fixer for MutableMapping -> Write 2to3 fixer for collections.abc imports ___ Python tracker ___ ___

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: > [dje@rawhide ~]$ python3 -c 'import os; os.utime("testfn", (4386268800, > 4386268800))' > [dje@rawhide ~]$ stat testfn > (...) > Modify: 2038-01-18 22:14:07.0 -0500 Oh. It means that os.utime() replaces mtime=4386268800 with a value close to INT_MA

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I'm now curious which syscalls are used by the glibc to implement utimensat() and stat(). On a ppc64le Fedora Rawhide running Linux kernel 5.4.8-200.fc31.ppc64le with glibc 2.30.9000, I get: $ sudo dnf install -y strace # if neeeded $ strace -o trace ./mtim

[issue39482] Write 2to3 fixer for collections.abc imports

2020-01-29 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +17624 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18245 ___ Python tracker ___

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: glibc commit adding support for utimensat_time64() syscall: https://sourceware.org/git/?p=glibc.git;a=commit;h=f5b6fd258b6dd520403a20024e58cb491aca4cbd See also: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign -- __

[issue25661] tokenize.untokenize does not maintain the order of tabbed indentations and leading spaces

2020-01-29 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: Python 2.7 is end-of-life, see e.g. https://www.python.org/doc/sunset-python-2/ so this is unlikely to be fixed. This behaviour continues on Python 3 it seems (I used 3.8.1), *however* on Python 3 this is not valid code as it mixes spaces and tabs, see e

[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I added https://python-security.readthedocs.io/vuln/unsafe-dll-load-windows-7.html to track fixes in all branches. -- ___ Python tracker __

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I failed to reproduce the issue on s390x Fedora Rawhide, Linux kernel 5.5.0-0.rc4.git2.1.fc32.s390x, glibc-2.30.9000-31.fc32.s390x. I tested filesystem nfs and tmpfs. test_add_file_after_2107() pass. [vstinner@devel10 ~]$ uname -r 5.5.0-0.rc4.git2.1.fc32.s3

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: > I failed to reproduce the issue on s390x Fedora Rawhide, Linux kernel > 5.5.0-0.rc4.git2.1.fc32.s390x, glibc-2.30.9000-31.fc32.s390x. I still cannot reproduce after a "dnf upgrade -y": * Linux 5.5.0-0.rc6.git3.1.fc32.s390x * glibc-2.30.9000-31.fc32.s390x

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: Summary: * test_zipfile.test_add_file_after_2107() fails on Fedora Rawhide 3.x * Bug seen on Python 3.8 and Python 3.9 * Bug seen on s390x and x86-64 architectures * It seems like the bug occurs in os.utime() with atime=mtime=4386268800 => stat returns mtime=

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: Next question: does the issue come from the glibc or the filesystem? Attached mtime.c should ease debug. If you reproduce the issue, please test different filesystem and report which filesystems you tested. To detect the filesystem used by a directory, I'm u

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I failed to reproduce the bug on 3 machines. My x86-64 Fedora VM: * Linux 5.5.0-0.rc6.git3.1.fc32.x86_64 * glibc-2.30.9000-31.fc32.x86_64 * gcc-10.0.1-0.5.fc32.x86_64 * utimensat() available * I tested ext4 (/home) and tmpfs (/tmp) ppc64le mock: * Linux 5.4

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread Florian Weimer
Florian Weimer added the comment: I believe you might be observing an XFS limitation in combination with a Linux VFS bug. On disk, XFS only supports 32-bit timestamps: typedef struct xfs_timestamp { __be32 t_sec; /* timestamp seconds */ __be32 t_nse

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2020-01-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17625 pull_request: https://github.com/python/cpython/pull/18246 ___ Python tracker ___ __

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset e1e80002e28e1055f399a20918c49d50d093709e by Joannah Nanjekye in branch 'master': bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220) https://github.com/python/cpython/commit/e1e80002e28e1055f399a20918c49d50d093709e -- ___

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2020-01-29 Thread miss-islington
miss-islington added the comment: New changeset 526523c19322169a7f7507d9da291053df979412 by Miss Islington (bot) in branch '3.8': bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220) https://github.com/python/cpython/commit/526523c19322169a7f7507d9da291053df979412 -- n

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I managed to reproduce the issue on Fedora 31 on a XFS filesystem: $ touch testfn $ strace -o trace python3 -c 'import os; os.utime("testfn", (4386268800, 4386268800))' $ grep ^utimensat trace utimensat(AT_FDCWD, "testfn", [{tv_sec=4386268800, tv_nsec=0} /*

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x

2020-01-29 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +17626 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18247 ___ Python tracker ___ _

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x: Linux VFS/XFS bug

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: The kernel bug is now tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1795576 I wrote PR 18247 to skip the test. I suggest to leave this issue is open until the kernel is fixed: until the test is no longer skipped. -- title: test_zipfile: te

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев
New submission from Андрей Казанцев : Sometimes need get loop from another place and run corutine in it. For example when use teleton lib. Example from this lib https://docs.telethon.dev/en/latest/basic/signing-in.html#id2 suggests using ```client.loop.run_until_complete``` but it's not handle

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев
Change by Андрей Казанцев : -- keywords: +patch pull_requests: +17627 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18248 ___ Python tracker ___ _

[issue39484] time_ns() and time() cannot be compared on windows

2020-01-29 Thread Vincent Michel
New submission from Vincent Michel : On windows, the timestamps produced by time.time() often end up being equal because of the 15 ms resolution: >>> time.time(), time.time() (1580301469.6875124, 1580301469.6875124) The problem I noticed is that a value produced by time_ns() might end

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: -1. I rather suggest updating telethon example in the following matter: async with main(): with TelegramClient('anon', api_id, api_hash) as client: await client.send_message('me', 'Hello, myself!') You PR brings more problems than fixes: the loop

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев
Андрей Казанцев added the comment: I create the client object in `bot` file. If I import it then it creates loop when will import and then when I run it I will get errors attaching to a different loop. Another way to use `import` statement in main. This is blocking code. What to choose?

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Carl Friedrich Bolz-Tereick
New submission from Carl Friedrich Bolz-Tereick : One of the new-in-3.8 tests for unittest.mock, test_spec_has_descriptor_returning_function, is failing on PyPy. This exposes a bug in unittest.mock. The bug is most noticeable on PyPy, where it can be triggered by simply writing a slightly wei

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: A client that creates a loop implicitly in the constructor is a weird design from my perspective. You are free to use it, sure -- but please let us keep the freedom to not support such corner cases by asyncio.run() Sorry, I don't know the telethon library g

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Carl Friedrich Bolz-Tereick
Change by Carl Friedrich Bolz-Tereick : -- keywords: +patch pull_requests: +17629 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18252 ___ Python tracker

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x: Linux VFS/XFS bug

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3cb49b62e61208efcefbc04414e769fc173f205d by Victor Stinner in branch 'master': bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247) https://github.com/python/cpython/commit/3cb49b62e61208efcefbc04414e769fc173f205d --

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x: Linux VFS/XFS bug

2020-01-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17630 pull_request: https://github.com/python/cpython/pull/18253 ___ Python tracker ___ __

[issue39460] test_zipfile: test_add_file_after_2107() sometimes fails on Fedora Rawhide 3.x: Linux VFS/XFS bug

2020-01-29 Thread miss-islington
miss-islington added the comment: New changeset 2b675f0c8fd96f61977f6dc636f44fbd5587b6b3 by Miss Islington (bot) in branch '3.8': bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247) https://github.com/python/cpython/commit/2b675f0c8fd96f61977f6dc636f44fbd5587b6b3 -- no

[issue39486] bug in %-formatting in Python, related to escaped %-characters

2020-01-29 Thread Carl Friedrich Bolz-Tereick
New submission from Carl Friedrich Bolz-Tereick : The following behaviour of %-formatting changed between Python3.6 and Python3.7, and is in my opinion a bug that was introduced. So far, it has been possible to add conversion flags to a conversion specifier in %-formatting, even if the conver

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
New submission from hai shi : As stinner said in issue19514 those _Py_IDENTIFIER should be merged: ./Modules/_ctypes/_ctypes.c:1054:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1132:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1494:_Py_IDENTIFIER(_type_); ./Modules/_c

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17631 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18254 ___ Python tracker ___

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue15600] expose the finder details used by the FileFinder path hook

2020-01-29 Thread Eric Snow
Eric Snow added the comment: I have many other things higher on my todo list. :) I'll re-open this issue if I get back to the project that motivated this (i.e. "source translation via import hooks for filename suffix"). -- resolution: -> out of date stage: patch review -> resolved

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Chris Withers
Change by Chris Withers : -- assignee: -> cjw296 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17632 pull_request: https://github.com/python/cpython/pull/18255 ___ Python tracker ___ __

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17633 pull_request: https://github.com/python/cpython/pull/18256 ___ Python tracker ___ __

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Chris Withers
Chris Withers added the comment: New changeset a327677905956ae0b239ff430a1346dfe265709e by Carl Friedrich Bolz-Tereick in branch 'master': bpo-39485: fix corner-case in method-detection of mock (GH-18252) https://github.com/python/cpython/commit/a327677905956ae0b239ff430a1346dfe265709e

[issue33339] Using default encoding with `subprocess.run()` is not obvious

2020-01-29 Thread Xavier Robin
Change by Xavier Robin : -- nosy: +Xavier Robin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Chris Withers
Chris Withers added the comment: New changeset cf0645a17acbc0c4dbbf82434e37637965748bbb by Miss Islington (bot) in branch '3.7': bpo-39485: fix corner-case in method-detection of mock (GH-18256) https://github.com/python/cpython/commit/cf0645a17acbc0c4dbbf82434e37637965748bbb -- __

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Chris Withers
Chris Withers added the comment: New changeset 696d2324cf2a54e20e8d6a6739fa97ba815a8be9 by Miss Islington (bot) in branch '3.8': bpo-39485: fix corner-case in method-detection of mock (GH-18255) https://github.com/python/cpython/commit/696d2324cf2a54e20e8d6a6739fa97ba815a8be9 -- __

[issue39485] Bug in mock running on PyPy3

2020-01-29 Thread Chris Withers
Chris Withers added the comment: Thank you very much for this, that was a really good catch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Eric Snow
Eric Snow added the comment: FTR: As Martin noted in #19514, there isn't any performance difference for statics, whether local or global. For static locals the compiler (at least on linux) generates symbols named as ".<#>" and they are treated as global. One key difference (again, at least

[issue37972] unittest.mock.call does not chain __getitem__ to another _Call object

2020-01-29 Thread Chris Withers
Chris Withers added the comment: New changeset db5e86adbce12350c26e7ffc2c6673369971a2dc by Chris Withers in branch 'master': Get mock coverage back to 100% (GH-18228) https://github.com/python/cpython/commit/db5e86adbce12350c26e7ffc2c6673369971a2dc -- __

[issue39486] bug in %-formatting in Python, related to escaped %-characters

2020-01-29 Thread SilentGhost
SilentGhost added the comment: This seemed to be a consequence of #29568. -- components: +Interpreter Core nosy: +SilentGhost type: -> behavior ___ Python tracker ___ ___

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

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: > FYI, I'm able to reproduce the hang by running "python -m test -F > test_asyncio -m test_close_kill_running". Working on the fix. Any update on this issue? It's still failing randomly on buildbots. Example: https://buildbot.python.org/all/#/builders/158/bui

[issue39488] test_largefile: TestSocketSendfile.test_it() uses too much disk space

2020-01-29 Thread STINNER Victor
New submission from STINNER Victor : TestSocketSendfile.test_it() failed with "OSError: [Errno 28] No space left on device" on PPC64LE Fedora 3.x buildbot. It also caused troubles on "AMD64 Fedora Rawhide Clang 3.x" worker. If I recall correctly, it writes like 8 GB of real data, not just emp

[issue39486] bug in %-formatting in Python, related to escaped %-characters

2020-01-29 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: Ok, that means it's intentional. I still think it's missing a documentation change and consistent error messages. -- ___ Python tracker ___

[issue39486] bug in %-formatting in Python, related to escaped %-characters

2020-01-29 Thread SilentGhost
Change by SilentGhost : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
New submission from STINNER Victor : Python has a COUNT_ALLOCS special build which adds sys.getcounts() function and shows statistics on Python types at exit if -X showalloccount command line option is used. I never ever used this feature and I don't know anyone using it. But "#ifdef COUNT_A

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-19527 which discussed COUNT_ALLOCS in 2013. COUNT_ALLOCS build is documented in Fedora "DebugPythonStacks" wiki page: https://fedoraproject.org/wiki/Features/DebugPythonStacks#Verify_COUNT_ALLOCS -- __

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +17634 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18259 ___ Python tracker ___ _

[issue39484] time_ns() and time() cannot be compared on windows

2020-01-29 Thread Vincent Michel
Vincent Michel added the comment: I thought about it a bit more and I realized there is no way to recover the time in hundreds of nanoseconds from the float produced by `time.time()` (since the windows time currently takes 54 bits and will take 55 bits in 2028). That means `time()` and `tim

[issue38628] Issue with ctypes in AIX

2020-01-29 Thread David Edelsohn
Change by David Edelsohn : -- nosy: +David.Edelsohn, Michael.Felt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I have never used this feature either. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-

[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев
Андрей Казанцев added the comment: How to make singleton class? I wrote this ``` import asyncio class Singleton: _CREATE_LOCK = asyncio.Lock() @classmethod async def create(cls): if not hasattr(cls, '_Singleton__instance'): async with cls._CREATE_LOCK:

[issue39490] Python Uninstaller fails to clean up the old path variables when uninstalling

2020-01-29 Thread CJ Long
New submission from CJ Long : I had Python 3.7 installed on my machine. However, I started having issues with it, so I uninstalled Python. However, when I reinstalled and attempted to run pip from Powershell, the old path was still in my variable, and therefore, could not run pip. Python stil

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: As far as I known, the Fedora package of Python is the most known user of COUNT_ALLOCS special build, and maybe the only user. The Fedora package of Python 2.7 builds two binaries: * python2.7: release mode, optimized * python2.7-debug: debug mode, not optim

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: Python 2.7.15 got a PYTHONSHOWALLOCCOUNT environment variable to dump statistics on types at exit, if Python is built with COUNT_ALLOCS macro defined. Example with Fedora python2.7-debug (package python2-debug-2.7.17-1.fc31.x86_64): $ PYTHONSHOWALLOCCOUNT=1

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: The COUNT_ALLOCS feature itself is quite old. It was added 27 years ago (in 1993): commit a9c3c22c33762699b362e7598268442fd2df9eb6 Author: Sjoerd Mullender Date: Mon Oct 11 12:54:31 1993 + * Extended X interface: pixmap objects, colormap objects v

[issue39489] Remove COUNT_ALLOCS special build

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: I looked for "Python COUNT_ALLOCS" on the Internet. This special build seems to be very badly documented on the Internet. Outside Python own documentation, I found almost zero reference to it. IMHO it's basically unused. (*) bpo-33058: Two years ago (2018),

[issue39491] Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions

2020-01-29 Thread Jakub Stasiak
Change by Jakub Stasiak : -- components: Library (Lib) nosy: jstasiak priority: normal severity: normal status: open title: Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions versions: Python 3.9 ___

[issue39491] Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions

2020-01-29 Thread Jakub Stasiak
Change by Jakub Stasiak : -- keywords: +patch pull_requests: +17636 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18260 ___ Python tracker ___ __

[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-29 Thread Tim Peters
Tim Peters added the comment: +0 from me. Another use is computing the Carmichael function for composite numbers (like an RSA encryption modulus, in which context the Carmichael function is routinely used). But only +0 instead of +1 because it's so easy to build from gcd(). I don't agree i

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: We can't make this change, as it means the statics get initialised before the Python interpreter has been initialised, and won't be reinitialised if the interpreter is destroyed and recreated. -- nosy: +ncoghlan resolution: -> rejected stage: patch re

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: My apologies, my comment above was based on an outdated understanding of how the identifier structs get initialised (it's the usage that initialises them, not the declaration). That means this is a useful refactoring to help identify blockers to full subinter

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: In the subinterpreter context: perhaps it would make sense to move *all* Py_IDENTIFIER declarations to file scope? That would make it much clearer which of our extension modules actually have hidden state for caching purposes. If we did that though, we'd also

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: > That means this is a useful refactoring to help identify blockers to full > subinterpreter support. I don't think that subinterpreter support should block this issue, since currently, _Py_IDENTIFIER() does *not* support subinterpreters. > In the subinterp

[issue39488] test_largefile: TestSocketSendfile.test_it() uses too much disk space

2020-01-29 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +17637 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18261 ___ Python tracker __

[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-29 Thread Jeremy Kloth
Jeremy Kloth added the comment: As noted on the PR landing page, this PR has caused failures of 2 buildbots: https://buildbot.python.org/all/#builders/81/builds/272 https://buildbot.python.org/all/#builders/150/builds/227 (both are Windows 7) -- nosy: +jkloth __

[issue38631] Replace Py_FatalError() with regular Python exceptions

2020-01-29 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17638 pull_request: https://github.com/python/cpython/pull/18258 ___ Python tracker ___ __

[issue39492] reference cycle affecting Pickler instances (Python3.8+)

2020-01-29 Thread Pierre Glaser
New submission from Pierre Glaser : The new Pickler reducer_override mechanism introduced in `Python3.8` generates a reference cycle: for optimization purposes, a the pickler.reducer_override bound method is referenced into the reducer_override attribute of the Pickler's struct. Thus, until a

[issue38631] Replace Py_FatalError() with regular Python exceptions

2020-01-29 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17639 pull_request: https://github.com/python/cpython/pull/18262 ___ Python tracker ___ __

[issue38631] Replace Py_FatalError() with regular Python exceptions

2020-01-29 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17640 pull_request: https://github.com/python/cpython/pull/18263 ___ Python tracker ___ __

[issue39493] typing.py has an incorrect definition of closed

2020-01-29 Thread Shantanu
New submission from Shantanu : Hello! typing.py has the following definition of `closed`: https://github.com/python/cpython/blob/master/Lib/typing.py#L1834 ``` @abstractmethod def closed(self) -> bool: pass ``` This is inconsistent with the behaviour at runtime: ``` In [17]: sy

[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-29 Thread Eryk Sun
Eryk Sun added the comment: > this PR has caused failures of 2 buildbots The master branch should no longer get built on Windows 7 machines. The initial build succeeds, but running "_freeze_importlib[_d].exe" fails with STATUS_DLL_NOT_FOUND (0xC135, i.e. -1073741515) since "api-ms-win-c

[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-29 Thread Steve Dower
Steve Dower added the comment: Both of those buildbots should be retired (or repurposed for versions of Python that still support Windows 7) :) -- ___ Python tracker ___

[issue39401] [CVE-2020-8315] Unsafe dll loading in getpathp.c on Win7

2020-01-29 Thread Steve Dower
Steve Dower added the comment: > I added > https://python-security.readthedocs.io/vuln/unsafe-dll-load-windows-7.html to > track fixes in all branches. Thanks, Victor! Python 2.7 and 3.5 are not vulnerable. The issue was added in 3.6 when I added support for installing Python into a long p

[issue39320] Handle unpacking of */** arguments and rvalues in the compiler

2020-01-29 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +17641 pull_request: https://github.com/python/cpython/pull/18264 ___ Python tracker ___ ___

[issue39493] typing.py has an incorrect definition of closed

2020-01-29 Thread Shantanu
Change by Shantanu : -- keywords: +patch pull_requests: +17642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18265 ___ Python tracker ___ ___

[issue39492] reference cycle affecting Pickler instances (Python3.8+)

2020-01-29 Thread Pierre Glaser
Change by Pierre Glaser : -- keywords: +patch pull_requests: +17643 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18266 ___ Python tracker ___ __

[issue33339] Using default encoding with `subprocess.run()` is not obvious

2020-01-29 Thread Eryk Sun
Eryk Sun added the comment: This issue was already addressed for 3.x in bpo-31756, which added the a `text` parameter and updated the documentation. As to 2.7, it was officially retired as of the first of this month. Anyway, I don't think there was a pressing need to clarify the documentatio

[issue39494] Extra null terminators in keyword arrays in sqlite module

2020-01-29 Thread Alex Henrie
New submission from Alex Henrie : Modules/_sqlite/cursor.c currently has the following variable declaration: static char *kwlist[] = {"size", NULL, NULL}; The second null terminator is unnecessary and detrimental in that it makes the code harder to read and understand. Modules/_sqlite/mo

[issue39494] Extra null terminators in keyword arrays in sqlite module

2020-01-29 Thread Alex Henrie
Change by Alex Henrie : -- keywords: +patch pull_requests: +17644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18267 ___ Python tracker ___

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-01-29 Thread Shantanu
New submission from Shantanu : The C accelerated version of `xml.etree.ElementTree.TreeBuilder.start` has a default value for `attrs`, whereas the pure Python version does not. ``` In [41]: sys.version

[issue38792] IDLE calltips may not properly close on KeyboardInterrupt

2020-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I verified problem for KeyboardInterrupt and RestartShell but not for a newline that actually runs the statement. In my experiments, if a newline in inserted instead of running, the cursor remains within a call and the calltip should not disappear. ---

[issue39493] typing.py has an incorrect definition of closed

2020-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 2e6569b6692298fcc9aae0df3eb3181adb2a5099 by Shantanu in branch 'master': bpo-39493: Fix definition of IO.closed in typing.py (#18265) https://github.com/python/cpython/commit/2e6569b6692298fcc9aae0df3eb3181adb2a5099 -- nosy: +gvanros

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-01-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eli.bendersky, scoder, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list m

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-01-29 Thread Shantanu
Shantanu added the comment: Based on https://github.com/python/cpython/blob/master/Modules/_elementtree.c#L2700 and the behaviour at runtime, something like the following patch could work: ``` diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index c8d898f328..bbfc1afe0

[issue39496] Inelegant loops in Modules/_sqlite/cursor.c

2020-01-29 Thread Alex Henrie
New submission from Alex Henrie : pysqlite_cursor_fetchall currently has the following bit of code: /* just make sure we enter the loop */ row = (PyObject*)Py_None; while (row) { row = pysqlite_cursor_iternext(self); if (row) { PyList_Append(list, row);

[issue39496] Inelegant loops in Modules/_sqlite/cursor.c

2020-01-29 Thread Alex Henrie
Change by Alex Henrie : -- keywords: +patch pull_requests: +17645 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18270 ___ Python tracker ___

[issue39494] Extra null terminators in keyword arrays in sqlite module

2020-01-29 Thread Berker Peksag
Berker Peksag added the comment: New changeset 188bb5b1e868eecf2342195dc45caa332ac3b6c7 by Alex Henrie in branch 'master': bpo-39494: Remove extra null terminators from kwlist vars (GH-18267) https://github.com/python/cpython/commit/188bb5b1e868eecf2342195dc45caa332ac3b6c7 -- nosy:

[issue39494] Extra null terminators in keyword arrays in sqlite module

2020-01-29 Thread Berker Peksag
Change by Berker Peksag : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: resource usage -> ___ Python tracker ___ __

[issue39497] Unused variable script_str in pysqlite_cursor_executescript

2020-01-29 Thread Alex Henrie
New submission from Alex Henrie : The function pysqlite_cursor_executescript defines a variable called script_str, initializes it to NULL, and calls Py_XDECREF on it. However, this variable has been unused since August 2007: https://github.com/python/cpython/commit/6d21456137836b8acd551cf6a51

[issue39497] Unused variable script_str in pysqlite_cursor_executescript

2020-01-29 Thread Alex Henrie
Change by Alex Henrie : -- keywords: +patch pull_requests: +17646 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18271 ___ Python tracker ___

[issue39498] Signpost security considerations in library

2020-01-29 Thread anthony shaw
New submission from anthony shaw : Within the documentation, there are some really important security considerations for standard library modules. e.g. subprocess, ssl, pickle, xml. There is currently no "index" of these, so you have to go hunting for them. They're easter eggs within the docs

[issue39498] Signpost security considerations in library

2020-01-29 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +17647 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18272 ___ Python tracker ___ ___

[issue39493] typing.py has an incorrect definition of closed

2020-01-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17648 pull_request: https://github.com/python/cpython/pull/18273 ___ Python tracker ___ __

  1   2   >