From report at bugs.python.org Thu Nov 1 00:31:09 2018 From: report at bugs.python.org (MasterZ) Date: Thu, 01 Nov 2018 04:31:09 +0000 Subject: [issue35130] add same file name to zipfile , result two files and same md5 Message-ID: <1541046669.26.0.788709270274.issue35130@psf.upfronthosting.co.za> New submission from MasterZ : step 1.I have one file named "1",then add this file to zipfile A.zip step 2.then I have another file named "1" too but different content, and add this file to zipfile A.zip result:in the A.zip exist 2 files both named "1" and both of their md5 is the name with step2's file ---------- components: IO files: a.py messages: 329041 nosy: MasterZ priority: normal severity: normal status: open title: add same file name to zipfile ,result two files and same md5 type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47898/a.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 00:39:10 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Nov 2018 04:39:10 +0000 Subject: [issue28015] configure --with-lto builds fail when CC=clang on Linux, requires gold linker In-Reply-To: <1473320709.67.0.0429640617864.issue28015@psf.upfronthosting.co.za> Message-ID: <1541047150.44.0.788709270274.issue28015@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Probably that's fine, but can #31625 be easily worked around by, e.g., using make AR=llvm-ar RANLIB=llvm-ranlib? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 00:47:21 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Nov 2018 04:47:21 +0000 Subject: [issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping. In-Reply-To: <1432750979.18.0.523128349285.issue24303@psf.upfronthosting.co.za> Message-ID: <1541047641.24.0.788709270274.issue24303@psf.upfronthosting.co.za> Change by Benjamin Peterson : ---------- pull_requests: +9590 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 00:58:38 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Nov 2018 04:58:38 +0000 Subject: [issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping. In-Reply-To: <1432750979.18.0.523128349285.issue24303@psf.upfronthosting.co.za> Message-ID: <1541048318.02.0.788709270274.issue24303@psf.upfronthosting.co.za> Benjamin Peterson added the comment: The retry logic is implemented at a different layer in Python 3: https://github.com/python/cpython/blob/a1c249c40517917d2e0971d55aea8d14a44b2cc8/Lib/multiprocessing/synchronize.py#L115-L117 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 01:19:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 05:19:14 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541049554.22.0.788709270274.issue35128@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think double space after a period is not a bug. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 01:20:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 05:20:08 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541049608.67.0.788709270274.issue35128@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 01:20:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 05:20:49 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541049649.32.0.788709270274.issue35128@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 01:40:47 2018 From: report at bugs.python.org (Mike Frysinger) Date: Thu, 01 Nov 2018 05:40:47 +0000 Subject: [issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping. In-Reply-To: <1432750979.18.0.523128349285.issue24303@psf.upfronthosting.co.za> Message-ID: <1541050847.4.0.788709270274.issue24303@psf.upfronthosting.co.za> Mike Frysinger added the comment: that's highlighting the SemLock._make_name func which doesn't have retry logic in it. did you mean to highlight SemLock.__init__ which has a retry loop that looks similar to the C code ? https://github.com/python/cpython/blob/a1c249c40517917d2e0971d55aea8d14a44b2cc8/Lib/multiprocessing/synchronize.py#L55-L65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 01:41:44 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Nov 2018 05:41:44 +0000 Subject: [issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping. In-Reply-To: <1541050847.4.0.788709270274.issue24303@psf.upfronthosting.co.za> Message-ID: <1541050900.67860.1561816712.05A95D7D@webmail.messagingengine.com> Benjamin Peterson added the comment: Yes On Wed, Oct 31, 2018, at 22:40, Mike Frysinger wrote: > > Mike Frysinger added the comment: > > that's highlighting the SemLock._make_name func which doesn't > have retry> logic in it. did you mean to highlight SemLock.__init__ which has a > retry loop that looks similar to the C code ? > https://github.com/python/cpython/blob/a1c249c40517917d2e0971d55aea8d14a44b2cc8/Lib/multiprocessing/synchronize.py#L55-L65> > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 02:48:55 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 06:48:55 +0000 Subject: [issue35130] add same file name to zipfile , result two files and same md5 In-Reply-To: <1541046669.26.0.788709270274.issue35130@psf.upfronthosting.co.za> Message-ID: <1541054935.83.0.788709270274.issue35130@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is expected behavior. When you have two entries with the same name, you can access by name only one of them. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 03:05:37 2018 From: report at bugs.python.org (tzickel) Date: Thu, 01 Nov 2018 07:05:37 +0000 Subject: [issue35117] set.discard should return True or False based on if element existed. In-Reply-To: <1540925432.63.0.788709270274.issue35117@psf.upfronthosting.co.za> Message-ID: <1541055937.7.0.788709270274.issue35117@psf.upfronthosting.co.za> tzickel added the comment: I would think that the .discard is the equivalent of .pop in dict. (instead of wasting time once checking and once removing, also the data in a set is the data, there is no value to check). Even the standard lib has lots of usage of dict.pop(key, None) to not throw an exception. (instead of not using None, and catching exception). What sets this apart from other mutating APIs is that it does not throw an exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 03:16:51 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 07:16:51 +0000 Subject: [issue35126] Mistake in FAQ about converting number to string. In-Reply-To: <1541005659.07.0.788709270274.issue35126@psf.upfronthosting.co.za> Message-ID: <1541056611.73.0.788709270274.issue35126@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 03:45:34 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 07:45:34 +0000 Subject: [issue35114] ssl.RAND_status docs describe it as returning True/False; actually returns 1/0 In-Reply-To: <1540906817.06.0.788709270274.issue35114@psf.upfronthosting.co.za> Message-ID: <1541058334.22.0.788709270274.issue35114@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 05:17:21 2018 From: report at bugs.python.org (Pablo Santiago Blum de Aguiar) Date: Thu, 01 Nov 2018 09:17:21 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541063841.47.0.788709270274.issue35128@psf.upfronthosting.co.za> Pablo Santiago Blum de Aguiar added the comment: You have a point. They make the message more readable. I've readded the double spaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 05:56:37 2018 From: report at bugs.python.org (Valentin Zhao) Date: Thu, 01 Nov 2018 09:56:37 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file Message-ID: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> New submission from Valentin Zhao : I want to manage all the packages that I installed so every time adding package I set "--target" so the package will be downloaded there. Then I wrote the directory in a .pth file which is located in "/Python36/Lib/site-packages" so I could still get accessed to all the packages even though they are not located within "Python36" folder. However, my current user name of Windows is a Chinese name, which means the customized path I mentioned before has Chinese characters within it, thus the .pth file will be also encoded with 'gbk'. Every time I would like to import these packages will get "UnicodeDecodeError: 'gbk' can't decode byte xxx...". Fortunately I have found the reason and cracked the problem: python read .pth files without setting any encoding. The code is located in "Python36/Lib/site.py" def addpackage(sitedir, name, known_paths): if known_paths is None: known_paths = _init_pathinfo() reset = True else: reset = False fullname = os.path.join(sitedir, name) try: # here should set the second param as encoding='utf-8' f = open(fullname, "r") except OSError: return # other codes And after I doing this, everything goes well. ---------- components: Library (Lib) files: IMG_20181101_173328_[B at ae031df.jpg messages: 329050 nosy: Valentin Zhao priority: normal severity: normal status: open title: Cannot access to customized paths within .pth file type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47899/IMG_20181101_173328_[B at ae031df.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 06:33:47 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 10:33:47 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541068427.44.0.788709270274.issue35128@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4b5e62dbb22a3593e0db266c12f805b727a42b00 by Serhiy Storchaka (Pablo Aguiar) in branch 'master': bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268) https://github.com/python/cpython/commit/4b5e62dbb22a3593e0db266c12f805b727a42b00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 06:40:19 2018 From: report at bugs.python.org (Dylan Cali) Date: Thu, 01 Nov 2018 10:40:19 +0000 Subject: [issue35132] python-gdb error: Python Exception Type does not have a target Message-ID: <1541068819.38.0.788709270274.issue35132@psf.upfronthosting.co.za> New submission from Dylan Cali : Python version: 3.6.6-debug System: Kernel: 4.15.0-38-generic x86_64 Distro: Linux Mint 18.2 Sonya CPU: Quad core Intel Xeon E3-1505M Memory: 32018.6MB Expected: py-list and py-bt to print the current python frame and traceback when attaching to a hung python process with gdb, a debug build of python, and cpython/Tools/gdb/libpython.py loaded. Actual: py-list and py-bt fail with: Python Exception Type does not have a target.: Error occurred in Python command: Type does not have a target. Invoking 'set python print-stack full' in gdb produces the more useful: Traceback (most recent call last): File "", line 1, in File "~/git/cpython/Tools/gdb/libpython.py", line 916, in filename File "~/git/cpython/Tools/gdb/libpython.py", line 1158, in proxyval RuntimeError: Type does not have a target. so it is failing at: fields = gdb.lookup_type('PyUnicodeObject').target().fields() in libpython.py [1]. Reproduce: I haven't been able to create a simple standalone program that triggers the failure. I am working on a PR for Keras to try and fix the multiprocessing support in some of their utility classes. Currently the tests are sporadically hanging and my intention was to use python's gdb integration to identify exactly where and why the hangs are occuring... but I can't get that information at the moment because of the error above when invoking py-list and py-bt. So, unfortunately, the shortest path to reproduce is to checkout the PR branch, run the offending tests, connect with gdb, and invoke py-list/py-bt: * install a debug version of 3.6.6 if one isn't already available * git clone https://github.com/calid/keras.git -b fix-multiprocessing-hang * cd keras * pip install -e .[tests] * pip install tensorflow * py.test tests/keras/utils/data_utils_test.py * wait for hang * gdb -p * invoke py-list or py-bt I am happy to poke around in libpython.py and try to fix/submit a PR myself, but I'm not at all familiar with the python internals so I would need some guidance. And obviously let me know if this isn't actually a bug but rather environment related/user error. Thank you! [1] https://github.com/python/cpython/blob/v3.6.6/Tools/gdb/libpython.py#L1158 ---------- components: Demos and Tools messages: 329052 nosy: Dylan Cali priority: normal severity: normal status: open title: python-gdb error: Python Exception Type does not have a target type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 06:48:55 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 10:48:55 +0000 Subject: [issue33578] cjkcodecs missing getstate and setstate implementations In-Reply-To: <1526713206.06.0.682650639539.issue33578@psf.upfronthosting.co.za> Message-ID: <1541069335.39.0.788709270274.issue33578@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ac22f6aa989f18c33c12615af1c66c73cf75d5e7 by Miss Islington (bot) (Christopher Thorne) in branch 'master': bpo-33578: Add getstate/setstate for CJK codec (GH-6984) https://github.com/python/cpython/commit/ac22f6aa989f18c33c12615af1c66c73cf75d5e7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 07:15:13 2018 From: report at bugs.python.org (akhi singhania) Date: Thu, 01 Nov 2018 11:15:13 +0000 Subject: [issue35122] Process not exiting on unhandled exception when using multiprocessing module In-Reply-To: <1540984598.88.0.788709270274.issue35122@psf.upfronthosting.co.za> Message-ID: <1541070913.4.0.788709270274.issue35122@psf.upfronthosting.co.za> akhi singhania added the comment: Thank you very much for the reply and the link. It seems like I escaped that bit in the documentation, my apologises. I can confirm that using cancel_join_thread() removes the need for explicitly calling queue.close(). May I please ask for some more clarification if you do not mind. My understanding now is that, there are two scenarios to consider when a process using queues tries to exit: - The default behaviour seems to be that the process must flush the queue before it exits. This is useful as it will ensure that none of the queued data is lost which can be very useful in some circumstances. - The alternate behaviour (which can be enabled by setting cancel_join_thread()) is that you don't care about losing the data in the queue and just want to exit. Again this can be useful in some circumstances if you don't care if the data is lost and emptying out the queue might potentially take a long time. Does the above sound about right? Thank you very much for your explanation and sorry again for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 07:36:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 11:36:22 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541072182.33.0.788709270274.issue35128@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9591 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 07:37:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 11:37:52 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541072272.1.0.788709270274.issue35128@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:19:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:19:27 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541074767.92.0.788709270274.issue35128@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5e0537cf7e5b0a5ef134c7da0b68b8e55c69f4b0 by Serhiy Storchaka in branch '3.7': [3.7] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10280) https://github.com/python/cpython/commit/5e0537cf7e5b0a5ef134c7da0b68b8e55c69f4b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:19:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:19:40 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541074780.56.0.788709270274.issue35128@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 89138f286938753f273c90547491efe374e617c1 by Serhiy Storchaka in branch '3.6': [3.6] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10281) https://github.com/python/cpython/commit/89138f286938753f273c90547491efe374e617c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:24:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:24:14 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541075054.17.0.788709270274.issue35128@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Seems 2.7 is not affected. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:29:44 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 12:29:44 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541075384.16.0.788709270274.issue35075@psf.upfronthosting.co.za> miss-islington added the comment: New changeset bf46a09dec372b85846216bd692d648dac08ac36 by Miss Islington (bot) (Pablo Galindo) in branch 'master': bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://github.com/python/cpython/commit/bf46a09dec372b85846216bd692d648dac08ac36 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:29:48 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 12:29:48 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541075388.46.0.788709270274.issue35075@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:29:55 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 12:29:55 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541075395.15.0.788709270274.issue35075@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:35:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:35:09 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines Message-ID: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The following PR fixes many bugs related to concatenating string literals on different lines. There are two kinds of errors: 1. Missed space. The first line is ended with a word, and the second line is started with a word. When they are concatenated, there is no space between words. This is the same issue as issue35128, but not only in warning messages, and not only in Python. 2. Missed comma in a list of string literals. This leads to concatenating the last string in the first line and the first list in the second line. ---------- components: Library (Lib) messages: 329059 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Bugs in concatenating string literals on different lines type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:40:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:40:35 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541076035.7.0.788709270274.issue35133@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9595 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 08:46:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Nov 2018 12:46:49 +0000 Subject: [issue35134] Move Py_LIMITED_API to Include/pycapi/ Message-ID: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> New submission from STINNER Victor : The PEP 384 "Defining a Stable ABI" introduced Py_LIMITED_API define to exclude functions from the Python C API. The problem is when a new API is introduced, it has to explicitly be excluded using "#ifndef Py_LIMITED_API". If the author forgets it, the function is added to be stable API by mistake. I propose to move the API which should be excluded from the stable ABI to a new subdirectory: Include/pycapi/. To not break the backward compatibility, I propose to automatically include new header files from existing header files. For example, Include/pycapi/pyapi_objimpl.h would be automatically included by Include/pycapi/pycapi_objimpl.h. New header files would have a "pycapi_" prefix to avoid conflict Include/ header files, if Include/pycapi/ directory is in the header search paths. This change is a follow-up of bpo-35081 which moved Py_BUILD_CORE code to Include/internal/. It is also part of a larger project to cleanup the C API, see: * https://pythoncapi.readthedocs.io/split_include.html * https://pythoncapi.readthedocs.io/ The change is backward compatible: #include will still provide exactly the same API. ---------- components: Interpreter Core messages: 329060 nosy: vstinner priority: normal severity: normal status: open title: Move Py_LIMITED_API to Include/pycapi/ versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:03:24 2018 From: report at bugs.python.org (TestUser) Date: Thu, 01 Nov 2018 13:03:24 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: Message-ID: TestUser added the comment: On Mon, Oct 29, 2018 at 4:03 PM TestUser wrote: > > TestUser added the comment: > > In the new version of Ubuntu this generates a system crash report. Normally > I delete them. > > Give me a day or to to get you one. > > Funny, since it is the crash reports use of base64 encoding that led me to > the Python base64 module. > > On Sun, Oct 28, 2018 at 8:42 PM Karthikeyan Singaravelan < > report at bugs.python.org> wrote: > > > > > Karthikeyan Singaravelan added the comment: > > > > Can you please add your definition of a crash? Crash in bug report > context > > is used in C language context like causing a segfault, buffer overflow > etc. > > Proper Exceptions are not considered as a crash and this is an exception > > raised since the contents are invalid. If it crashes as I mentioned above > > can you please add the crash log? > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- Added file: https://bugs.python.org/file47900/_usr_lib_python3.6_base64.py.1000.zip _______________________________________ Python tracker _______________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: _usr_lib_python3.6_base64.py.1000.zip Type: application/x-zip-compressed Size: 14058 bytes Desc: not available URL: From report at bugs.python.org Thu Nov 1 09:04:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Nov 2018 13:04:52 +0000 Subject: [issue35134] Move Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541077492.53.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9596 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:05:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Nov 2018 13:05:59 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541077559.52.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Move Py_LIMITED_API to Include/pycapi/ -> Move !Py_LIMITED_API to Include/pycapi/ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:06:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Nov 2018 13:06:31 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541077591.71.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: I created bpo-35134: Move !Py_LIMITED_API to Include/pycapi/. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:13:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 13:13:16 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: <1541077996.65.0.788709270274.issue35084@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Don't include quoted full messages of other users. Only include quoted fragments if it is absolutely necessary. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:13:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 13:13:40 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: <1541078020.96.0.788709270274.issue35084@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg329061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:16:54 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 13:16:54 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: <1541078214.24.0.788709270274.issue35084@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: @Tester Thanks for the report. I looked at the crash report and I couldn't see CPython crashing with a segfault. I think it's a crash from another application which might be running the interpreter and can't handle the error raised by CPython for invalid data being decoded. This is something the application which crashes has to handle when CPython returns the expected trace back and I don't see any fix from CPython's end. Correct me if I am wrong here. Relevant CPython trace back : PythonArgs: ['/usr/lib/python3.6/base64.py', '-d', 'test.code2'] Traceback: Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/lib/python3.6/base64.py", line 602, in main() File "/usr/lib/python3.6/base64.py", line 586, in main func(f, sys.stdout.buffer) File "/usr/lib/python3.6/base64.py", line 512, in decode s = binascii.a2b_base64(line) binascii.Error: Incorrect padding Please remove the quoted content while replying from email since it's added to the bug tracker and causes scrolling a little difficult with duplicated content. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:18:16 2018 From: report at bugs.python.org (TestUser) Date: Thu, 01 Nov 2018 13:18:16 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1541078020.99.0.702299269573.issue35084@psf.upfronthosting.co.za> Message-ID: TestUser added the comment: That is all the crash automator provides. On Thu, Nov 1, 2018 at 9:13 AM Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > ---------- > Removed message: https://bugs.python.org/msg329061 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:31:30 2018 From: report at bugs.python.org (TestUser) Date: Thu, 01 Nov 2018 13:31:30 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: Message-ID: TestUser added the comment: My guess is the Gnome terminal. It does not like non ASCI data. There are other programs that generate segfaults in the terminal when piped random binary data. Maybe, Python could get a -Q quit setting to turn of the trace back? Thanks On Thu, Nov 1, 2018 at 9:18 AM TestUser wrote: > > TestUser added the comment: > > That is all the crash automator provides. > > On Thu, Nov 1, 2018 at 9:13 AM Serhiy Storchaka > wrote: > > > > > Change by Serhiy Storchaka : > > > > > > ---------- > > Removed message: https://bugs.python.org/msg329061 > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:33:35 2018 From: report at bugs.python.org (TestUser) Date: Thu, 01 Nov 2018 13:33:35 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: TestUser added the comment: Last thought ... man base64 has different options than the program: python3 -m base64 -d -i test.code2 option -i not recognized usage: /usr/lib/python3.6/base64.py [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (default) -t: encode and decode string 'Aladdin:open sesame' On Thu, Nov 1, 2018 at 9:31 AM Fred Unll wrote: > My guess is the Gnome terminal. It does not like non ASCI data. There are > other programs that generate segfaults in the terminal when piped random > binary data. > > Maybe, Python could get a -Q quit setting to turn of the trace back? > > Thanks > > > On Thu, Nov 1, 2018 at 9:18 AM TestUser wrote: > >> >> TestUser added the comment: >> >> That is all the crash automator provides. >> >> On Thu, Nov 1, 2018 at 9:13 AM Serhiy Storchaka >> wrote: >> >> > >> > Change by Serhiy Storchaka : >> > >> > >> > ---------- >> > Removed message: https://bugs.python.org/msg329061 >> > >> > _______________________________________ >> > Python tracker >> > >> > _______________________________________ >> > >> >> ---------- >> >> _______________________________________ >> Python tracker >> >> _______________________________________ >> > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 09:37:33 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 13:37:33 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541079453.22.0.788709270274.issue35075@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7344b9fa0ef7bd8b902e7aa9a8f74b5dce915e59 by Miss Islington (bot) in branch '3.6': bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://github.com/python/cpython/commit/7344b9fa0ef7bd8b902e7aa9a8f74b5dce915e59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:09:14 2018 From: report at bugs.python.org (Pedro) Date: Thu, 01 Nov 2018 14:09:14 +0000 Subject: [issue35135] pip install --download option does not exist Message-ID: <1541081354.04.0.788709270274.issue35135@psf.upfronthosting.co.za> New submission from Pedro : https://pip.pypa.io/en/stable/user_guide/#installing-from-local-packages states that you can use a --directory option with the install subcommand. This fails with pip 18.1 on both Python 2.7 on SLES12 and Python 3.6 on Windows 10: ========== pip install --download my_dir -r reqs.txt Usage: pip install [options] [package-index-options] ... pip install [options] -r [package-index-options] ... pip install [options] [-e] ... pip install [options] [-e] ... pip install [options] ... no such option: --download ---------- assignee: docs at python components: Documentation messages: 329069 nosy: docs at python, pgacv2 priority: normal severity: normal status: open title: pip install --download option does not exist type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:19:22 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 01 Nov 2018 14:19:22 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot Message-ID: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : https://buildbot.python.org/all/#/builders/172/builds/40/steps/4/logs/stdio ====================================================================== ERROR: test_ciphers (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1672, in test_ciphers s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1109, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1100, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer Stdout: server: new connection from ('127.0.0.1', 12982) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== ERROR: test_connect (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1497, in test_connect s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1109, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1100, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() BrokenPipeError: [Errno 32] Broken pipe Stdout: server: new connection from ('127.0.0.1', 12985) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== ERROR: test_connect_cadata (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1614, in test_connect_cadata s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1109, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1100, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer Stdout: server: new connection from ('127.0.0.1', 12988) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1593, in test_connect_capath s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1109, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1100, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer Stdout: server: new connection from ('127.0.0.1', 12991) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== ERROR: test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1555, in test_connect_with_context s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1109, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1100, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer Stdout: server: new connection from ('127.0.0.1', 12998) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer test test_ssl failed ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1659, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1819, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1231, in get_server_certificate with create_connection(addr) as sock: File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/socket.py", line 724, in create_connection raise err File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/socket.py", line 713, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused Stdout: server: new connection from ('127.0.0.1', 13007) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1938, in run msg = self.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1915, in read return self.sslconn.read() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 874, in read return self._sslobj.read(len, buffer) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 633, in read v = self._sslobj.read(len) ConnectionResetError: [Errno 54] Connection reset by peer ---------------------------------------------------------------------- ---------- assignee: christian.heimes components: SSL, Tests messages: 329070 nosy: christian.heimes, koobs, pablogsal priority: normal severity: normal status: open title: test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:20:49 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 01 Nov 2018 14:20:49 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot In-Reply-To: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> Message-ID: <1541082049.87.0.788709270274.issue35136@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: There is also: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_ssl.py", line 1860, in wrap_conn self.sock, server_side=True) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 817, in __init__ self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:847) https://buildbot.python.org/all/#/builders/172/builds/69/steps/4/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:22:27 2018 From: report at bugs.python.org (Christian Heimes) Date: Thu, 01 Nov 2018 14:22:27 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot In-Reply-To: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> Message-ID: <1541082147.39.0.788709270274.issue35136@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm trying to figure out the exact OpenSSL version. It used to be part of pythoninfo step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:25:47 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 14:25:47 +0000 Subject: [issue35135] pip install --download option does not exist In-Reply-To: <1541081354.04.0.788709270274.issue35135@psf.upfronthosting.co.za> Message-ID: <1541082347.56.0.788709270274.issue35135@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. The issue tracker deals with reports for CPython and issues related to pip are not maintained here. Please file a doc issue at https://github.com/pypa/pip/ . `--download` was deprecated with https://github.com/pypa/pip/pull/3085 and PR reports it's for removal with pip 10. Usage of `pip download` as a toplevel command is encouraged and can be used. Relevant doc needs to be updated at https://github.com/pypa/pip/blob/master/docs/html/user_guide.rst. Thanks ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:29:06 2018 From: report at bugs.python.org (Zachary Ware) Date: Thu, 01 Nov 2018 14:29:06 +0000 Subject: [issue35135] pip install --download option does not exist In-Reply-To: <1541081354.04.0.788709270274.issue35135@psf.upfronthosting.co.za> Message-ID: <1541082546.46.0.788709270274.issue35135@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- assignee: docs at python -> resolution: -> third party stage: -> resolved status: open -> closed type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:38:14 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 14:38:14 +0000 Subject: [issue35135] pip install --download option does not exist In-Reply-To: <1541081354.04.0.788709270274.issue35135@psf.upfronthosting.co.za> Message-ID: <1541083094.28.0.788709270274.issue35135@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: FYI created an issue at https://github.com/pypa/pip/issues/5976 Thanks! ---------- assignee: -> docs at python resolution: third party -> stage: resolved -> status: closed -> open type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 10:39:04 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 14:39:04 +0000 Subject: [issue35135] pip install --download option does not exist In-Reply-To: <1541081354.04.0.788709270274.issue35135@psf.upfronthosting.co.za> Message-ID: <1541083144.53.0.788709270274.issue35135@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Sorry, my comment reopened the bug :( ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 11:43:54 2018 From: report at bugs.python.org (Erik Janssens) Date: Thu, 01 Nov 2018 15:43:54 +0000 Subject: [issue20596] Support for alternate wcstok syntax for Windows compilers In-Reply-To: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> Message-ID: <1541087034.0.0.788709270274.issue20596@psf.upfronthosting.co.za> Change by Erik Janssens : ---------- pull_requests: +9597 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 11:49:22 2018 From: report at bugs.python.org (Erik Janssens) Date: Thu, 01 Nov 2018 15:49:22 +0000 Subject: [issue20596] Support for alternate wcstok syntax for Windows compilers In-Reply-To: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> Message-ID: <1541087362.16.0.788709270274.issue20596@psf.upfronthosting.co.za> Erik Janssens added the comment: I created a github pull request based on the last patch of Jeffrey Armstrong. Since mingw now also has a wcstok_s function, the discrimination between wcstok/wcstok_s is now based on MS_WINDOWS being defined, as was the case in Modules/main.c. Is this correct, or should it be based on the detected compiler ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 12:27:34 2018 From: report at bugs.python.org (Pablo Santiago Blum de Aguiar) Date: Thu, 01 Nov 2018 16:27:34 +0000 Subject: [issue35128] warning.warn messages with spacing issues In-Reply-To: <1541022462.19.0.788709270274.issue35128@psf.upfronthosting.co.za> Message-ID: <1541089654.7.0.788709270274.issue35128@psf.upfronthosting.co.za> Pablo Santiago Blum de Aguiar added the comment: Thanks again for reviewing, merging and backporting. Next time I'll try and backport as well :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 12:43:59 2018 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 01 Nov 2018 16:43:59 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises Message-ID: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> New submission from Anthony Sottile : This may be intentional, but the behaviour changed between python2 and python3. Want to make sure it's intentional as we're working (hacking) around this in pytest: https://github.com/pytest-dev/pytest/pull/4284 The actual impact on pytest is the use of `inspect.isclass` Simplest reproduction: class C(object): @property def __class__(self): raise AssertionError('fail') isinstance(C(), type) In python2.x: $ python2 t.py $ In python 3.x: $ python3.7 t.py Traceback (most recent call last): File "t.py", line 6, in isinstance(C(), type) File "t.py", line 4, in __class__ raise AssertionError('fail') AssertionError: fail In python2.x it appears there's code which intentionally avoids this case: https://github.com/python/cpython/blob/ca079a3ea30098aff3197c559a0e32d42dda6d84/Objects/abstract.c#L2906-L2909 Mostly want to see if this is intentional or not, it does feel odd that `inspect.isclass` raises instead of returning `False` in this case, but it's unclear if it's a problem with `isclass` or `isinstance` ---------- components: Library (Lib) messages: 329078 nosy: Anthony Sottile priority: normal severity: normal status: open title: Exception in isinstance when __class__ property raises type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 12:45:34 2018 From: report at bugs.python.org (davidak) Date: Thu, 01 Nov 2018 16:45:34 +0000 Subject: [issue35138] timeit documentation should have example with function arguments Message-ID: <1541090734.49.0.788709270274.issue35138@psf.upfronthosting.co.za> New submission from davidak : It is described here: https://www.pythoncentral.io/time-a-python-function/ I have just tested it. Works as expected. Best would be if timeit supports this natively. ---------- assignee: docs at python components: Documentation messages: 329079 nosy: davidak, docs at python priority: normal severity: normal status: open title: timeit documentation should have example with function arguments versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 12:49:26 2018 From: report at bugs.python.org (daniel hahler) Date: Thu, 01 Nov 2018 16:49:26 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises In-Reply-To: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> Message-ID: <1541090966.86.0.788709270274.issue35137@psf.upfronthosting.co.za> Change by daniel hahler : ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:08:17 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 17:08:17 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises In-Reply-To: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> Message-ID: <1541092097.57.0.788709270274.issue35137@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Arbitrary exceptions should not be silenced. Imagine that the user pressed Ctrl-C when the __class__ property implemented in Python was executed. The KeyboardInterrupt exception will be silenced in Python 2, and isinstance() will silently return incorrect result. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:12:45 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 17:12:45 +0000 Subject: [issue35138] timeit documentation should have example with function arguments In-Reply-To: <1541090734.49.0.788709270274.issue35138@psf.upfronthosting.co.za> Message-ID: <1541092365.69.0.788709270274.issue35138@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:18:45 2018 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 01 Nov 2018 17:18:45 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises In-Reply-To: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> Message-ID: <1541092725.18.0.788709270274.issue35137@psf.upfronthosting.co.za> Anthony Sottile added the comment: arbitrary, sure, but deriving from `Exception` maybe? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:23:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 17:23:54 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541093034.81.0.788709270274.issue35081@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Please don't change Include/datetime.h without consulting with original authors of this code (see issue876130). ---------- nosy: +atuining, lemburg, serhiy.storchaka, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:45:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 17:45:21 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises In-Reply-To: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> Message-ID: <1541094321.17.0.788709270274.issue35137@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: MemoryError and RecursionError are subclasses of Exception. And there are may be other exceptions that can be raised by virtually any code and depend on conditions out of your control. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 13:58:17 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 17:58:17 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541095097.48.0.788709270274.issue35133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am only unsure about email tests. Barry, David, could you please look? There may be errors in tests, but it may be that spaces are intentionally omitted, for testing cases without spaces. Tests are passed in any case, but I don't know the purpose of these tests. ---------- nosy: +barry, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 14:16:46 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Nov 2018 18:16:46 +0000 Subject: [issue35138] timeit documentation should have example with function arguments In-Reply-To: <1541090734.49.0.788709270274.issue35138@psf.upfronthosting.co.za> Message-ID: <1541096206.54.0.788709270274.issue35138@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: There is an open PR that adds a similar example. Is it the same as the one you are proposing and I think you can add a review comment to add it with the same PR if it's different? PR : https://github.com/python/cpython/pull/9787 Thanks ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 14:24:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Nov 2018 18:24:19 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541096659.1.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: > Please don't change Include/datetime.h without consulting with original authors of this code (see issue876130). FYI I tried to be very careful on each change to never modify the *public* C API. But I modified the Py_BUILD_CORE API. This is fine since this API can change anytime, and it must not be used outside Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 14:42:49 2018 From: report at bugs.python.org (davidak) Date: Thu, 01 Nov 2018 18:42:49 +0000 Subject: [issue35138] timeit documentation should have example with function arguments In-Reply-To: <1541090734.49.0.788709270274.issue35138@psf.upfronthosting.co.za> Message-ID: <1541097769.56.0.788709270274.issue35138@psf.upfronthosting.co.za> Change by davidak : ---------- keywords: +patch pull_requests: +9598 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 17:06:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 21:06:46 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541106406.31.0.788709270274.issue35134@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are not just two sides. It is common to wrap new stable C API with something like: #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 What will you do with this? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 17:33:57 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Nov 2018 21:33:57 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541108037.25.0.788709270274.issue35075@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7d35553138d8b2799ae68601ce836a3647509718 by Miss Islington (bot) in branch '3.7': bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://github.com/python/cpython/commit/7d35553138d8b2799ae68601ce836a3647509718 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 17:56:10 2018 From: report at bugs.python.org (Maxime Belanger) Date: Thu, 01 Nov 2018 21:56:10 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS Message-ID: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> New submission from Maxime Belanger : Uncommenting the following line in `Modules/Setup` leads to a compiler error on macOS (tested w/ Xcode 10): ``` ./Modules/expat/xmlparse.c:92:3: error: You do not have support for any sources of high quality entropy enabled. For end user security, that is probably not what you want. Your options include: * Linux + glibc >=2.25 (getrandom): HAVE_GETRANDOM, * Linux + glibc <2.25 (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, * BSD / macOS <10.7 (arc4random): HAVE_ARC4RANDOM, * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, * Linux / BSD / macOS (/dev/urandom): XML_DEV_URANDOM * Windows (RtlGenRandom): _WIN32. If insist on not using any of these, bypass this error by defining XML_POOR_ENTROPY; you have been warned. If you have reasons to patch this detection code away or need changes to the build system, please open a bug. Thank you! ``` I believe this is due to `setup.py` being out of sync with `Modules/Setup`, which defines `XML_POOR_ENTROPY`. I'll attach a patch that resolves the issue for me. ---------- components: Build, Extension Modules, macOS messages: 329089 nosy: Maxime Belanger, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Statically linking pyexpat in Modules/Setup fails to compile on macOS type: compile error versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 17:58:03 2018 From: report at bugs.python.org (Maxime Belanger) Date: Thu, 01 Nov 2018 21:58:03 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541109483.68.0.788709270274.issue35139@psf.upfronthosting.co.za> Maxime Belanger added the comment: The line in question being: ``` #pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 18:02:07 2018 From: report at bugs.python.org (=?utf-8?q?Max_B=C3=A9langer?=) Date: Thu, 01 Nov 2018 22:02:07 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541109727.11.0.788709270274.issue35139@psf.upfronthosting.co.za> Change by Max B?langer : ---------- keywords: +patch pull_requests: +9599 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 18:06:08 2018 From: report at bugs.python.org (davide moro) Date: Thu, 01 Nov 2018 22:06:08 +0000 Subject: [issue35129] Different behaviour comparing versions (distutils.version.LooseVersion) between python2.7 and python3.x In-Reply-To: <1541030001.41.0.788709270274.issue35129@psf.upfronthosting.co.za> Message-ID: davide moro added the comment: Thanks and sorry for the duplicate! Il giorno gio 1 nov 2018 alle ore 00:53 ?ric Araujo ha scritto: > > ?ric Araujo added the comment: > > Please discuss on #14894 > > ---------- > resolution: -> duplicate > stage: -> resolved > status: open -> closed > superseder: -> distutils.LooseVersion fails to compare number and a word > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 20:25:00 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 02 Nov 2018 00:25:00 +0000 Subject: [issue35058] Unable to Install Python on Windows In-Reply-To: <1540390509.38.0.788709270274.issue35058@psf.upfronthosting.co.za> Message-ID: <1541118300.82.0.788709270274.issue35058@psf.upfronthosting.co.za> Steve Dower added the comment: I don't know what is on your syllabus, but you might have more luck with Anaconda or WinPython than Python 2.7 or 3.4 (which is how far back you'd have to go to get a different installer). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 20:49:20 2018 From: report at bugs.python.org (Christopher Thorne) Date: Fri, 02 Nov 2018 00:49:20 +0000 Subject: [issue33578] cjkcodecs missing getstate and setstate implementations In-Reply-To: <1526713206.06.0.682650639539.issue33578@psf.upfronthosting.co.za> Message-ID: <1541119760.94.0.788709270274.issue33578@psf.upfronthosting.co.za> Change by Christopher Thorne : ---------- pull_requests: +9600 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 21:17:55 2018 From: report at bugs.python.org (Felipe Rodrigues) Date: Fri, 02 Nov 2018 01:17:55 +0000 Subject: [issue25416] Add encoding aliases from the (HTML5) Encoding Standard In-Reply-To: <1444932787.73.0.313042926579.issue25416@psf.upfronthosting.co.za> Message-ID: <1541121475.76.0.788709270274.issue25416@psf.upfronthosting.co.za> Felipe Rodrigues added the comment: Ezio, I have issued a simple PR that adds just the two aliases cited in the issue's initial message. I would like to implement tests but as I wrote in the PR's message, I'm not really sure how to proceed with that. bpo-18624 is really related to this issue and in there is a reference to a test_codecs.py file that I did not find. If you could give me a few pointer on how to proceed, I'll be glad to improve my PR, add tests and even add all the other aliases that are missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 21:39:08 2018 From: report at bugs.python.org (Roger Serwy) Date: Fri, 02 Nov 2018 01:39:08 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541122748.57.0.788709270274.issue33000@psf.upfronthosting.co.za> Roger Serwy added the comment: Big Stone: Yes, IDLEX does have a slow memory leak. Please check if this bug is happening with IDLE itself. Terry: Thanks for responding to this. I suggest this issue can be closed. ---------- nosy: +roger.serwy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 21:53:04 2018 From: report at bugs.python.org (Kubilay Kocak) Date: Fri, 02 Nov 2018 01:53:04 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot In-Reply-To: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> Message-ID: <1541123584.82.0.788709270274.issue35136@psf.upfronthosting.co.za> Kubilay Kocak added the comment: The version in base is: /usr/bin/openssl version OpenSSL 1.1.1-freebsd 11 Sep 2018 There is a version from ports also installed at a different prefix, which I don't believe Python picks up by default unless Modules/Setup or --with-openssl (is this in 3.6?) is used. I don't believe either, or anything else non-default is used for this buildbot environment, either in the worker configuration, or the builder configs themselves. If test_ssl isnt failing on 3.x on this same worker, then presumably there's a commit or fix that hasn't been backported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 21:53:35 2018 From: report at bugs.python.org (Roger Serwy) Date: Fri, 02 Nov 2018 01:53:35 +0000 Subject: [issue31880] subprocess process interaction with IDLEX GUI causes pygnuplot silent failures In-Reply-To: <1509038618.41.0.213398074469.issue31880@psf.upfronthosting.co.za> Message-ID: <1541123615.62.0.788709270274.issue31880@psf.upfronthosting.co.za> Roger Serwy added the comment: I am closing this issue. For future reference, IDLEX is a separate project from IDLE. Please refer IDLEX bugs to the project developer (me). ---------- assignee: -> terry.reedy components: +IDLE -Interpreter Core, Windows nosy: +roger.serwy, terry.reedy stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:17:43 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 02:17:43 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541125063.83.0.788709270274.issue35113@psf.upfronthosting.co.za> Windson Yang added the comment: Yes, the code located at https://github.com/python/cpython/blob/7cd25434164882c2093ea41ccfc7b95a05cd5cbd/Lib/inspect.py#L794 I think to use a comment status var would be a solution, Do you have any idea to fix it? ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:34:13 2018 From: report at bugs.python.org (=?utf-8?b?5a6J6L+3?=) Date: Fri, 02 Nov 2018 02:34:13 +0000 Subject: [issue35141] encoding problem: gbk Message-ID: <1541126053.67.0.788709270274.issue35141@psf.upfronthosting.co.za> New submission from ?? : Windows10x64 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 ---------- components: Windows files: encoding_problem_gbk.py messages: 329099 nosy: anmikf, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: encoding problem: gbk type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47902/encoding_problem_gbk.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:49:49 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Nov 2018 02:49:49 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541126989.65.0.788709270274.issue35139@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 318ab63c01f5b8e7562b122ab5ba01258a51277b by Benjamin Peterson (Max B?langer) in branch 'master': closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) https://github.com/python/cpython/commit/318ab63c01f5b8e7562b122ab5ba01258a51277b ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:50:01 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Nov 2018 02:50:01 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541127001.23.0.788709270274.issue35139@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9601 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:50:14 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Nov 2018 02:50:14 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541127014.19.0.788709270274.issue35139@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9602 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 22:52:23 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Nov 2018 02:52:23 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541127143.5.0.788709270274.issue35139@psf.upfronthosting.co.za> Change by Benjamin Peterson : ---------- pull_requests: +9603 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 23:09:07 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Nov 2018 03:09:07 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541128147.56.0.788709270274.issue35139@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 04c96669b161d802b7a906c06cd77895cee1864e by Miss Islington (bot) in branch '3.7': closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) https://github.com/python/cpython/commit/04c96669b161d802b7a906c06cd77895cee1864e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 23:28:39 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Nov 2018 03:28:39 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541129319.11.0.788709270274.issue35139@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset a614cc92088c4e1b2d90aa03415ee6acf70f03b4 by Benjamin Peterson in branch '2.7': [2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293) https://github.com/python/cpython/commit/a614cc92088c4e1b2d90aa03415ee6acf70f03b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 23:29:43 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 02 Nov 2018 03:29:43 +0000 Subject: [issue33578] cjkcodecs missing getstate and setstate implementations In-Reply-To: <1526713206.06.0.682650639539.issue33578@psf.upfronthosting.co.za> Message-ID: <1541129383.29.0.788709270274.issue33578@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 488c0a6cdf09e21774e63c2a430ecc0de804d147 by INADA Naoki (Christopher Thorne) in branch 'master': bpo-33578: Fix getstate/setstate for CJK decoder (GH-10290) https://github.com/python/cpython/commit/488c0a6cdf09e21774e63c2a430ecc0de804d147 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 1 23:32:33 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Nov 2018 03:32:33 +0000 Subject: [issue35139] Statically linking pyexpat in Modules/Setup fails to compile on macOS In-Reply-To: <1541109370.92.0.788709270274.issue35139@psf.upfronthosting.co.za> Message-ID: <1541129553.72.0.788709270274.issue35139@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2339fe7cad9a84815fe551fedd6acdc3f2bf0a64 by Miss Islington (bot) in branch '3.6': closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) https://github.com/python/cpython/commit/2339fe7cad9a84815fe551fedd6acdc3f2bf0a64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 01:03:45 2018 From: report at bugs.python.org (Daniel Lovell) Date: Fri, 02 Nov 2018 05:03:45 +0000 Subject: [issue35142] html.entities.html5 should require a trailing semicolon Message-ID: <1541135025.26.0.788709270274.issue35142@psf.upfronthosting.co.za> New submission from Daniel Lovell : html.entities.html5 keys should either require a trailing semicolon. The Python docs say: html.entities.html5 "A dictionary that maps HTML5 named character references [1] to the equivalent Unicode character(s), e.g. html5['gt;'] == '>'. Note that the trailing semicolon is included in the name (e.g. 'gt;'), however some of the names are accepted by the standard even without the semicolon: in this case the name is present with and without the ';'. See also html.unescape()." https://docs.python.org/3/library/html.entities.html?highlight=html However, it is not clear without looking at the source which keys require the semicolon and which do not. Taking a look at the source, the number which require a trailing semicolon vastly outnumber the others. For simplicity and continuity with the w3.org standard HTML5 Character Entity Reference Chart - I recommend that the trailing semicolon be required. As they are in HTML5: https://dev.w3.org/html5/html-author/charref My recommendation could then be extrapolated to say we should require the ampersand as HTML5 does, but I don't think this revision should be taken this far unless others agree. ---------- components: Library (Lib) messages: 329105 nosy: daniellovell priority: normal severity: normal status: open title: html.entities.html5 should require a trailing semicolon type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 01:46:53 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 05:46:53 +0000 Subject: [issue35141] encoding problem: gbk In-Reply-To: <1541126053.67.0.788709270274.issue35141@psf.upfronthosting.co.za> Message-ID: <1541137613.03.0.788709270274.issue35141@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: @anmikf Please use one issue for all the details. I am closing this as a duplicate of issue35140 since it has the same reproducer script and details. Feel free to reopen this if it's a different one adding little more context on the difference. Thanks! ---------- nosy: +xtreak resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> encoding problem: gbk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 01:55:56 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 05:55:56 +0000 Subject: [issue35142] html.entities.html5 should require a trailing semicolon In-Reply-To: <1541135025.26.0.788709270274.issue35142@psf.upfronthosting.co.za> Message-ID: <1541138156.48.0.788709270274.issue35142@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +ezio.melotti, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:03:03 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 02 Nov 2018 06:03:03 +0000 Subject: [issue35075] Doc: pprint example uses dead URL In-Reply-To: <1540539643.28.0.788709270274.issue35075@psf.upfronthosting.co.za> Message-ID: <1541138583.02.0.788709270274.issue35075@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:25:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 06:25:46 +0000 Subject: [issue35142] html.entities.html5 should require a trailing semicolon In-Reply-To: <1541135025.26.0.788709270274.issue35142@psf.upfronthosting.co.za> Message-ID: <1541139946.23.0.788709270274.issue35142@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The documentation clearly says that this is for intention and give a reference to the HTML5 specification. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:34:05 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 06:34:05 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541140445.09.0.788709270274.issue35140@psf.upfronthosting.co.za> Windson Yang added the comment: If I understand your question correctly, you should save the file(the one contain Chinese chars) with GBK encoding using your editor. Otherwise, your editor would save it using the default encoding which led to python can't decode it correctly. ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:39:13 2018 From: report at bugs.python.org (Daniel Lovell) Date: Fri, 02 Nov 2018 06:39:13 +0000 Subject: [issue35142] html.entities.html5 should require a trailing semicolon In-Reply-To: <1541135025.26.0.788709270274.issue35142@psf.upfronthosting.co.za> Message-ID: <1541140753.36.0.788709270274.issue35142@psf.upfronthosting.co.za> Daniel Lovell added the comment: Ah, I stupidly overlooked that as I'm only familiar with this HTML5 specification: https://html.spec.whatwg.org/multipage/syntax.html#character-references Where it states that characters MUST be terminated with a semicolon. Honestly never seen it done otherwise. ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:40:39 2018 From: report at bugs.python.org (Daniel Lovell) Date: Fri, 02 Nov 2018 06:40:39 +0000 Subject: [issue35142] html.entities.html5 should require a trailing semicolon In-Reply-To: <1541135025.26.0.788709270274.issue35142@psf.upfronthosting.co.za> Message-ID: <1541140839.04.0.788709270274.issue35142@psf.upfronthosting.co.za> Daniel Lovell added the comment: I'm setting this back to closed as I unintentionally reopened. Please forgive me as I'm new to the Python BPO. However, I did mean to continue the conversation if not reopen the issue. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 02:55:14 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 06:55:14 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541141714.72.0.788709270274.issue33000@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Roger, John may have run IDLE rather than IDLEX. This issue is about documenting the fact that tk Texts do not throw away lines, and will accept text until there are memory problems. (Command Prompt, for instance, only keeps the last N lines, where N defaults to 300 (not enough to see a test suite run) and is max 9999.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 03:53:07 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 07:53:07 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541145187.12.0.788709270274.issue35113@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think parsing with regex especially on multiline cases like here is little tricky handling all cases. I find AST module to be a good fit. I tried using a callback where every class definition is taken up and then from that line to rest of the program getblock can be used to get the relevant class definition. This takes care of the cases I have listed and returns the correct source where we can filter out the class we need. Hence findsource can be modified to use ast instead of regex given that regex was introduced in 2006 and changing class syntax in future might need updating this regex. A sample program I tried but this is the first time I am using ast module and there might be better ways to filter the required classes. I will try raising a PR after some discussion to see if any better solution exists and more tests. # foo_ast.py import ast import inspect class MyClassVisitor(ast.NodeVisitor): def __init__(self, lines, *args, **kwargs): self.lines = lines super().__init__(*args, **kwargs) def visit_ClassDef(self, node): print('Found class "%s"' % node.name) print("Source") print(''.join(inspect.getblock(self.lines[node.lineno-1:]))) with open('../backups/bpo35101_1.py') as f: source = f.read() lines = source.splitlines(True) tree = ast.parse(source) MyClassVisitor(lines).visit(tree) $ ./python.exe ../backups/foo_ast.py Found class "Bar" Source class Bar: a = """ class MultilineStringVariable: ... """ Found class "MultilineStringVariable" Source class MultilineStringVariable: def foo(self): pass Found class "MultilineStringComment" Source class MultilineStringComment: def foo(self): pass Found class "NestedClass" Source class NestedClass: a = ''' class Spam: ... ''' Found class "Nested" Source class Nested: class Spam: pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 04:07:52 2018 From: report at bugs.python.org (Ma Lin) Date: Fri, 02 Nov 2018 08:07:52 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541146072.04.0.788709270274.issue35140@psf.upfronthosting.co.za> Ma Lin added the comment: Let me give an explanation. Run encoding_problem_gbk.py, get an error: D:\>encoding_problem_gbk.py File "D:\encoding_problem_gbk.py", line 1 SyntaxError: encoding problem: gbk If remove the comment line, run as expected. ---------- nosy: +Ma Lin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 04:28:53 2018 From: report at bugs.python.org (Kay Hayen) Date: Fri, 02 Nov 2018 08:28:53 +0000 Subject: [issue35143] Annotations future requires unparse, but not accessible from Pythpn Message-ID: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> New submission from Kay Hayen : Hello, in trying to know what to put into "__annotations__" at run time, the "from __future__ import annotations" pose a new problem. It is now necessary to "unparse" to ast code that is still there. Code to do so, is in C API "_PyAST_ExprAsUnicode", but won't work with the Python level ast objects. I have a kludge, using "compile" and "exec", to get past that. It's pretty ugly to do it like this, and Nuitka cannot be alone in trying to predict the value of "__annotations__". This code is my "ast.unparse" replacement: def unparse(node): _host_node = ast.parse("x:1") _host_node.body[0].annotation = node r = compile(_host_node, "", "exec", 1048576, dont_inherit = True) # Using exec here, to compile the ast node tree back to string, # there is no accessible "ast.unparse", and this works as a hack # to convert our node to a string annotation, pylint: disable=exec-used m = {} exec(r, m) return m["__annotations__"]['x'] I am caching "_host_node" in the real code. Having a real "ast.unparse" would be better however. It seems that the building blocks are all there, just not in that form. Yours, Kay ---------- messages: 329114 nosy: kayhayen priority: normal severity: normal status: open title: Annotations future requires unparse, but not accessible from Pythpn type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 04:39:30 2018 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Nov 2018 08:39:30 +0000 Subject: [issue25416] Add encoding aliases from the (HTML5) Encoding Standard In-Reply-To: <1444932787.73.0.313042926579.issue25416@psf.upfronthosting.co.za> Message-ID: <1541147970.42.0.788709270274.issue25416@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Please note that we can only add aliases if the encodings are indeed the same. Given that WhatWG has made changes to several standard encodings, this is especially important, since our codecs are mostly based on what the Unicode consortium defines as these encodings. Tests for aliases can be minimal: just verify that the codecs subsystem detects them and results in the correct codec being used. There's no need to download any WhatWG specs for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 04:40:08 2018 From: report at bugs.python.org (lilydjwg) Date: Fri, 02 Nov 2018 08:40:08 +0000 Subject: [issue35144] TemporaryDirectory can't be cleaned up if there are unsearchable directories Message-ID: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> New submission from lilydjwg : If the title doesn't explain clearly, here's a demo program that will fail: import tempfile import pathlib def test(): with tempfile.TemporaryDirectory(prefix='test-bad-') as tmpdir: tmpdir = pathlib.Path(tmpdir) subdir = tmpdir / 'sub' subdir.mkdir() with open(subdir / 'file', 'w'): pass subdir.chmod(0o600) if __name__ == '__main__': test() I didn't expect this, and I didn't find an easy way to handle this except not using TemporaryDirectory at all: import tempfile import pathlib import shutil import os def rmtree_error(func, path, excinfo): if isinstance(excinfo[1], PermissionError): os.chmod(os.path.dirname(path), 0o700) os.unlink(path) print(func, path, excinfo) def test(): tmpdir = tempfile.mkdtemp(prefix='test-good-') try: tmpdir = pathlib.Path(tmpdir) subdir = tmpdir / 'sub' subdir.mkdir() with open(subdir / 'file', 'w'): pass subdir.chmod(0o600) finally: shutil.rmtree(tmpdir, onerror=rmtree_error) if __name__ == '__main__': test() This works around the issue, but the dirfd is missing in the onerror callback. I have this issue because my program extracts tarballs to a temporary directory for examination. I expected that TemporaryDirectory cleaned up things when it could. What do you think? rm -rf can't remove such a directory either but this is annoying and I think Python can do better. ---------- components: Library (Lib) messages: 329116 nosy: lilydjwg priority: normal severity: normal status: open title: TemporaryDirectory can't be cleaned up if there are unsearchable directories type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 04:40:53 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 08:40:53 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541148053.87.0.788709270274.issue35140@psf.upfronthosting.co.za> Windson Yang added the comment: Thank you, Lin. Can you reproduce on your machine, I guess it is related to terminal encoding or text file ending. However, I can't reproduce on macOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:09:38 2018 From: report at bugs.python.org (Ma Lin) Date: Fri, 02 Nov 2018 09:09:38 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541149778.3.0.788709270274.issue35140@psf.upfronthosting.co.za> Ma Lin added the comment: Yes, I can reproduce on my Windows 10 (Simplfied Chinese). The file is a pure ASCII file, and doesn't have a BOM prefix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:19:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 09:19:24 +0000 Subject: [issue23346] shutil.rmtree doesn't work correctly on FreeBSD. In-Reply-To: <1422507173.88.0.069796427202.issue23346@psf.upfronthosting.co.za> Message-ID: <1541150364.57.0.788709270274.issue23346@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:23:37 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 09:23:37 +0000 Subject: [issue35143] Annotations future requires unparse, but not accessible from Python In-Reply-To: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> Message-ID: <1541150617.45.0.788709270274.issue35143@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- title: Annotations future requires unparse, but not accessible from Pythpn -> Annotations future requires unparse, but not accessible from Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:44:27 2018 From: report at bugs.python.org (=?utf-8?b?5a6J6L+3?=) Date: Fri, 02 Nov 2018 09:44:27 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541151867.03.0.788709270274.issue35140@psf.upfronthosting.co.za> ?? added the comment: this problem not exist on macOS. this problem not exist in python2. Windows10x64 Python 3.7.0 (v3.7.0:1bf9cc5093 script have no problem with 15 blank lines. script have problem with fist line '#coding:gbk' and 14 blank lines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:48:51 2018 From: report at bugs.python.org (=?utf-8?b?5a6J6L+3?=) Date: Fri, 02 Nov 2018 09:48:51 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541152131.06.0.788709270274.issue35140@psf.upfronthosting.co.za> ?? added the comment: I'm sorry for my english. Can I use Chinese? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 05:53:12 2018 From: report at bugs.python.org (Tim Golden) Date: Fri, 02 Nov 2018 09:53:12 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541152392.88.0.788709270274.issue35140@psf.upfronthosting.co.za> Tim Golden added the comment: I'm afraid you'll have to use English in this forum so that all current and future readers have the best chance of understanding the situation. Thank you very much for making the effort this far. If anyone on this issue knows of a Chinese-language forum where this issue could explored before coming back here, please say so. Otherwise I'll ask around on Twitter etc. to see what's available ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 06:46:53 2018 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Nov 2018 10:46:53 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541155613.95.0.788709270274.issue32409@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +9604 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 06:50:28 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 10:50:28 +0000 Subject: [issue35140] encoding problem: gbk Message-ID: <1541155828.2.0.788709270274.issue35140@psf.upfronthosting.co.za> Windson Yang added the comment: It's fine @anmikf, keep practice :D. Let's recap what happened: Run encoding_problem_gbk.py on Windows10 using Python 3.7.0 will cause "SyntaxError: encoding problem: gbk". But it will run as expected if 1. The file has less than less than 15 lines. 2. Change coding:gbk to other encoding (like utf-8) 3. Remove coding:gbk ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 06:52:00 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 10:52:00 +0000 Subject: [issue35140] encoding problem: coding:gbk cause syntaxError Message-ID: <1541155920.76.0.788709270274.issue35140@psf.upfronthosting.co.za> Change by Windson Yang : ---------- title: encoding problem: gbk -> encoding problem: coding:gbk cause syntaxError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 06:55:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 10:55:53 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541156153.81.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: > There are not just two sides. It is common to wrap new stable C API with something like: > #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 > What will you do with this? objimpl.h always includes pycapi/pycapi_objimpl.h, so I don't think that we need a strong rules. I propose to always add move code using "#if ... Py_LIMITED_API" to the pycapi/ subdirectory, even if it uses "#if !defined(Py_LIMITED_API)". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:09:53 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 02 Nov 2018 11:09:53 +0000 Subject: [issue6717] Some problem with recursion handling In-Reply-To: <1250518561.04.0.421053701967.issue6717@psf.upfronthosting.co.za> Message-ID: <1541156993.15.0.788709270274.issue6717@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:18:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 11:18:38 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541157518.88.0.788709270274.issue35134@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you want to keep only stable ABI v.3.2 and move both newer stable API and non-stable API to the pycapi/ subdirectory? Sorry, I don't found a sense in this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:19:05 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 11:19:05 +0000 Subject: [issue35144] TemporaryDirectory can't be cleaned up if there are unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541157545.52.0.788709270274.issue35144@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:22:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 11:22:12 +0000 Subject: [issue35143] Annotations future requires unparse, but not accessible from Python In-Reply-To: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> Message-ID: <1541157732.83.0.788709270274.issue35143@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Extension Modules nosy: +lukasz.langa versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:25:06 2018 From: report at bugs.python.org (Dave Shawley) Date: Fri, 02 Nov 2018 11:25:06 +0000 Subject: [issue32971] Docs on unittest.TestCase.assertRaises() should clarify context manager details In-Reply-To: <1519840682.18.0.467229070634.issue32971@psf.upfronthosting.co.za> Message-ID: <1541157906.29.0.788709270274.issue32971@psf.upfronthosting.co.za> Change by Dave Shawley : ---------- keywords: +patch pull_requests: +9605 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:26:43 2018 From: report at bugs.python.org (Dave Shawley) Date: Fri, 02 Nov 2018 11:26:43 +0000 Subject: [issue32972] unittest.TestCase coroutine support In-Reply-To: <1519843317.02.0.467229070634.issue32972@psf.upfronthosting.co.za> Message-ID: <1541158003.81.0.788709270274.issue32972@psf.upfronthosting.co.za> Dave Shawley added the comment: I added a different implementation for consideration (https://github.com/python/cpython/pull/10296). ---------- pull_requests: +9606 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:38:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 11:38:21 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541158701.85.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: > Do you want to keep only stable ABI v.3.2 and move both newer stable API and non-stable API to the pycapi/ subdirectory? Sorry, I don't found a sense in this. The raw definition could be that Include/*.h is part of the stable ABI, and Include/pycapi/*.h are the definitions using Py_LIMITED_API and so can be stable or not stable depending on Py_LIMITED_API value :-) To be honest, I'm not sure that I understand how "Py_LIMITED_API+0 >= 0x03050000" works and should be used. I understand that you would prefer to leave PyObject_Calloc() in Include/objimpl.h. Honestly, I have no strong opinion on that. We can leave it there if you prefer. -- Maybe the rule "move everything using Py_LIMITED_API to pycapi" is misleading. My intent is that API in Include/*.h should not leak implementation details. It should be the starting point to design a new C API which does not leak any implementation detail: http://pythoncapi.readthedocs.io/ It's easier with an example: #define _PyObject_GC_TRACK(o) do { \ PyGC_Head *g = _Py_AS_GC(o); \ if (g->_gc_next != 0) { \ Py_FatalError("GC object already tracked"); \ } \ assert((g->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0); \ ... This macro is private: it starts with "_Py", so it doesn't belong to Include/*.h. Moreover, it access private fields like PyGC_Head._gc_prev. >From my point of view, the ideal API would not access *any* structure field and PyGC_Header structure must not be used nor part of the C API. -- After saying that, I looked again at my PR, and I still see private functions in objimpl.h. Example: PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); #define PyObject_New(type, typeobj) \ ( (type *) _PyObject_New(typeobj) ) #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) These functions are not excluded from Py_LIMITED_API. Since they are private, we are free to remove them whenever we want, so IMHO it's fine to exclude from Py_LIMITED_API right now if we want. Another example: static inline PyObject* PyObject_INIT(PyObject *op, PyTypeObject *typeobj) { assert(op != NULL); Py_TYPE(op) = typeobj; _Py_NewReference(op); return op; } It's a public function but it calls the private function _Py_NewReference(). So _Py_NewReference() must be part of Py_LIMITED_API somehow... In release mode (if Py_TRACE_REFS is not defined), _Py_NewReference() is defined like that: /* Without Py_TRACE_REFS, there's little enough to do that we expand code inline. */ static inline void _Py_NewReference(PyObject *op) { if (_Py_tracemalloc_config.tracing) { _PyTraceMalloc_NewReference(op); } _Py_INC_TPALLOCS(op); _Py_INC_REFTOTAL; Py_REFCNT(op) = 1; } It does access to the private _Py_tracemalloc_config variable and private macros/functions _Py_INC_TPALLOCS(op) and _Py_INC_REFTOTAL. We *can* always define _Py_NewReference() as a function call if Py_LIMITED_API is defined, but it would have an impact on performance. Right now, I don't want to risk to introduce a performance slowdown. I have a "Proof-of-concept" implementation of my proposed "new C API": https://github.com/pythoncapi/cpython/ My implementation currently uses 3 defines: * Py_NEWCAPI_NO_MACRO: replace macros with function calls PyTuple_GET_SIZE() becomes PyTuple_Size() * Py_NEWCAPI_NO_STRUCT: must not use PyObject.ob_refcnt or any other field of Python object structures; structures should hide their fields: compilation error. * Py_NEWCAPI: new C API without borrowed references, without macro, without struct But this project is highly experimental and I don't want to make it upstream before we measured properly the impact on the performance, the API has been properly reviewed and discussed, and the overall project has been approved by core developers. For example, by writing a PEP :-) -- In short, I'm not sure of what can or should be done right now for Include/pycapi/ :-) I wrote the PR to open the discussion :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 07:41:10 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Nov 2018 11:41:10 +0000 Subject: [issue35144] TemporaryDirectory can't be cleaned up if there are unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541158870.14.0.788709270274.issue35144@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Seems like a related issue : issue26660 . Maybe TemporaryDirectory can allow an onerror argument that is passed internally to rmtree during cleanup and state the same in the documentation that TemporaryDirectory can't cleanup read-only files? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 08:16:24 2018 From: report at bugs.python.org (Robert Pollak) Date: Fri, 02 Nov 2018 12:16:24 +0000 Subject: [issue35145] sqlite3: "select *" should autoconvert datetime fields Message-ID: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> New submission from Robert Pollak : Currently, fields are converted to datetime as described in https://docs.python.org/3/library/sqlite3.html#sqlite3.PARSE_COLNAMES : 'select x as "x [datetime]" from table' In my use case I don't know the names and locations of the datetime fields in advance. So I would need to do pandas.read_sql_query('select * from table', con) and get correct datetime columns. (My current workaround is try calling pandas.to_datetime on each text column afterwards.) The type info has to be available in the sqlite database, because I see that SQLiteStudio correctly detects the datetime columns. ---------- components: Library (Lib) messages: 329128 nosy: jondo priority: normal severity: normal status: open title: sqlite3: "select *" should autoconvert datetime fields type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 08:23:57 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 12:23:57 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541161437.3.0.788709270274.issue26660@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 08:24:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 12:24:05 +0000 Subject: [issue35144] TemporaryDirectory can't be cleaned up if there are unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541161445.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 08:25:14 2018 From: report at bugs.python.org (Robert Pollak) Date: Fri, 02 Nov 2018 12:25:14 +0000 Subject: [issue35145] sqlite3: "select *" should autoconvert datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541161514.62.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: (In fact, I am currently taking the first non-missing entry of each text column and trying to dateutil.parser.parse it. If that works, I use pandas.to_datetime on the column.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 08:25:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 12:25:40 +0000 Subject: [issue35145] sqlite3: "select *" should autoconvert datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541161540.89.0.788709270274.issue35145@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +berker.peksag, ghaering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 09:43:06 2018 From: report at bugs.python.org (Dan Boxall) Date: Fri, 02 Nov 2018 13:43:06 +0000 Subject: [issue35146] Bad Regular Expression Broke re.findall() Message-ID: <1541166186.22.0.788709270274.issue35146@psf.upfronthosting.co.za> New submission from Dan Boxall : Hi, I'm new to regular expressions and while playing around with them I tried this: >>> rex = '*New Revision:.* ([0-9]+)' >>> re.findall(rex, text) and got this: Traceback (most recent call last): File "", line 1, in File "C:\Python\Python37\lib\re.py", line 223, in findall return _compile(pattern, flags).findall(string) File "C:\Python\Python37\lib\re.py", line 286, in _compile p = sre_compile.compile(pattern, flags) File "C:\Python\Python37\lib\sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) File "C:\Python\Python37\lib\sre_parse.py", line 930, in parse p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0) File "C:\Python\Python37\lib\sre_parse.py", line 426, in _parse_sub not nested and not items)) File "C:\Python\Python37\lib\sre_parse.py", line 651, in _parse source.tell() - here + len(this)) re.error: nothing to repeat at position 0 ---------- components: Regular Expressions messages: 329130 nosy: Callipygean, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Bad Regular Expression Broke re.findall() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 09:56:20 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 02 Nov 2018 13:56:20 +0000 Subject: [issue35146] Bad Regular Expression Broke re.findall() In-Reply-To: <1541166186.22.0.788709270274.issue35146@psf.upfronthosting.co.za> Message-ID: <1541166980.05.0.788709270274.issue35146@psf.upfronthosting.co.za> Windson Yang added the comment: The last line "re.error: nothing to repeat at position 0" shows that you should not put raw * as the first element, use \* instead. ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 09:59:25 2018 From: report at bugs.python.org (Dan Boxall) Date: Fri, 02 Nov 2018 13:59:25 +0000 Subject: [issue35146] Bad Regular Expression Broke re.findall() In-Reply-To: <1541166980.05.0.788709270274.issue35146@psf.upfronthosting.co.za> Message-ID: Dan Boxall added the comment: Thank you. I realised that and if I put a dot in front it worked fine. But it should not break the function, so they will surely want to fix the bug? Kind regards, Dan Boxall On Fri, 2 Nov 2018 at 13:56, Windson Yang wrote: > > Windson Yang added the comment: > > The last line "re.error: nothing to repeat at position 0" shows that you > should not put raw * as the first element, use \* instead. > > ---------- > nosy: +Windson Yang > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 10:21:39 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 02 Nov 2018 14:21:39 +0000 Subject: [issue35146] Bad Regular Expression Broke re.findall() In-Reply-To: <1541166186.22.0.788709270274.issue35146@psf.upfronthosting.co.za> Message-ID: <1541168499.13.0.788709270274.issue35146@psf.upfronthosting.co.za> Steven D'Aprano added the comment: This is not a bug in Python, it is an invalid (broken) regular expression. There is nothing that the interpreter or the regular expression engine can do, because you are telling it to do something that makes no sense. What do you expect findall to find, if you ask it to find something nonsensical? You say: "repeat this pattern any number of times" but there is no "this pattern" to be repeated. You are asking for something impossible. The only legitimate response is to report back that the regular expression is invalid and cannot be compiled, and fail immediately. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 11:20:26 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 15:20:26 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541172026.07.0.788709270274.issue29341@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: New changeset b942707fc23454a998323c17e30be78ff1a4f0e7 by Pablo Galindo (BNMetrics) in branch 'master': bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101) https://github.com/python/cpython/commit/b942707fc23454a998323c17e30be78ff1a4f0e7 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 11:24:59 2018 From: report at bugs.python.org (Dan Boxall) Date: Fri, 02 Nov 2018 15:24:59 +0000 Subject: [issue35146] Bad Regular Expression Broke re.findall() In-Reply-To: <1541168499.13.0.788709270274.issue35146@psf.upfronthosting.co.za> Message-ID: Dan Boxall added the comment: Yes I realised that, as I said earlier. But it could say, "Invalid regular expression" and not produce ten lines of error messages. On Fri, 2 Nov 2018 at 14:21, Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > > This is not a bug in Python, it is an invalid (broken) regular expression. > There is nothing that the interpreter or the regular expression engine can > do, because you are telling it to do something that makes no sense. What do > you expect findall to find, if you ask it to find something nonsensical? > > You say: > > "repeat this pattern any number of times" > > but there is no "this pattern" to be repeated. You are asking for > something impossible. The only legitimate response is to report back that > the regular expression is invalid and cannot be compiled, and fail > immediately. > > ---------- > nosy: +steven.daprano > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 11:45:12 2018 From: report at bugs.python.org (Luna Chen) Date: Fri, 02 Nov 2018 15:45:12 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541173512.76.0.788709270274.issue29341@psf.upfronthosting.co.za> Change by Luna Chen : ---------- pull_requests: +9607 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 11:58:23 2018 From: report at bugs.python.org (Luna Chen) Date: Fri, 02 Nov 2018 15:58:23 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541174303.54.0.788709270274.issue29341@psf.upfronthosting.co.za> Change by Luna Chen : ---------- pull_requests: +9608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:03:19 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 02 Nov 2018 16:03:19 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC Message-ID: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : Non-existing __GNUC_MAJOR__ macro is used to check for GCC version at https://github.com/python/cpython/blob/b942707fc23454a998323c17e30be78ff1a4f0e7/Include/pyerrors.h#L97 . __GNUC__ should be used instead. ---------- components: Interpreter Core messages: 329136 nosy: benjamin.peterson, berker.peksag, brett.cannon, izbyshev, serhiy.storchaka priority: normal severity: normal status: open title: _Py_NO_RETURN is always empty on GCC type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:05:02 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 02 Nov 2018 16:05:02 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541174702.19.0.788709270274.issue35147@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9609 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:06:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Nov 2018 16:06:21 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541174781.49.0.788709270274.issue35147@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Oh, this is common error! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:08:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 16:08:51 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541174931.7.0.788709270274.issue35147@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh right, the major version is __GNUC__: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:32:30 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Nov 2018 16:32:30 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541176350.94.0.788709270274.issue35147@psf.upfronthosting.co.za> miss-islington added the comment: New changeset e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd by Miss Islington (bot) (Alexey Izbyshev) in branch 'master': bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) https://github.com/python/cpython/commit/e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:39:44 2018 From: report at bugs.python.org (Martin Bijl-Schwab) Date: Fri, 02 Nov 2018 16:39:44 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows Message-ID: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> New submission from Martin Bijl-Schwab : There is a small bug in the activate.bat script causing problems on internationalized Windows systems. C:\repo\gui>python -m venv venv C:\repo\gui>call venv\Scripts\activate.bat Parameterformat falsch - 850. This translates to "Wrong parameter - 850." For the user it is not obvious what went wrong. The virtual environment is setup and will work in most cases. Link to https://bugs.python.org/issue32409. ---------- components: Library (Lib) messages: 329140 nosy: Martin Bijl-Schwab priority: normal pull_requests: 9610 severity: normal status: open title: cannot activate a venv environment on a Swiss German windows type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:41:28 2018 From: report at bugs.python.org (Martin Bijl-Schwab) Date: Fri, 02 Nov 2018 16:41:28 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541176888.31.0.788709270274.issue32409@psf.upfronthosting.co.za> Martin Bijl-Schwab added the comment: it does not work as expected on swiss german (and likely other internationalised) windows systems. See https://bugs.python.org/issue32409 ---------- nosy: +Martin Bijl-Schwab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 12:42:55 2018 From: report at bugs.python.org (Martin Bijl-Schwab) Date: Fri, 02 Nov 2018 16:42:55 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541176975.1.0.788709270274.issue32409@psf.upfronthosting.co.za> Martin Bijl-Schwab added the comment: I meant https://bugs.python.org/issue35148 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:02:12 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Nov 2018 17:02:12 +0000 Subject: [issue35137] Exception in isinstance when __class__ property raises In-Reply-To: <1541090639.85.0.788709270274.issue35137@psf.upfronthosting.co.za> Message-ID: <1541178132.51.0.788709270274.issue35137@psf.upfronthosting.co.za> Brett Cannon added the comment: I'm with Serhiy that exceptions should not be swallowed up unless there's a very good reason to, and in this instance there isn't if there's a bug in code as that low of a level as debugging that would be atrocious. ---------- nosy: +brett.cannon resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:10:10 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 02 Nov 2018 17:10:10 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1541178610.03.0.788709270274.issue35148@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:15:30 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 02 Nov 2018 17:15:30 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541178930.0.0.788709270274.issue35147@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- pull_requests: +9611 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:19:06 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 02 Nov 2018 17:19:06 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541179146.68.0.788709270274.issue35147@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- pull_requests: +9612 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:27:26 2018 From: report at bugs.python.org (Dileep) Date: Fri, 02 Nov 2018 17:27:26 +0000 Subject: [issue35149] pip3 show causing Error for ConfigParaser Message-ID: <1541179646.4.0.788709270274.issue35149@psf.upfronthosting.co.za> New submission from Dileep : I' receiving error while viewing the package info of ConfigParser. The command `pip3 show ConfigParser` doesn't cause any error where as following batch script is resulting this error It has something to do with Autor name or Unicode handling of the Pip3 `for /f "tokens=1,2 delims=:" %a in ('pip3 show ConfigParser') do echo %a : %b` Traceback (most recent call last): File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\logging\__init__.py", line 995, in emit stream.write(msg) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 141, in write self.write_and_convert(text) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 169, in write_and_convert self.write_plain_text(text, cursor, len(text)) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 174, in write_plain_text self.wrapped.write(text[start:end]) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u0141' in position 8: character maps to Call stack: File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts\pip3.exe\__main__.py", line 9, in sys.exit(main()) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_internal\__init__.py", line 78, in main return command.main(cmd_args) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main status = self.run(options, args) File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_internal\commands\show.py", line 47, in run results, list_files=options.files, verbose=options.verbose): File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\pip\_internal\commands\show.py", line 145, in print_results logger.info("Author: %s", dist.get('author', '')) Message: 'Author: %s' Arguments: ('?ukasz Langa',) ---------- messages: 329144 nosy: mdileep priority: normal severity: normal status: open title: pip3 show causing Error for ConfigParaser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:32:52 2018 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Nov 2018 17:32:52 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1541179972.43.0.788709270274.issue35148@psf.upfronthosting.co.za> Vinay Sajip added the comment: So - are you saying that chcp prints "850." when asked for the current code page but won't accept "850." when setting the code page, requiring just "850"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:48:11 2018 From: report at bugs.python.org (Big Stone) Date: Fri, 02 Nov 2018 17:48:11 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541180891.56.0.788709270274.issue33000@psf.upfronthosting.co.za> Big Stone added the comment: for the record, since summer 2018, idlex-1.18 is compatible again with Python-3.6+: the author simply forked the old IDLE library IDLEX was depending on. so IDLEX icon in recent Winpython is"truly" IDLEX again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:55:45 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 17:55:45 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541181345.24.0.788709270274.issue29341@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: New changeset 8d2f88fb17468642813108977bb9ec5f7a065b84 by Pablo Galindo (BNMetrics) in branch '3.6': [3.6]bpo-29341: Backport b942707 3.6 (GH-10299) https://github.com/python/cpython/commit/8d2f88fb17468642813108977bb9ec5f7a065b84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:56:29 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 17:56:29 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541181389.16.0.788709270274.issue29341@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: New changeset 08026b103ea8f4c9f2b5045ef7806dd8b760da2b by Pablo Galindo (BNMetrics) in branch '3.7': [3.7]bpo-29341: Backport b942707 3.7 (#10298) https://github.com/python/cpython/commit/08026b103ea8f4c9f2b5045ef7806dd8b760da2b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:57:30 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 17:57:30 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541181450.64.0.788709270274.issue29341@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: The docstrings are fixed and the m(anual!) backports to 3.7 and 3.6 are done. Very good job, Luna! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:57:52 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 17:57:52 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541181472.63.0.788709270274.issue29341@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg329149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 13:58:00 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Nov 2018 17:58:00 +0000 Subject: [issue29341] Missing accepting path-like object in docstrings of os module functions In-Reply-To: <1485064061.59.0.597221589705.issue29341@psf.upfronthosting.co.za> Message-ID: <1541181480.89.0.788709270274.issue29341@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: The docstrings are fixed and the (manual!) backports to 3.7 and 3.6 are done. Very good job, Luna! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 14:08:52 2018 From: report at bugs.python.org (Robert Henry) Date: Fri, 02 Nov 2018 18:08:52 +0000 Subject: [issue35150] Misc/README.valgrind out-of-date Message-ID: <1541182132.22.0.788709270274.issue35150@psf.upfronthosting.co.za> New submission from Robert Henry : File Misc/README.valgrind is out of date with respect to python3.8. There are important sections of this file that are 15 years old! Example: the README.valgrind refers to "Uncomment Py_USING_MEMORY_DEBUGGER in Objects/obmalloc.c" but there's no such symbol in obmalloc.c (There is in Python/dtoa.c) I have no idea if the valgrind suppression file Misc/valgrind-python.supp is up to date, but it bears examination by an expert. ---------- assignee: docs at python components: Documentation messages: 329151 nosy: docs at python, rrh priority: normal severity: normal status: open title: Misc/README.valgrind out-of-date versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 14:23:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 18:23:58 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541183038.57.0.788709270274.issue35147@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 29abad099535f4bcb1531df93bafbd75b26d6adc by Victor Stinner (Alexey Izbyshev) in branch '3.6': [3.6] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10302) https://github.com/python/cpython/commit/29abad099535f4bcb1531df93bafbd75b26d6adc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 15:29:57 2018 From: report at bugs.python.org (Mayank Asthana) Date: Fri, 02 Nov 2018 19:29:57 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541186997.79.0.788709270274.issue26660@psf.upfronthosting.co.za> Mayank Asthana added the comment: I think it is OK to delete read-only files since they are in a TemporaryDirectory and should be expected to be temporary. A note in the documentation about this behaviour should be sufficient. ---------- nosy: +masthana _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 15:39:31 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 19:39:31 +0000 Subject: [issue34897] distutils test errors when CXX is not set In-Reply-To: <1538684546.1.0.545547206417.issue34897@psf.upfronthosting.co.za> Message-ID: <1541187571.38.0.788709270274.issue34897@psf.upfronthosting.co.za> Tal Einat added the comment: `not cmd` will but true if cmd is None, so it is completely equivalent to `cmd is None or not cmd`. This is a purely stylistic change which doesn't alter the logic. To get a clear understanding of what's going on, I recommend reading the short "Truth Value Testing" section in the docs: https://docs.python.org/library/stdtypes.html#truth-value-testing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 15:39:54 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 19:39:54 +0000 Subject: [issue34897] distutils test errors when CXX is not set In-Reply-To: <1538684546.1.0.545547206417.issue34897@psf.upfronthosting.co.za> Message-ID: <1541187594.23.0.788709270274.issue34897@psf.upfronthosting.co.za> Tal Einat added the comment: `not cmd` will be true if cmd is None, so it is completely equivalent to `cmd is None or not cmd`. This is a purely stylistic change which doesn't alter the logic. To get a clear understanding of what's going on, I recommend reading the short "Truth Value Testing" section in the docs: https://docs.python.org/library/stdtypes.html#truth-value-testing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 15:40:02 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 19:40:02 +0000 Subject: [issue34897] distutils test errors when CXX is not set In-Reply-To: <1538684546.1.0.545547206417.issue34897@psf.upfronthosting.co.za> Message-ID: <1541187602.19.0.788709270274.issue34897@psf.upfronthosting.co.za> Change by Tal Einat : ---------- Removed message: https://bugs.python.org/msg329154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 15:47:33 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 19:47:33 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541188053.71.0.788709270274.issue35104@psf.upfronthosting.co.za> Tal Einat added the comment: I agree with Ned's analysis. The shortcut for macOS should be changed, or simply removed if there's no good candidate for a shortcut. Terry, what do you suggest? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:00:12 2018 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 02 Nov 2018 20:00:12 +0000 Subject: [issue35145] sqlite3: "select *" should autoconvert datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541188812.1.0.788709270274.issue35145@psf.upfronthosting.co.za> Paul Ganssle added the comment: According to the sqlite documentation, there's no fundamental datetime type in sqlite: https://www.sqlite.org/datatype3.html#date_and_time_datatype SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values If you have an arbitrary database whose schema you don't know, I'm not sure it would be possible to automatically determine that it's a datetime, though it appears that Python already provides this functionality by exposing the converters "date" and "timestamp" ( https://docs.python.org/3/library/sqlite3.html#default-adapters-and-converters ) If you don't know the schema you can't be 100% accurate on which columns are datetime, but apparently datetime types that are text will be of the format "YYYY-MM-DD HH:MM:SS.SSS", which is a variant of iso8601, REAL columns will be Julian day numbers and integers will be epoch time. If you assume that all your datetime columns will be TEXT and that any TEXT column that happens to be a valid date of is a datetime column, then you can either use: datetime.strftime(text_column, "%Y-%m-%d %H:%M:%S.%f") Or if you want to be faster and less strict (this will allow several other variations on ISO 8601): datetime.fromisoformat(text_column) I would not recommend using `dateutil.parser.parse`, as the dateutil parser is intended for taking something you know to be a string representing a datetime and getting you a datetime object from it. It is not designed to tell you whether something is or is not a datetime. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:06:22 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 20:06:22 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541189182.13.0.788709270274.issue35104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I routinely use Alt-M to open modules on Windows, so I would want a shortcut on Mac also. I just made a 'Mac-module' custom keyset with Control-Key-M for open-module, and it works. It that acceptable? We do not usually change default keysets, but this amounts to a bugfix in relation to current MacOS. I would add it to the IDLE section of What's New. Ned, is the system use of CMD-M newer than IDLE's (15 years?)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:08:36 2018 From: report at bugs.python.org (Eryk Sun) Date: Fri, 02 Nov 2018 20:08:36 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1541189316.37.0.788709270274.issue35148@psf.upfronthosting.co.za> Eryk Sun added the comment: The Windows command line often has inconsistently localized strings. In this case it's from the ulib.dll utility library. For German, message 0x7692 in "de-DE\ulib.dll.mui" is "Aktive Codepage: %1.\r\n", which has a period after the %1 insert. In the English UI it's "Active code page: %1\r\n", with no period. I commented on the PR that we could work around this by adding "." to the list of token delimiters (delims). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:09:11 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 02 Nov 2018 20:09:11 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541189351.55.0.788709270274.issue35131@psf.upfronthosting.co.za> Change by Ned Deily : ---------- components: +Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:09:24 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 20:09:24 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: <1541189364.27.0.788709270274.issue35084@psf.upfronthosting.co.za> Terry J. Reedy added the comment: TestUser, please re-read and follow Serhiy's request. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:22:01 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 20:22:01 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541190121.62.0.788709270274.issue35105@psf.upfronthosting.co.za> Terry J. Reedy added the comment: It is an implementation detail that some people need to know, and that is very unlikely to change. In the pydev thread, Guido said " My feeling is that limiting it to strings is fine, but checking those strings for resembling identifiers is pointless and wasteful." We occasionally document such things in a 'CPython implementation detail' note. I don't know the proper markup for these. At present, I think the note should be in setattr and **kwargs docs. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:31:10 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 02 Nov 2018 20:31:10 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541190670.58.0.788709270274.issue35104@psf.upfronthosting.co.za> Ned Deily added the comment: > is the system use of CMD-M newer than IDLE's (15 years?)? macOS has been using CMD-M for minimize for quite a while. It's listed in the current Apple "Human Interface Guidelines" which is the reference document that Apple itself and third-parties are strongly encouraged to follow (sort of the PEP 8 for macOS UIs). It's probably a good idea for anyone working on the IDLE UI to read through the macOS section at least once. Note that they discourage the use of the Control key as a modifier and they also encourage the use of the Shift key as a secondary modifier "when a shortcut complements another shortcut". Following those suggestions, perhaps a better choice for "Open Module" would be Shift-Command-O (complementing "Open File" Command-O), if it isn't already being used by IDLE. https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/keyboard/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:32:05 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 20:32:05 +0000 Subject: [issue35144] TemporaryDirectory clean-up fails with unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541190725.91.0.788709270274.issue35144@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- title: TemporaryDirectory can't be cleaned up if there are unsearchable directories -> TemporaryDirectory clean-up fails with unsearchable directories _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:44:28 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 20:44:28 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541191468.4.0.788709270274.issue35104@psf.upfronthosting.co.za> Tal Einat added the comment: Indeed Command-M has been in use for a while. +1 for Shift-Command-o. I don't see it used in the default key config (Lib/idlelib/config-keys.def). We already use Shift-Command-s for "Save As...", so this would be a consistent use of a Shift-Command modifier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:45:46 2018 From: report at bugs.python.org (TestUser) Date: Fri, 02 Nov 2018 20:45:46 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1541189364.27.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: TestUser added the comment: One of the problems reporting is the archaic way the bug trackers work. Sorry fo the confusion except I am not sure of the exact request. On my end I have provided what I can. You are welcome to fire up a VM and run the sample submitted. All the best. On Fri, Nov 2, 2018, 4:09 PM Terry J. Reedy > Terry J. Reedy added the comment: > > TestUser, please re-read and follow Serhiy's request. > > ---------- > nosy: +terry.reedy > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:47:20 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Nov 2018 20:47:20 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541191640.08.0.788709270274.issue35104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I like the idea, but for me, Shift-Command-o does the same as Command-o -- open file, and setting open-module to shift-command-key-o does not override this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:48:59 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Nov 2018 20:48:59 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541191739.28.0.788709270274.issue35104@psf.upfronthosting.co.za> Tal Einat added the comment: Terry, does Shift-Command-s trigger "Save" or "Save As" for you? If "Save As", then surely this is something that can be worked out? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 16:50:19 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 02 Nov 2018 20:50:19 +0000 Subject: [issue35143] Annotations future requires unparse, but not accessible from Python In-Reply-To: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> Message-ID: <1541191819.21.0.788709270274.issue35143@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 18:15:45 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 02 Nov 2018 22:15:45 +0000 Subject: [issue35150] Misc/README.valgrind out-of-date In-Reply-To: <1541182132.22.0.788709270274.issue35150@psf.upfronthosting.co.za> Message-ID: <1541196945.77.0.788709270274.issue35150@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thank you for the report. Closing as a duplicate of issue32666. ---------- nosy: +cheryl.sabella resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Valgrind documentation seems to need updating _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 18:31:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 22:31:51 +0000 Subject: [issue32666] Valgrind documentation seems to need updating In-Reply-To: <1516886985.24.0.467229070634.issue32666@psf.upfronthosting.co.za> Message-ID: <1541197911.17.0.788709270274.issue32666@psf.upfronthosting.co.za> STINNER Victor added the comment: You may want to use PYTHONMALLOC=malloc environment variable, which changes the memory allocator from Python pymalloc to the regular libc malloc(). Valgrind false alarms come from pymalloc. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 18:51:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Nov 2018 22:51:57 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541199117.32.0.788709270274.issue35105@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't know the proper markup for these. It's ".. impl-detail::". See for example: https://docs.python.org/dev/library/codecs.html#standard-encodings ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 19:08:33 2018 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 02 Nov 2018 23:08:33 +0000 Subject: [issue34547] Wsgiref server does not handle closed connections gracefully In-Reply-To: <1535624235.67.0.56676864532.issue34547@psf.upfronthosting.co.za> Message-ID: <1541200113.1.0.788709270274.issue34547@psf.upfronthosting.co.za> Chris Jerdonek added the comment: Closing this as a duplicate. Please carry over to issue 27682 any PR's that are still current. ---------- nosy: +chris.jerdonek resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> wsgiref: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 19:15:06 2018 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 02 Nov 2018 23:15:06 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1541200506.16.0.788709270274.issue27682@psf.upfronthosting.co.za> Change by Chris Jerdonek : ---------- stage: -> test needed title: wsgiref: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine -> wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error type: -> behavior versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 19:21:23 2018 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 02 Nov 2018 23:21:23 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1541200883.21.0.788709270274.issue27682@psf.upfronthosting.co.za> Chris Jerdonek added the comment: This seems like a bug in wsgiref.BaseHandler to me. BaseHandler.run() calls handle_error() if an error occurs inside finish_response(): https://github.com/python/cpython/blob/e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd/Lib/wsgiref/handlers.py#L141 However, finish_response() calls close() in its finally block: https://github.com/python/cpython/blob/e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd/Lib/wsgiref/handlers.py#L177-L183 ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 19:40:16 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 02 Nov 2018 23:40:16 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541202016.2.0.788709270274.issue35131@psf.upfronthosting.co.za> Steve Dower added the comment: Can you save your file in gbk encoding? That will be an immediate fix. I don't know that we can/should change the encoding we read without checking with everyone who writes out .pth files. (+Jason as a start here, but I suspect there are more tools that write them.) We could add a handler for UnicodeDecodeError that falls back on utf-8? I think that's reasonable. ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 19:40:58 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 02 Nov 2018 23:40:58 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541202058.8.0.788709270274.issue35131@psf.upfronthosting.co.za> Steve Dower added the comment: I'll mark this easy as well, since adding that handler is straightforward. Unless someone knows a reason we shouldn't do that either. ---------- keywords: +easy versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 20:20:18 2018 From: report at bugs.python.org (Joshua Honeycutt) Date: Sat, 03 Nov 2018 00:20:18 +0000 Subject: [issue35151] Python 2 xml.etree.ElementTree documentation tutorial uses undocumented arguments Message-ID: <1541204418.39.0.788709270274.issue35151@psf.upfronthosting.co.za> New submission from Joshua Honeycutt : In python 2 documentation 19.7.1.6 (https://docs.python.org/2/library/xml.etree.elementtree.html#parsing-xml-with-namespaces) a second argument (ns) is passed to find and findall. However 19.7.3.2 (https://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.find) only specifies the single match argument. If we compare the python 3 documentation the namespaces argument is included in the find method. (https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.find) Maybe the tutorial was created for python 3 version? I assume the function arguments are automatically generated, but I have not tested or tried these functions in python 2. I just stumbled on the docs while working with python 3. ---------- assignee: docs at python components: Documentation messages: 329174 nosy: docs at python, epakai priority: normal severity: normal status: open title: Python 2 xml.etree.ElementTree documentation tutorial uses undocumented arguments versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 21:30:16 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Nov 2018 01:30:16 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541208616.51.0.788709270274.issue35147@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a9122d183b1fbc4484d72aec69fc0979c7fd91f2 by Miss Islington (bot) (Alexey Izbyshev) in branch '3.7': [3.7] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10301) https://github.com/python/cpython/commit/a9122d183b1fbc4484d72aec69fc0979c7fd91f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 22:12:48 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 03 Nov 2018 02:12:48 +0000 Subject: [issue35121] Cookie domain check returns incorrect results In-Reply-To: <1540968768.96.0.788709270274.issue35121@psf.upfronthosting.co.za> Message-ID: <1541211168.18.0.788709270274.issue35121@psf.upfronthosting.co.za> Windson Yang added the comment: I wonder https://github.com/python/cpython/blob/master/Lib/test/test_http_cookiejar.py#L420 ("http://foo.bar.com/", "com", True), ("http://foo.com/", "com", True), are expected behavior? ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 22:37:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Nov 2018 02:37:31 +0000 Subject: [issue35147] _Py_NO_RETURN is always empty on GCC In-Reply-To: <1541174599.42.0.788709270274.issue35147@psf.upfronthosting.co.za> Message-ID: <1541212651.39.0.788709270274.issue35147@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Alexey Izbyshev! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 2 23:47:09 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 03 Nov 2018 03:47:09 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541216829.69.0.788709270274.issue35131@psf.upfronthosting.co.za> Windson Yang added the comment: Hello, Valentin Zhao, do you have time to fix it? Or I can create a PR ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 00:02:30 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 04:02:30 +0000 Subject: [issue35121] Cookie domain check returns incorrect results In-Reply-To: <1540968768.96.0.788709270274.issue35121@psf.upfronthosting.co.za> Message-ID: <1541217750.06.0.788709270274.issue35121@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Good catch Windson! I overlooked the tests. There is also a comment that it's liberal in the test function. Since the code was added in 2006 I don't if it's ok broken to fix this or not. I will let the reviewers take a call then. There is also domain_match and user_domain_match that perform more tests. > This is only a rough check for performance reasons, so it's not too critical as long as it's sufficiently liberal. Thanks for your input! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 01:59:12 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 05:59:12 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541224752.49.0.788709270274.issue35113@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I tried ast module and it passes my test cases but I found another case since object.__name__ returns unqualified name thus matching against nested class names might conflict with the ones on the top level. Example is below where there is Spam at the module level and NestedA.Spam which is defined inside another class. getsource(NestedA.Spam) returns the source for Spam which is also unexpected. It seems ast module also doesn't call visit_ClassDef on nested class definitions thus my approach also couldn't detect NestedA.Spam and returns source for Spam. I wish class objects also had some kind of code attribute similar to functions so that line number is attached. I don't know the internals so I might be wrong here. I am adding Yury. import inspect class Egg: def func(self): pass class NestedA: class Egg: pass print(inspect.getsource(NestedA.Egg)) print(inspect.getsource(Egg)) # Output class Egg: def func(self): pass class Egg: def func(self): pass ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:08:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 06:08:15 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541225295.2.0.788709270274.issue35113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Use __qualname__. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:25:03 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 06:25:03 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541226303.71.0.788709270274.issue35113@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks Serhiy, object.__qualname__ can be used to get qualified name of the object but ast nodes don't have qualified name for the node where I can match against it. node.name returns unqualified name and hence using ast module I can't differentiate between Spam and NestedA.Spam since both return 'Spam' for node.name . I am also using a recursive decorator found at https://stackoverflow.com/a/14661325/2610955 which solves problem iterating through nested classes. But for matching module level class object and nested class level object when I parse a syntax tree for Spam and NestedA.Spam both nodes for class definition return 'Spam'. Is there a way to get qualified names in ast module or do I need to store it somewhere? My current approach for inspect.findsource is as below : class ClassVisitor(ast.NodeVisitor): def recursive(func): """ decorator to make visitor work recursive """ def wrapper(self, node): func(self, node) for child in ast.iter_child_nodes(node): self.visit(child) return wrapper def __init__(self, source, name, *args, **kwargs): self.source = source self.line_number = None self.name = name super().__init__(*args, **kwargs) @recursive def visit_ClassDef(self, node): # Need to match qualified name to differentiate between Spam and NestedA.Spam if node.name == self.name: # decrement by one since lines list starts with indexing by zero self.line_number = node.lineno - 1 name = object.__name__ # can use object.__qualname__ but node.name is not qualified source = ''.join(lines) tree = ast.parse(source) class_visitor = ClassVisitor(source, name) class_visitor.visit(tree) if class_visitor.line_number is not None: return lines, class_visitor.line_number else: raise OSError('could not find class definition') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:50:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 06:50:18 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541227818.85.0.788709270274.issue35113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Use a stack of names. Every time when you enter a class and function nodes, push the current name on the stack, and pop it out after handling child nodes. Compare the qualified name with '.'.join(self.stack). Don't use the recursive decorator, it is not suitable for this, because you need to execute some code before and after handling child nodes. Just add a loop for child nodes in your handler. Yet one thing that you should take to account: decorators. In you should return the line number of the first decorator if they are used. This is easy. This is an interesting issue. I would take it if you do not already working on it. But I think it should be interesting and useful to you. Good practice. Once you get some working code, create a PR. I will suggest next steps. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:50:33 2018 From: report at bugs.python.org (lilydjwg) Date: Sat, 03 Nov 2018 06:50:33 +0000 Subject: [issue35144] TemporaryDirectory clean-up fails with unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541227833.88.0.788709270274.issue35144@psf.upfronthosting.co.za> lilydjwg added the comment: Yes issue26660 is similar but not the same. On Windows it seems a read-only file cannot be deleted while on Linux a file resident in a non-searchable directory cannot be deleted. An onerror for TemporaryDirectory will work. Also I'd like to add an optional dir_fd argument for onerror. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:52:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 06:52:53 +0000 Subject: [issue35144] TemporaryDirectory clean-up fails with unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541227973.97.0.788709270274.issue35144@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am working on this. Left to test on Windows and analyze possible security issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 02:54:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 06:54:27 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541228067.0.0.788709270274.issue26660@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am working on this. Left to test on Windows and analyze possible security issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 03:00:45 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 07:00:45 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541228445.16.0.788709270274.issue35113@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks Serhiy, I am going with the same approach too using a Stack. I am working on it and I have fixed the set initial cases I reported with tests. I just stumbled upon the nested definitions and inner classes. I will raise a PR by end of today with my progress so that more cases along with tests can be covered during PR review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 03:07:33 2018 From: report at bugs.python.org (Reuben Thomas) Date: Sat, 03 Nov 2018 07:07:33 +0000 Subject: [issue32666] Valgrind documentation seems to need updating In-Reply-To: <1516886985.24.0.467229070634.issue32666@psf.upfronthosting.co.za> Message-ID: <1541228853.82.0.788709270274.issue32666@psf.upfronthosting.co.za> Reuben Thomas added the comment: Victor, thanks; that's precisely the sort of thing that would make a useful addition to the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 04:00:06 2018 From: report at bugs.python.org (Oleksandr Buchkovskyi) Date: Sat, 03 Nov 2018 08:00:06 +0000 Subject: [issue35152] too small type for struct.pack/unpack in mutliprocessing.Connection Message-ID: <1541232006.36.0.788709270274.issue35152@psf.upfronthosting.co.za> New submission from Oleksandr Buchkovskyi : the problem is reproduced on big multiprocessing.Process output when the size of the output gets bigger than signed int a struct error is raised ``` python3 test.py Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/lib64/python3.5/multiprocessing/pool.py", line 125, in worker put((job, i, result)) File "/usr/lib64/python3.5/multiprocessing/queues.py", line 347, in put self._writer.send_bytes(obj) File "/usr/lib64/python3.5/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib64/python3.5/multiprocessing/connection.py", line 393, in _send_bytes header = struct.pack("!i", n) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.5/multiprocessing/process.py", line 252, in _bootstrap self.run() File "/usr/lib64/python3.5/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.5/multiprocessing/pool.py", line 130, in worker put((job, i, (False, wrapped))) File "/usr/lib64/python3.5/multiprocessing/queues.py", line 347, in put self._writer.send_bytes(obj) File "/usr/lib64/python3.5/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib64/python3.5/multiprocessing/connection.py", line 393, in _send_bytes header = struct.pack("!i", n) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 ``` this error can be fixed by changing types that are used her? for struct.pack/unpack to !Q ---------- components: Library (Lib) files: error_on_bug_multiprocessing_output.py messages: 329189 nosy: ahcub priority: normal severity: normal status: open title: too small type for struct.pack/unpack in mutliprocessing.Connection type: crash versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47903/error_on_bug_multiprocessing_output.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 04:03:28 2018 From: report at bugs.python.org (Oleksandr Buchkovskyi) Date: Sat, 03 Nov 2018 08:03:28 +0000 Subject: [issue35152] too small type for struct.pack/unpack in mutliprocessing.Connection In-Reply-To: <1541232006.36.0.788709270274.issue35152@psf.upfronthosting.co.za> Message-ID: <1541232208.34.0.788709270274.issue35152@psf.upfronthosting.co.za> Change by Oleksandr Buchkovskyi : ---------- keywords: +patch pull_requests: +9613 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 04:17:28 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 08:17:28 +0000 Subject: [issue35152] too small type for struct.pack/unpack in mutliprocessing.Connection In-Reply-To: <1541232006.36.0.788709270274.issue35152@psf.upfronthosting.co.za> Message-ID: <1541233048.13.0.788709270274.issue35152@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report and PR. I think these are related issues : issue17560, issue28506 with issue17560 being open one. Correct me if I am wrong here. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 04:21:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 08:21:36 +0000 Subject: [issue35152] too small type for struct.pack/unpack in mutliprocessing.Connection In-Reply-To: <1541232006.36.0.788709270274.issue35152@psf.upfronthosting.co.za> Message-ID: <1541233296.34.0.788709270274.issue35152@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> problem using multiprocessing with really big objects? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 07:26:11 2018 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Krier?=) Date: Sat, 03 Nov 2018 11:26:11 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy Message-ID: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> New submission from C?dric Krier : If we want to support other authentication method than basic, we need to be able to set headers to the request sent. I propose to add an argument headers to ServerProxy which is a list of header tuples that will be put as header. ---------- components: Library (Lib) messages: 329191 nosy: ced priority: normal severity: normal status: open title: Allow to set headers in xmlrpc.client.ServerProxy type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 07:29:05 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 11:29:05 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541244545.23.0.788709270274.issue35113@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +9614 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 07:32:49 2018 From: report at bugs.python.org (Roundup Robot) Date: Sat, 03 Nov 2018 11:32:49 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy In-Reply-To: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> Message-ID: <1541244769.83.0.788709270274.issue35153@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9615 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 07:40:11 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 11:40:11 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy In-Reply-To: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> Message-ID: <1541245211.64.0.788709270274.issue35153@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Do you have an example where we need to have extra headers? but +1 for the feature, I marked this issue for 3.8 ---------- nosy: +matrixise versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 07:58:18 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 11:58:18 +0000 Subject: [issue35032] Remove the videos from faq/Windows In-Reply-To: <1540045855.07.0.788709270274.issue35032@psf.upfronthosting.co.za> Message-ID: <1541246298.23.0.788709270274.issue35032@psf.upfronthosting.co.za> St?phane Wirtel added the comment: I close this issue because all the PR and backports (3.7, 3.6 & 2.7) are merged. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 08:01:45 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 12:01:45 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy In-Reply-To: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> Message-ID: <1541246505.68.0.788709270274.issue35153@psf.upfronthosting.co.za> St?phane Wirtel added the comment: and could you add some tests for this new feature? Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 08:22:28 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 12:22:28 +0000 Subject: [issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings In-Reply-To: <1540888465.31.0.788709270274.issue35109@psf.upfronthosting.co.za> Message-ID: <1541247748.39.0.788709270274.issue35109@psf.upfronthosting.co.za> St?phane Wirtel added the comment: I think we could close this issue because the DeprecationWarnings are not related to Python itself but to the dependencies. We could open an issue about the DeprecationWarnings and the dependency like python-babel (thanks for the issue). @mdk? Can we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 08:23:03 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 12:23:03 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1541247783.78.0.788709270274.issue17305@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- nosy: -matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 08:57:09 2018 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Krier?=) Date: Sat, 03 Nov 2018 12:57:09 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy In-Reply-To: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> Message-ID: <1541249829.89.0.788709270274.issue35153@psf.upfronthosting.co.za> C?dric Krier added the comment: We have a library proteus which uses xmlrpc.client to connect to our server. The server support basic authentication but also session authentication. The session authentication is much faster because the password hash verification is slow by design. So to be able to use our session authentication method with the library, we need to be able to set our own Authorization header to the ServerProxy. It could be done with a custom Transport class but then we will have to do it twice for Transport and SafeTransport and to replicate the code that select the class out of the uri. The proposal started from this discussion: https://bugs.tryton.org/issue7783 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 08:57:37 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 12:57:37 +0000 Subject: [issue27321] Email parser creates a message object that can't be flattened In-Reply-To: <1465930372.53.0.0254623453508.issue27321@psf.upfronthosting.co.za> Message-ID: <1541249857.88.0.788709270274.issue27321@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 09:23:57 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 03 Nov 2018 13:23:57 +0000 Subject: [issue35153] Allow to set headers in xmlrpc.client.ServerProxy In-Reply-To: <1541244371.62.0.788709270274.issue35153@psf.upfronthosting.co.za> Message-ID: <1541251437.98.0.788709270274.issue35153@psf.upfronthosting.co.za> St?phane Wirtel added the comment: ok +1 for me and I understand the need. But there is no defined experts for the xmlrpc part. We have to wait for a review just for the feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 10:05:00 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 03 Nov 2018 14:05:00 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541253900.43.0.788709270274.issue35131@psf.upfronthosting.co.za> Jason R. Coombs added the comment: I'm only aware of one tool that writes .pth files, and that's setuptools, and it always writes ASCII (assuming package names are ASCII), so any encoding handling should be fine there. > We could add a handler for UnicodeDecodeError that falls back on utf-8? Yes, reasonable, but maybe we should consider instead _preferring_ UTF-8 and fall back to default encodings. That would be my preference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 10:12:33 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 03 Nov 2018 14:12:33 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541254353.59.0.788709270274.issue35131@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Also, I would argue that this is an enhancement request and not a bug - that the prior expectation was that the .pth file is encoded in whatever encoding the system expects by default, and that adding support for a standardized encoding for .pth files is a new feature. As another aside: Valentin, the technique you're using to manage packages is likely to run into issues with certain packages - in particular any packages that rely on their own `.pth` files to invoke behavior, such as future_fstrings (https://pypi.org/project/future-fstrings/). I learned about this issue in (https://github.com/jaraco/rwt/issues/29), which is why the rwt project adds a `sitecustomize.py` to the target directory that ensures .pth files are run. Just FYI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 11:16:40 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 03 Nov 2018 15:16:40 +0000 Subject: [issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings In-Reply-To: <1540888465.31.0.788709270274.issue35109@psf.upfronthosting.co.za> Message-ID: <1541258200.52.0.788709270274.issue35109@psf.upfronthosting.co.za> Julien Palard added the comment: Yes we can close it. Also -W from sphinx-build won't cause errors from those warnings. Yes we'll probably suffer a bit if someone push the final step of a deprecation if one of our build dependencies is still using it. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 11:24:26 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 03 Nov 2018 15:24:26 +0000 Subject: [issue34969] Add --fast, --best to the gzip CLI In-Reply-To: <1539409543.55.0.788709270274.issue34969@psf.upfronthosting.co.za> Message-ID: <1541258666.73.0.788709270274.issue34969@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 3e28eed9ec2249bb11ad0db4629271b7ce9b7918 by Julien Palard (St?phane Wirtel) in branch 'master': bpo-34969: Add --fast, --best on the gzip CLI (GH-9833) https://github.com/python/cpython/commit/3e28eed9ec2249bb11ad0db4629271b7ce9b7918 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 14:12:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 18:12:24 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541268744.84.0.788709270274.issue35113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Well, now the hardest problem remains. Sometimes there are more than one place where the class with the same __qualname__ is defined. See for example multiprocessing/heap.py: if sys.platform == 'win32': class Arena(object): ... else: class Arena(object): ... It is hard to determine the correct place. But the current code return the first line, while PR 10307 currently returns the last line. If the current behavior is more desirable, the code needs to stop searching after finding the first candidate. And the simplest way is to use exceptions: class ClassVisitor(ast.NodeVisitor): def visit_ClassDef(self, node): ... if found: raise StopIterator(line_number) ... ... try: class_visitor.visit(tree) except StopIterator as e: line_number = e.value else: raise OSError('could not find class definition') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 14:53:35 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Nov 2018 18:53:35 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541271215.04.0.788709270274.issue35113@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks Serhiy for the details. I think there are also less tests for inspect.findsource with respect to classes though it's more robust than the regex approach. Thus there might be different effects which are correct now or selects an alternate candidate as you have mentioned. I think this is worth adding a test case once the behavior is finalized. On a general note I am curious is there any patch to add line number directly to the class as an attribute? I think inspect module uses object.co_firstlineno where object is a code object and works for function object. Is there any technical difficulty in this? I searched the mailing list and PEPs but couldn't come across anything. Also there are couple of issues around showing source from REPL where it's not saved to the file issue33826, issue12920. There is one more frame pointer issue that is not working with class objects with a PR that fixes some more issues in findsource with respect to classes : issue35101. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 15:11:55 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 19:11:55 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541272315.17.0.788709270274.issue35113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: As for the line number for class, I have not heard anything about this. I think there is no large technical difficulty, but there is a little need. The first line number of the code object is needed first at all for tracing and debugging. Function has attached code object for executing, thus the line number is available for function. But the code object that creates a class is no longer needed after the class is created. Attaching the line number to the class looks like attaching the line number of the "[]" expression to the list created by it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 15:13:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 19:13:16 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1541272396.81.0.788709270274.issue35113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yury, could you please take a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 16:05:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 20:05:56 +0000 Subject: [issue29982] tempfile.TemporaryDirectory fails to delete itself In-Reply-To: <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za> Message-ID: <1541275556.32.0.788709270274.issue29982@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 16:16:29 2018 From: report at bugs.python.org (Eryk Sun) Date: Sat, 03 Nov 2018 20:16:29 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541276189.45.0.788709270274.issue26660@psf.upfronthosting.co.za> Eryk Sun added the comment: Serhiy, do you also plan to work around immutable files in POSIX? What about permissions on directories that prevent deleting files? In BSD and macOS, we have os.chflags for modifying file flags. Modifying the immutable flag requires superuser access. In Linux, modifying the immutable attribute requires the CAP_LINUX_IMMUTABLE capability, and file attributes are accessed with an ioctl call. For example: import os import fcntl import array EXT2_IOC_GETFLAGS = 0x80086601 EXT2_IOC_SETFLAGS = 0x40086602 EXT2_IMMUTABLE_FL = 0x00000010 def make_mutable(filename): flags = array.array('l', [0]) fd = os.open(filename, os.O_RDONLY) try: fcntl.ioctl(fd, EXT2_IOC_GETFLAGS, flags, True) flags[0] &= ~EXT2_IMMUTABLE_FL fcntl.ioctl(fd, EXT2_IOC_SETFLAGS, flags) finally: os.close(fd) I assume for Windows this will use os.chmod. I need to rant a bit to see whether anyone else is bothered by this. Microsoft's chmod function modifies the readonly attribute as if it's a write/delete permission. I wish Python hadn't adopted this behavior, since it clashes with how chmod works on other platforms, none of which conflates native file attributes and permissions. (We can be granted permission to modify or delete an immutable file, but this doesn't enable us to modify the file until it's made mutable.) It would be nice to have os.get_file_attributes and os.set_file_attributes on Windows instead of this confused use of chmod. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 16:55:53 2018 From: report at bugs.python.org (Roffild) Date: Sat, 03 Nov 2018 20:55:53 +0000 Subject: [issue35154] subprocess.list2cmdline() does not allow running some commands. Message-ID: <1541278553.41.0.788709270274.issue35154@psf.upfronthosting.co.za> New submission from Roffild : This issue has already been discussed in #23862 Have to use this hack: import subprocess def list2cmdlineHack(seq): return " ".join(seq) subprocess.list2cmdline = list2cmdlineHack There must be an argument in subprocess.run() to disable subprocess.list2cmdline(). Let the programmer set the start line of the command himself. ---------- components: IO, Library (Lib), Windows messages: 329207 nosy: Roffild, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: subprocess.list2cmdline() does not allow running some commands. type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 17:18:09 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 03 Nov 2018 21:18:09 +0000 Subject: [issue34969] Add --fast, --best to the gzip CLI In-Reply-To: <1539409543.55.0.788709270274.issue34969@psf.upfronthosting.co.za> Message-ID: <1541279889.22.0.788709270274.issue34969@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 17:31:25 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 03 Nov 2018 21:31:25 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541280685.48.0.788709270274.issue35105@psf.upfronthosting.co.za> Ned Batchelder added the comment: This seems like a confusion of two things: identifiers are lexical elements of the language. Attributes are not limited to identifiers. We could add to the docs for setattr: "The attribute name does not have to be a valid identifier." I don't know what the language guarantees about what strings are valid as attribute names. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 17:49:15 2018 From: report at bugs.python.org (Chris Jerdonek) Date: Sat, 03 Nov 2018 21:49:15 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541281755.26.0.788709270274.issue35105@psf.upfronthosting.co.za> Chris Jerdonek added the comment: > In the pydev thread, Guido said "My feeling is that limiting it to strings is fine, but checking those strings for resembling identifiers is pointless and wasteful." But in a later message, after additional discussion, he acknowledged there could be reasons to change and said, "we needn't rush this." So if the docs do describe the current implementation, I think it should warn people that this behavior might not be subject to the same backwards compatibility guarantees as other documented behavior. ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 19:11:13 2018 From: report at bugs.python.org (Denton Liu) Date: Sat, 03 Nov 2018 23:11:13 +0000 Subject: [issue35155] Clarify Protocol Handlers in urllib.request Docs Message-ID: <1541286673.86.0.788709270274.issue35155@psf.upfronthosting.co.za> New submission from Denton Liu : The urllib.request documentation that they can add their own protocol handlers, however they are unclear on how they should be named. We should replace instances of things like protocol_request with _request to make it clear that we are literally replacing "protocol" with the literal protocol. I am creating this issue because I had to actually read the urllib.request source code in order to figure out how to use the protocol handler APIs. ---------- assignee: docs at python components: Documentation messages: 329210 nosy: Denton-L, docs at python priority: normal severity: normal status: open title: Clarify Protocol Handlers in urllib.request Docs type: enhancement versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 19:12:47 2018 From: report at bugs.python.org (Denton Liu) Date: Sat, 03 Nov 2018 23:12:47 +0000 Subject: [issue35155] Clarify Protocol Handlers in urllib.request Docs In-Reply-To: <1541286673.86.0.788709270274.issue35155@psf.upfronthosting.co.za> Message-ID: <1541286767.23.0.788709270274.issue35155@psf.upfronthosting.co.za> Change by Denton Liu : ---------- keywords: +patch pull_requests: +9616 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 19:34:29 2018 From: report at bugs.python.org (Jorge Ramos) Date: Sat, 03 Nov 2018 23:34:29 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source Message-ID: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> New submission from Jorge Ramos : I want to build from source a 3.6 Python, using PGO for windows. Followed instructions at https://devguide.python.org/setup/ (the original search from google was "build python from source windows"). From a newbie perspective there are several problems: 1) it is suggested that you should build first a "debug" python (header 1.3) but they don't tell you how. 2) it is suggested that you should first build via "PCBuild\build.bat" but they don't tell you that this builds a win32 platform. What if I want to build a x64 version? (lost much time here figuring out how) 3) I ran into problems when building with "PCBuild\build.bat" (header 1.3.2) because the dependencies where not all downloaded in the first pass (but this is a bug I could fill later). Lost much time here figuring why the build did not succeed. 4) in (1.3.2) it is suggested you keep reading in a readme file: https://github.com/python/cpython/blob/master/PCbuild/readme.txt This is the first time an optimization is mentioned (other than simply compiling from your machine. I did not know that using PGO was mandatory for real speedups compared to the downloadable ?general? binaries). 5) In this very same readme, it says that there are other "subprojects" that you need to consider building with Python. Lost much time here trying to figure out that these subprojects are downloaded via "get_externals.bat" in the "Getting External Sources" section. Why not simply put the "Getting External Sources" section first and avoid worrying the newcomer of potential projects that are "not included with python"? 6) They tell you that PGO is automated via a "build_pgo.bat" file. But this does not exist. 7) They tell you that first, you have to run the PGInstrument option in the build, but it is not clear what should be run next: PCBuild\build.bat -c PGUpdate -p x64" or "PCBuild\build.bat --pgo -p x64" 8) After 2 days of trying to build (and learn in the process by trial and error) I stumble upon YET ANOTHER WAY TO BUILD: the one found in "cpython\Tools\msi" NOT the first one: "cpython\PCbuild" And this is the one I was interested in the first place: building an installable version of python (yet I have to figure out how to pack all cab files and such into one exe), not a developer?s python for testing. And after now 3 days with this, I noticed that all previous testing and building techniques are indeed reachable from "cpython\Tools\msi\buildrelease.bat -x64" which tries to build a python in x64 version AND using GPO (by default -in the x64 but not in the win32-, which is not mentioned in the documentation, by the way) also generating the dependencies required (I could have avoided losing some time if knowing this from the very beginning- see point 5) As you can see, I lost few hours here, few there. And because I am not a developer (my intention is to have an optimized python for my PC for AI research) I lost much time trying to figure out things that are not explicitly said in the documentation: I managed to learn from other sources (googling around), by careful observation of the compilation results, and digging into the help section of each of the files used. Hope I successfully communicated Python?s lack of proper documentation (just for the case of building from source!) ---------- assignee: docs at python components: Documentation messages: 329211 nosy: docs at python, neyuru priority: normal severity: normal status: open title: Consider revising documentation on Python Builds from source type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 19:52:48 2018 From: report at bugs.python.org (Jorge Ramos) Date: Sat, 03 Nov 2018 23:52:48 +0000 Subject: [issue35157] Missing pyconfig.h when building from source Message-ID: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> New submission from Jorge Ramos : When testing the builds when PGO is enabled, or by simply running rt.bat, the following error is (always) issued: cpython\include\Python.h(8): fatal error C1083: Cannot include: 'pyconfig.h': No such file or directory One example of steps taken is: git clone git at github.com:python/cpython.git cd cpython git checkout 3.6 PCBuild\get_externals.bat Tools\msi\get_externals.bat PCBuild\build.bat -p x64 I have to manually copy a pyconfig.h file from a working Python's include directory to the repositorie's include directory to fix this error. By the way, I had PYTHONHOME environment variable pointing to ...\Python36\DLLs; ...\Python36\Lib; ...\Python36\Lib\site-packages; ...\Python36\include with no success. ---------- components: Build messages: 329212 nosy: neyuru priority: normal severity: normal status: open title: Missing pyconfig.h when building from source type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 20:07:33 2018 From: report at bugs.python.org (Joy Diamond) Date: Sun, 04 Nov 2018 00:07:33 +0000 Subject: [issue35158] Fix PEP 3115 to NOT imply that the class dictionary is used in the final created class Message-ID: <1541290053.55.0.788709270274.issue35158@psf.upfronthosting.co.za> New submission from Joy Diamond : Fix the following in https://www.python.org/dev/peps/pep-3115/ REPLACE: """ def __new__(cls, name, bases, classdict): # Note that we replace the classdict with a regular # dict before passing it to the superclass, so that we # don't continue to record member names after the class # has been created. result = type.__new__(cls, name, bases, dict(classdict)) result.member_names = classdict.member_names return result """ WITH: """ def __new__(cls, name, bases, classdict): result = type.__new__(cls, name, bases, classdict) result.member_names = classdict.member_names return result """ REMOVING the incorrect comment & copying of `classdict` According to: https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace "When a new class is created by type.__new__, the object provided as the namespace parameter is copied to a new ordered mapping and the original object is discarded." Hence there is no need to copy `classdict` ---------- messages: 329213 nosy: joydiamond priority: normal severity: normal status: open title: Fix PEP 3115 to NOT imply that the class dictionary is used in the final created class _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 20:13:40 2018 From: report at bugs.python.org (Robert Pollak) Date: Sun, 04 Nov 2018 00:13:40 +0000 Subject: [issue35145] sqlite3: "select *" should autoconvert datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541290420.83.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: Thank you, Paul, for your hints on sniffing. I have now asked at SqliteStudio for confirmation that they also do content sniffing to detect datetime text fields: https://github.com/pawelsalawa/sqlitestudio/issues/3449 . So in this issue I am suggesting to embed this datetime text sniffing into sqlite3, for optional activation. Perhaps a new flag value of detect_types=DETECT_DATETIME to the sqlite3.connect() function would be suitable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 20:19:45 2018 From: report at bugs.python.org (Robert Pollak) Date: Sun, 04 Nov 2018 00:19:45 +0000 Subject: [issue35145] sqlite3: "select *" should optionally autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541290785.75.0.788709270274.issue35145@psf.upfronthosting.co.za> Change by Robert Pollak : ---------- title: sqlite3: "select *" should autoconvert datetime fields -> sqlite3: "select *" should optionally autoconvert TEXT datetime fields _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 22:20:13 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Nov 2018 02:20:13 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541298013.49.0.788709270274.issue35105@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Documenting something as an 'implementation detail' denies that it is a language feature and does not offer stability guarantees. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 22:23:03 2018 From: report at bugs.python.org (Jorge Ramos) Date: Sun, 04 Nov 2018 02:23:03 +0000 Subject: [issue33834] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() of ProactorEventLoop logs InvalidStateError error In-Reply-To: <1528725802.67.0.592728768989.issue33834@psf.upfronthosting.co.za> Message-ID: <1541298183.14.0.788709270274.issue33834@psf.upfronthosting.co.za> Jorge Ramos added the comment: While building 3.6.7. Path set to 3.6.7 working directory Running PGInstrument|x64 interpreter... Run tests sequentially Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ne, 64, None)>) handle: )> Traceback (most recent call last): File "E:\cpython\lib\asyncio\windows_events.py", line 429, in finish_recv return ov.getresult() OSError: [WinError 64] El nombre de red especificado ya no est? disponible During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\cpython\lib\asyncio\proactor_events.py", line 256, in _loop_reading data = fut.result() File "E:\cpython\lib\asyncio\windows_events.py", line 733, in _poll value = callback(transferred, key, ov) File "E:\cpython\lib\asyncio\windows_events.py", line 433, in finish_recv raise ConnectionResetError(*exc.args) ConnectionResetError: [WinError 64] El nombre de red especificado ya no est? disponible During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\cpython\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, *self._args) File "E:\cpython\lib\asyncio\proactor_events.py", line 283, in _loop_reading self._force_close(exc) File "E:\cpython\lib\asyncio\proactor_events.py", line 118, in _force_close self._empty_waiter.set_exception(exc) asyncio.exceptions.InvalidStateError: invalid state An open stream object is being garbage collected; call "stream.close()" explicitly. Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> ---------- nosy: +neyuru _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 22:48:47 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Nov 2018 02:48:47 +0000 Subject: [issue35154] subprocess.list2cmdline() does not allow running some commands. In-Reply-To: <1541278553.41.0.788709270274.issue35154@psf.upfronthosting.co.za> Message-ID: <1541299727.53.0.788709270274.issue35154@psf.upfronthosting.co.za> Eryk Sun added the comment: In case you don't know, on Windows an args sequence has to be converted to a command line that's compatible with CreateProcess[AsUser]. If the executable path isn't passed separately, the system has to parse it from the command line, and in this case paths with spaces need to be quoted in double quotes. That's the extent of what the system needs to see. Parsing the rest is the responsibility of the program itself once it's running. Most follow common rules. In particular, the C runtime library parses the command line into a Unix-style argv array, and the shell32 API provides a nearly identical implementation as CommandLineToArgvW. subprocess.list2cmdline is intended for this common case. Other cases, which are rare with the exception of the CMD shell, require manually processing an args sequence into a compatible command line. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 3 23:49:31 2018 From: report at bugs.python.org (bryan mabra) Date: Sun, 04 Nov 2018 03:49:31 +0000 Subject: [issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS In-Reply-To: <1505317705.14.0.640405907228.issue31453@psf.upfronthosting.co.za> Message-ID: <1541303371.08.0.788709270274.issue31453@psf.upfronthosting.co.za> bryan mabra added the comment: FYI, This is how I figured out and fixed the issue on my debian system. -Run nmap to figure out what ssl version is being used by the server nmap -p443 -sV --script ssl-enum-ciphers 10.10.10.7 output says TLSv1.0 test 10.10.10.7 using example in this comment (gets expected error) https://github.com/requests/requests/issues/606#issuecomment-8036266 test with openssl binary (gets expected error) openssl s_client -connect 10.10.10.7:443 fix by editing this value-->MinProtocol = TLSv1.0 in this file--> /etc/ssl/openssl.cnf rerun tests without error. Note the outdated server I am connecting to is internal, non-production, not connected to the internet. ---------- nosy: +mabrafoo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 00:14:30 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 04 Nov 2018 04:14:30 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541304870.45.0.788709270274.issue35156@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 00:49:27 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 04 Nov 2018 04:49:27 +0000 Subject: [issue33757] Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb In-Reply-To: <1528040605.03.0.592728768989.issue33757@psf.upfronthosting.co.za> Message-ID: <1541306967.07.0.788709270274.issue33757@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 02:57:09 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 07:57:09 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation Message-ID: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> New submission from St?phane Wirtel : I think a link to the devguide could be useful for a future contributor and the right place could be the sidebar in the index page. ---------- assignee: docs at python components: Documentation messages: 329219 nosy: docs at python, matrixise priority: normal severity: normal status: open title: Add a link to the devguide in the sidebar of the documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 02:58:17 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 07:58:17 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation In-Reply-To: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> Message-ID: <1541318297.14.0.788709270274.issue35159@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- keywords: +patch pull_requests: +9618 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 03:02:08 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 08:02:08 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation In-Reply-To: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> Message-ID: <1541318528.02.0.788709270274.issue35159@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 03:02:15 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 08:02:15 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation In-Reply-To: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> Message-ID: <1541318535.95.0.788709270274.issue35159@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 04:11:38 2018 From: report at bugs.python.org (Dan Snider) Date: Sun, 04 Nov 2018 09:11:38 +0000 Subject: [issue25410] Clean up and fix OrderedDict In-Reply-To: <1444896308.75.0.718152743923.issue25410@psf.upfronthosting.co.za> Message-ID: <1541322698.24.0.788709270274.issue25410@psf.upfronthosting.co.za> Dan Snider added the comment: It might be more appropriate to start a new issue for this, but I'll leave that decision to somehow who would know for sure. Anyway, basically the entire dict/PyDictObject api functions do not appear work at all with OrderedDict. Or rather, OrderedDict doesn't seem to be able to recognize the changes the dict api makes to an object. This is present in both 3.6.0 and 3.7.0 by the way. from operator import setitem from collections import OrderedDict from pprint import pprint class thing: def __init__(self): ns = OrderedDict(a='od.__init__') vars(__class__)['__dict__'].__set__(self, ns) dict.__setitem__(ns, 'b', 'dict.__setitem__') self.c = 'PyObject_SetAttr' OrderedDict.__setitem__(ns, 'd', 'od.__setitem__') ns.update(e='od.update') object.__setattr__(self, 'f', 'PyObject_GenericSetAttr') setattr(self, 'f', 'PyObject_SetAttr') setitem(ns, 'g', 'od.__setitem__') dict.update(ns, h='dict.update') dict.setdefault(ns, 'i', 'i') self = thing() ns = self.__dict__ real_ns = {**ns} missing = {k: ns[k] for k in real_ns.keys() - ns.keys()} pprint(ns) pprint(missing, width=len(f'{missing}')-1) print(f'"b" in {ns.keys()} == {"b" in ns.keys()}') print(f'"b" in {*ns.keys(),} == {"b" in [*ns.keys()]}') del ns['a'] del ns['b'] print(f"ns.get('c', KeyError('c')) == {ns.get('c', KeyError('c'))}") print(f"ns.pop('c', KeyError('c')) == {ns.pop('c', KeyError('c'))!r}") ns.get('i') ns.pop('i') Maybe it's considered undefined behavior for a subclass to use a method of one of its bases which it has overriden. That's fair enough, but as this example demonstrates, the silence and arbitrariness of the errors is a real problem when OrderedDict is used as a namespace, since it's a complete coin toss on whether one of the many internal API function will set an attribute or name via PyDict_SetItem or PyObject_SetItem. Only the former can invoke the methods OrderedDict overrides and there isn't any easy-to-find on the subject as far as I know. ---------- nosy: +bup _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 04:53:55 2018 From: report at bugs.python.org (Martin Panter) Date: Sun, 04 Nov 2018 09:53:55 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1541325235.69.0.788709270274.issue27682@psf.upfronthosting.co.za> Martin Panter added the comment: There seem to be at least two different issues raised here (and in Issue 34547): 1. Double exceptions due to ?self.environ? and ?self.status? being None when the error handler is called. This problem was specifically raised in Issue 29183. 2. What to do about exceptions such as ConnectionAbortedError, which are caused by the network or the client, and are outside the server?s control. I find it annoying when these exceptions are logged, and tend to add handlers for these exception types to silence them. I think this is what Petter is trying to do in . ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 06:19:02 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 11:19:02 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541330342.55.0.788709270274.issue35157@psf.upfronthosting.co.za> St?phane Wirtel added the comment: I started a compilation with PCBuild\build.bat -d -p x64 -r --pgo on a Windows machine but I am not the owner of this machine. ---------- nosy: +matrixise, zach.ware title: Missing pyconfig.h when building from source -> Missing pyconfig.h when building from source and pgo flag is enabled _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 06:19:29 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 11:19:29 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541330369.35.0.788709270274.issue35157@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 06:20:48 2018 From: report at bugs.python.org (Martin Panter) Date: Sun, 04 Nov 2018 11:20:48 +0000 Subject: [issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close() In-Reply-To: <1483731701.21.0.630358100063.issue29183@psf.upfronthosting.co.za> Message-ID: <1541330448.95.0.788709270274.issue29183@psf.upfronthosting.co.za> Martin Panter added the comment: Looks like the error handling is broken by Issue 16220, which calls the ?BaseHandler.close? method before the exception is caught for the error handler. Perhaps it is better to just close the iterator without messing with the other attributes in the exception case. I tried various cases in Python 2.6 (without the Issue 16220 change) and the error handling seems better (not masked by double exceptions, no sending a 500 response after the start of the app?s response). The same problem exists in Python 2, except only the later exception is reported, and the original exception is forgotten. ---------- keywords: +3.2regression nosy: +martin.panter type: -> behavior versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 06:52:05 2018 From: report at bugs.python.org (Serafeim Mellos) Date: Sun, 04 Nov 2018 11:52:05 +0000 Subject: [issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 Message-ID: <1541332325.94.0.788709270274.issue35160@psf.upfronthosting.co.za> New submission from Serafeim Mellos : I looked but I couldn't find any mention of this either in the bug tracker or the docs so I assume this is not a desired behavior or a known proble but feel free to correct me if I'm wrong. I have noticed a weird behavior in Python3.7 onwards with the way PyObject_New() works. I'm not sure what is the exact cause for the issue but even though the documentation mentions that it should initialize all fields described in the associated PyTypeObject, I think there's a problem that somehow causes uninitialized pointers to get initialized with strange values that break other functionality (eg Py_XDECREF). In more detail, it seems like uninitialized pointers in PyObjects get initialized to 0x1 which can lead to SEGFAULTs when calling Py_XDECREF() on them since they are no longer valid pointers. I have taken the example extension from the python docs (https://docs.python.org/3/extending/newtypes_tutorial.html) and modified lightly in order to surface the issue. You can find the sample extension in my github: https://github.com/fim/python_pyobjectnew_example I have checked versions 3.5, 3,6 which are fine but 3.7.0, 3.7.1 and 3.8 seem to reproduce this issue. You can see a simple transcript of how the issue manifests below: $ python setup.py build [...] $ pip install . [...] $ python -c 'import custom; custom.Custom()' weird pointer has value of: 0x8ec480 deallocating weird pointer $ python Python 3.7.1 (default, Nov 3 2018, 09:33:27) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import custom, gc >>> custom.Custom() weird pointer has value of: 0x1 >>> gc.collect() deallocating weird pointer zsh: segmentation fault python ---------- components: Extension Modules messages: 329224 nosy: fim priority: normal severity: normal status: open title: PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 type: crash versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 07:00:04 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 12:00:04 +0000 Subject: [issue35145] sqlite3: "select *" should optionally autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541332804.25.0.788709270274.issue35145@psf.upfronthosting.co.za> St?phane Wirtel added the comment: For my part, we could close this issue just because I am sure they sniff the format of the string. If you use sqliteman you get a TEXT and not "datetime" You can read this doc about the read_sql https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql.html Now, sqlite3 does not support the datetime type and I think it is not the job of Python to do this operation but the caller (your code) but you can see the example in Doc/includes/sqlite3/pysqlite_datetime.py ```python import sqlite3 import datetime con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) cur = con.cursor() cur.execute("create table test(d date, ts timestamp)") today = datetime.date.today() now = datetime.datetime.now() cur.execute("insert into test(d, ts) values (?, ?)", (today, now)) cur.execute("select d, ts from test") row = cur.fetchone() print(today, "=>", row[0], type(row[0])) print(now, "=>", row[1], type(row[1])) cur.execute('select current_date as "d [date]", current_timestamp as "ts [timestamp]"') row = cur.fetchone() print("current_date", row[0], type(row[0])) print("current_timestamp", row[1], type(row[1])) ``` ```shell 2018-11-04 => 2018-11-04 2018-11-04 12:58:01.399669 => 2018-11-04 12:58:01.399669 current_date 2018-11-04 current_timestamp 2018-11-04 11:58:01 ``` ---------- nosy: +matrixise resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 08:25:06 2018 From: report at bugs.python.org (Robert Pollak) Date: Sun, 04 Nov 2018 13:25:06 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541337906.57.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: St?phane, your example does not match my use case with unknown table structure. Does everyone agree that such a sniffing is out of scope for sqlite3? That's not what I'd call "batteries included" :-( ---------- title: sqlite3: "select *" should optionally autoconvert TEXT datetime fields -> sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 08:49:35 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 13:49:35 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541339375.04.0.788709270274.issue35145@psf.upfronthosting.co.za> St?phane Wirtel added the comment: ok in this case, I re-open the issue. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:09:11 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sun, 04 Nov 2018 14:09:11 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541340551.54.0.788709270274.issue21263@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- keywords: +patch pull_requests: +9619 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:19:17 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 14:19:17 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541341157.2.0.788709270274.issue35157@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Hi Jorge, I am really sorry but I don't have any issue for the compilation of Python 3.6 under Windows 8.1 C:\Users\pydev\cpython-bpo-35157>PCbuild\amd64\python.exe -m test.pythoninfo Python debug information ======================== Py_DEBUG: No (sys.gettotalrefcount() missing) _decimal.__libmpdec_version__: 2.4.2 builtins.float.double_format: IEEE, little-endian builtins.float.float_format: IEEE, little-endian datetime.datetime.now: 2018-11-04 14:18:35.618798 expat.EXPAT_VERSION: expat_2.2.6 locale.encoding: cp1252 os.cpu_count: 2 os.cwd: C:\Users\pydev\cpython-bpo-35157 os.environ[COMSPEC]: C:\Windows\system32\cmd.exe os.environ[HOMEDRIVE]: C: os.environ[HOMEPATH]: \Users\pydev os.environ[HOME]: C:\Users\pydev os.environ[LANG]: fr_BE.UTF-8 os.environ[PATH]: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseHg\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Progr am Files\Microsoft Windows Performance Toolkit\;C:\Program Files\Git\bin;C:\Program Files\Microsoft\Web Platform Installer\ os.environ[PYTHON]: py -3.6 os.environ[TEMP]: C:\Users\pydev\AppData\Local\Temp os.environ[TMP]: C:\Users\pydev\AppData\Local\Temp os.environ[USERPROFILE]: C:\Users\pydev os.environ[VS100COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ os.environ[VS140COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ os.environ[VS90COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\ os.login: pydev os.name: nt os.supports_bytes_environ: False os.supports_effective_ids: [] os.supports_fd: ['stat', 'truncate'] os.supports_follow_symlinks: ['stat'] os.umask: 000 platform.architecture: 64bit WindowsPE platform.platform: Windows-8.1 platform.python_implementation: CPython socket.hostname: win81bb sqlite3.sqlite_version: 3.21.0 sqlite3.version: 2.6.0 ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.0.2p 14 Aug 2018 ssl.OPENSSL_VERSION_INFO: (1, 0, 2, 16, 15) ssl.OP_ALL: -0x7ffffc01 ssl.OP_NO_TLSv1_1: 0x10000000 sys.api_version: 1013 sys.builtin_module_names: ('_ast', '_bisect', '_blake2', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_collections', '_csv', '_datetime', '_functools', '_hea pq', '_imp', '_io', '_json', '_locale', '_lsprof', '_md5', '_multibytecodec', '_opcode', '_operator', '_pickle', '_random', '_sha1', '_sha256', '_sha3', '_sha512', '_signal', '_sre', '_stat', '_string', '_struct', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', '_winapi', 'array', 'atexit', 'audioop', 'binascii', 'builtins', 'cmath', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'math', 'mmap', 'm svcrt', 'nt', 'parser', 'sys', 'time', 'winreg', 'xxsubtype', 'zipimport', 'zlib') sys.byteorder: little sys.dont_write_bytecode: False sys.executable: C:\Users\pydev\cpython-bpo-35157\PCbuild\amd64\python.exe sys.filesystem_encoding: utf-8/surrogatepass sys.flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0) sys.float_info: sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, r ounds=1) sys.float_repr_style: short sys.hash_info: sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003, algorithm='siphash24', hash_bits=64, seed_bits=128, cutoff=0) sys.hexversion: 50726896 sys.implementation: namespace(cache_tag='cpython-36', hexversion=50726896, name='cpython', version=sys.version_info(major=3, minor=6, micro=7, releaselevel='final', serial=0)) sys.int_info: sys.int_info(bits_per_digit=30, sizeof_digit=4) sys.maxsize: 9223372036854775807 sys.maxunicode: 1114111 sys.path: ['', 'C:\\Users\\pydev\\cpython-bpo-35157\\PCbuild\\amd64\\python36.zip', 'C:\\Users\\pydev\\cpython-bpo-35157\\DLLs', 'C:\\Users\\pydev\\cpython-bpo-35157\\lib', 'C:\\Users\\pydev\\cpython-bpo-35157\\PC build\\amd64', 'C:\\Users\\pydev\\AppData\\Roaming\\Python\\Python36\\site-packages', 'C:\\Users\\pydev\\cpython-bpo-35157', 'C:\\Users\\pydev\\cpython-bpo-35157\\lib\\site-packages'] sys.platform: win32 sys.prefix: C:\Users\pydev\cpython-bpo-35157 sys.stderr.encoding: utf-8/backslashreplace sys.stdin.encoding: utf-8/surrogateescape sys.stdout.encoding: utf-8/surrogateescape sys.thread_info: sys.thread_info(name='nt', lock=None, version=None) sys.version: 3.6.7+ (heads/3.6:4614b98, Nov 4 2018, 13:07:59) [MSC v.1900 64 bit (AMD64)] sys.version_info: sys.version_info(major=3, minor=6, micro=7, releaselevel='final', serial=0) sys.windowsversion: sys.getwindowsversion(major=6, minor=3, build=9600, platform=2, service_pack='') sys.winver: 3.6 sysconfig[prefix]: C:\Users\pydev\cpython-bpo-35157 test_socket.HAVE_SOCKET_ALG: False test_socket.HAVE_SOCKET_CAN: False test_socket.HAVE_SOCKET_RDS: False test_support.IPV6_ENABLED: True test_support._is_gui_available: False test_support.python_is_optimized: False time.altzone: -3600 time.daylight: 0 time.get_clock_info(perf_counter): namespace(adjustable=False, implementation='QueryPerformanceCounter()', monotonic=True, resolution=1e-07) time.get_clock_info(time): namespace(adjustable=True, implementation='GetSystemTimeAsFileTime()', monotonic=False, resolution=0.015625) time.time: 1541341115.6187983 time.timezone: 0 time.tzname: ('Coordinated Universal Time', 'Coordinated Universal Time') tkinter.TCL_VERSION: 8.6 tkinter.TK_VERSION: 8.6 tkinter.info_patchlevel: 8.6.6 zlib.ZLIB_RUNTIME_VERSION: 1.2.11 zlib.ZLIB_VERSION: 1.2.11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:23:27 2018 From: report at bugs.python.org (Serafeim Mellos) Date: Sun, 04 Nov 2018 14:23:27 +0000 Subject: [issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 In-Reply-To: <1541332325.94.0.788709270274.issue35160@psf.upfronthosting.co.za> Message-ID: <1541341407.65.0.788709270274.issue35160@psf.upfronthosting.co.za> Serafeim Mellos added the comment: Backtrace from segfault is below but I'm not very familiar with python's memory internals in order to figure out where is the value initialized at the first place (gdb) bt #0 _Py_XDECREF (op=0x1) at /home/fim/.pyenv/versions/3.8-dev/include/python3.8m/object.h:896 #1 Custom_dealloc (self=0x7ffff7ec0660) at custom.c:20 #2 0x00000000004685f2 in _Py_Dealloc_inline (op=) at ./Include/object.h:806 #3 _Py_DECREF (filename=0x5f7460 "Objects/dictobject.c", lineno=1508, op=) at ./Include/object.h:833 #4 delitem_common (old_value=, ix=, hash=-2939463505650448616, mp=0x7ffff7f38d80) at Objects/dictobject.c:1508 #5 _PyDict_DelItem_KnownHash (hash=-2939463505650448616, key=0x7ffff7f39b90, op=0x7ffff7f38d80) at Objects/dictobject.c:1560 #6 PyDict_DelItem (op=0x7ffff7f38d80, key=0x7ffff7f39b90) at Objects/dictobject.c:1526 #7 0x0000000000468aa5 in dict_ass_sub (mp=0x7ffff7f38d80, v=0x7ffff7f39b90, w=) at Objects/dictobject.c:2058 #8 0x00000000004262e3 in _PyEval_EvalFrameDefault (f=, throwflag=) at Python/ceval.c:2044 #9 0x00000000004e3ac0 in PyEval_EvalFrameEx (throwflag=0, f=0x7ffff7f5a970) at Python/ceval.c:531 #10 _PyEval_EvalCodeWithName (_co=_co at entry=0x7ffff7e97e40, globals=globals at entry=0x7ffff7f38d80, locals=locals at entry=0x7ffff7f38d80, args=args at entry=0x0, argcount=argcount at entry=0, kwnames=kwnames at entry=0x0, kwargs=0x0, kwcount=0, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:3946 #11 0x00000000004e3bb3 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=locals at entry=0x7ffff7f38d80, globals=globals at entry=0x7ffff7f38d80, _co=_co at entry=0x7ffff7e97e40) at Python/ceval.c:3975 #12 PyEval_EvalCode (co=co at entry=0x7ffff7e97e40, globals=globals at entry=0x7ffff7f38d80, locals=locals at entry=0x7ffff7f38d80) at Python/ceval.c:508 #13 0x000000000052009f in run_mod (arena=0x7ffff7fb81e0, flags=0x7fffffffd5e0, locals=0x7ffff7f38d80, globals=0x7ffff7f38d80, filename=0x7ffff7e510d8, mod=0x9a66c0) at Python/pythonrun.c:1031 #14 PyRun_InteractiveOneObjectEx (fp=fp at entry=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename=filename at entry=0x7ffff7e510d8, flags=flags at entry=0x7fffffffd5e0) at Python/pythonrun.c:256 #15 0x0000000000520386 in PyRun_InteractiveLoopFlags (fp=fp at entry=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename_str=filename_str at entry=0x5f13a5 "", flags=flags at entry=0x7fffffffd5e0) at Python/pythonrun.c:120 #16 0x00000000005204fc in PyRun_AnyFileExFlags (fp=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename=0x5f13a5 "", closeit=0, flags=0x7fffffffd5e0) at Python/pythonrun.c:78 #17 0x000000000042e0fe in pymain_run_stdin (pymain=0x7fffffffd6f0, pymain=0x7fffffffd6f0, cf=0x7fffffffd5e0, config=0x922ea8) at Modules/main.c:1185 #18 pymain_run_python (interp=0x922e20, pymain=0x7fffffffd6f0) at Modules/main.c:1613 #19 pymain_main (pymain=0x7fffffffd6f0) at Modules/main.c:1758 #20 0x000000000042e349 in _Py_UnixMain (argc=, argv=) at Modules/main.c:1795 #21 0x00007ffff711b4db in __libc_start_main () from /lib64/libc.so.6 #22 0x000000000042aeaa in _start () ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:26:54 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Sun, 04 Nov 2018 14:26:54 +0000 Subject: [issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid} Message-ID: <1541341614.35.0.788709270274.issue35161@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : ==24122==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffb1c62550 at pc 0x0000006ec66c bp 0x7fffb1c62450 sp 0x7fffb1c62448 READ of size 8 at 0x7fffb1c62550 thread T0 #0 0x6ec66b in mkpwent /scratch2/izbyshev/cpython/Modules/pwdmodule.c:79 #1 0x6ecdc9 in pwd_getpwnam_impl /scratch2/izbyshev/cpython/Modules/pwdmodule.c:260 #2 0x6ecfee in pwd_getpwnam /scratch2/izbyshev/cpython/Modules/clinic/pwdmodule.c.h:39 #3 0x454146 in _PyMethodDef_RawFastCallKeywords /scratch2/izbyshev/cpython/Objects/call.c:644 [======= snip =======] Address 0x7fffb1c62550 is located in stack of thread T0 at offset 160 in frame #0 0x6eca60 in pwd_getpwnam_impl /scratch2/izbyshev/cpython/Modules/pwdmodule.c:203 This frame has 3 object(s): [32, 40) 'name_chars' [96, 104) 'p' [160, 208) 'pwd' <== Memory access at offset 160 is inside this variable Variables declared in the block scope created with Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS are referred to via a pointer outside of that scope (i.e., after their lifetime ends). The bug was introduced in https://github.com/python/cpython/commit/23e65b25557f957af840cf8fe68e80659ce28629 . ---------- components: Extension Modules messages: 329230 nosy: berker.peksag, izbyshev, serhiy.storchaka, vstinner, wg priority: normal severity: normal status: open title: ASAN: stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid} type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:29:00 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Sun, 04 Nov 2018 14:29:00 +0000 Subject: [issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid} In-Reply-To: <1541341614.35.0.788709270274.issue35161@psf.upfronthosting.co.za> Message-ID: <1541341740.91.0.788709270274.issue35161@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9620 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:42:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 14:42:56 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541342576.43.0.788709270274.issue26660@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- title: tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created -> tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created versions: +Python 3.7, Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:44:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 14:44:14 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541342654.99.0.788709270274.issue26660@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9621 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:44:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 14:44:15 +0000 Subject: [issue35144] TemporaryDirectory clean-up fails with unsearchable directories In-Reply-To: <1541148008.66.0.788709270274.issue35144@psf.upfronthosting.co.za> Message-ID: <1541342655.09.0.663665092547.issue35144@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9622 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:46:46 2018 From: report at bugs.python.org (Barney Stratford) Date: Sun, 04 Nov 2018 14:46:46 +0000 Subject: [issue35162] Inconsistent behaviour around __new__ Message-ID: <1541342806.22.0.788709270274.issue35162@psf.upfronthosting.co.za> New submission from Barney Stratford : >>> class Eggs (object): ... def __init__ (self, number): ... self.__number = number ... def __repr__ (self): ... return "{} eggs".format (self.__number) ... >>> Eggs (4) 4 eggs >>> del Eggs.__new__ Traceback (most recent call last): File "", line 1, in AttributeError: __new__ >>> # As expected ... >>> Eggs (4) 4 eggs >>> Eggs.__new__ = None >>> del Eggs.__new__ >>> Eggs (4) Traceback (most recent call last): File "", line 1, in TypeError: object() takes no parameters >>> # Wrong! Eggs has no __new__, so this should respond as earlier ... This bug seems to be because the slotdef isn't updated when __new__ is deleted. ---------- messages: 329231 nosy: Barney Stratford priority: normal severity: normal status: open title: Inconsistent behaviour around __new__ type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:51:19 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 14:51:19 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1541343079.52.0.788709270274.issue33275@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:53:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 14:53:49 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541343229.92.0.788709270274.issue26660@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 10320 solves problems with file mode and flags which can be set by os.chmod() and os.chflags() by unprivileged user. Was tested on Linux, FreeBSD and Windows. It doesn't solve problem when files was made immutable by chattr on Linux. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 09:59:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 14:59:49 +0000 Subject: [issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid} In-Reply-To: <1541341614.35.0.788709270274.issue35161@psf.upfronthosting.co.za> Message-ID: <1541343589.18.0.788709270274.issue35161@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Good catch! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 10:01:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 15:01:01 +0000 Subject: [issue35162] Inconsistent behaviour around __new__ In-Reply-To: <1541342806.22.0.788709270274.issue35162@psf.upfronthosting.co.za> Message-ID: <1541343661.33.0.788709270274.issue35162@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Assigning and deleting __new__ attr on the class does not allow to create instances of this class _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 10:01:25 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sun, 04 Nov 2018 15:01:25 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1541343685.6.0.788709270274.issue24916@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- pull_requests: +9623 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 10:44:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 15:44:25 +0000 Subject: [issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid} In-Reply-To: <1541341614.35.0.788709270274.issue35161@psf.upfronthosting.co.za> Message-ID: <1541346265.17.0.788709270274.issue35161@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd by Serhiy Storchaka (Alexey Izbyshev) in branch 'master': bpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid}. (GH-10319) https://github.com/python/cpython/commit/e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 10:44:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 15:44:54 +0000 Subject: [issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid} In-Reply-To: <1541341614.35.0.788709270274.issue35161@psf.upfronthosting.co.za> Message-ID: <1541346294.66.0.788709270274.issue35161@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 10:54:37 2018 From: report at bugs.python.org (Carmen Bianca Bakker) Date: Sun, 04 Nov 2018 15:54:37 +0000 Subject: [issue35163] locale: setlocale(..., 'eo') sets non-existing locale Message-ID: <1541346877.51.0.788709270274.issue35163@psf.upfronthosting.co.za> New submission from Carmen Bianca Bakker : See the following script: >>> import locale >>> locale.setlocale(locale.LC_ALL, 'eo') 'eo' >>> my_locale = locale.getlocale() >>> my_locale ('eo_XX', 'ISO8859-3') >>> locale.setlocale(locale.LC_ALL, my_locale) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.7/locale.py", line 604, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting 'eo_XX.ISO8859-3' does not exist on Fedora 29 or Debian Stretch. The only Esperanto locales that exists are 'eo' and 'eo.utf8'. Even so, locale.py defines the Esperanto locales as follows: 'eo': 'eo_XX.ISO8859-3', 'eo.utf8': 'eo.UTF-8', 'eo_eo': 'eo_EO.ISO8859-3', 'eo_us.utf8': 'eo_US.UTF-8', 'eo_xx': 'eo_XX.ISO8859-3', eo_EO used to exist on Debian in the early 2000s, and eo_XX on some other distributions. Since glibc 2.24 upstreamed Esperanto, however, it has been 'eo[.utf8]'. I'm not sure whether 'eo_eo', 'eo_us' and/or 'eo_xx' should be removed as keys, but 'eo' should have 'eo.UTF-8' as value. ---------- components: Library (Lib) messages: 329235 nosy: carmenbianca priority: normal severity: normal status: open title: locale: setlocale(..., 'eo') sets non-existing locale versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 11:41:55 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Nov 2018 16:41:55 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1541349715.5.0.788709270274.issue26660@psf.upfronthosting.co.za> Eryk Sun added the comment: > file mode and flags which can be set by os.chmod() and os.chflags() > by unprivileged user. I remembered incorrectly about chflags. It's not a single immutable flag, but several (depending on the OS). The owner or superuser can modify UF_IMMUTABLE, UF_READONLY, and UF_NOUNLINK. The SF_* flags can only be unset by the superuser in single-user mode. > It doesn't solve problem when files was made immutable by chattr on > Linux. We may not have CAP_LINUX_IMMUTABLE, but we can at least try to clear the immutable flag, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 11:50:41 2018 From: report at bugs.python.org (Sorin Sbarnea) Date: Sun, 04 Nov 2018 16:50:41 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS Message-ID: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> New submission from Sorin Sbarnea : It seems that when the MacOS machine does not have a FQDN name manually configured using `scutil`, python will be fail to resolve domain names and timeout after ~30 seconds. I mention that the DNS resolution works correctly on the machine and that the DHCP servers provides one ore more domains to be useles for resolution. Tools like nslookup or ping are not affected by this, only python (tried py27,34-36 and got same behavior). Usually python user encounters errors like: Traceback (most recent call last): ... socket.gethostbyname(socket.gethostname()) gaierror: [Errno 8] nodename nor servname provided, or not known One these machines `hostname` cli command returns a valid FQDN name like `foo.lan` but scutil will not return one: ``` sudo scutil --get HostName HostName: not set ``` One temporary workaround is to manually run: ``` sudo scutil --set HostName `hostname` ``` This will set the hostname and python sockets functions will start to work (after few minutes as some caching is involved). Still, we cannot expect users to run this command themselves. Even worse, they would have to re-run this each time the roam to another network that may have a different set of domains. See: https://stackoverflow.com/questions/52602107 ---------- components: macOS messages: 329237 nosy: ned.deily, ronaldoussoren, ssbarnea priority: normal severity: normal status: open title: socket.getfqdn and socket.gethostbyname fail on MacOS type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:00:57 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 17:00:57 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1541350857.78.0.788709270274.issue35164@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the report but I don't think the problem you are seeing is that simple. On my 10.14.1 system, I don't see that problem: $ scutil --get HostName HostName: not set $ /usr/local/bin/python3.7 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.gethostname() 'harj.local' >>> socket.gethostbyname(socket.gethostname()) '10.0.1.8' >>> So there's likely some other configuration issue here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:19:15 2018 From: report at bugs.python.org (Denis Osipov) Date: Sun, 04 Nov 2018 17:19:15 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541351955.72.0.788709270274.issue35119@psf.upfronthosting.co.za> Denis Osipov added the comment: I understand that it's expected behavior. But why don't use completely working example in the docs, which one could just copy and paste? It requires to add just seven chars) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:26:51 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 17:26:51 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1541352411.97.0.788709270274.issue35164@psf.upfronthosting.co.za> Ned Deily added the comment: See also Issue29705. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:27:16 2018 From: report at bugs.python.org (Serafeim Mellos) Date: Sun, 04 Nov 2018 17:27:16 +0000 Subject: [issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 In-Reply-To: <1541332325.94.0.788709270274.issue35160@psf.upfronthosting.co.za> Message-ID: <1541352436.86.0.788709270274.issue35160@psf.upfronthosting.co.za> Serafeim Mellos added the comment: Actually, I'm not so sure it's related to memory management after all judging by this (but I don't really know how the compilation part is supposed to work :)): (gdb) watch *0x7ffff7ec0680 Hardware watchpoint 1: *0x7ffff7ec0680 (gdb) b Custom_dealloc Breakpoint 2 at 0x7fffef9c4c50: file custom.c, line 16. (gdb) run [...] Hardware watchpoint 1: *0x7ffff7ec0680 Old value = 0 New value = 1 dfs (c=c at entry=0x7fffffffd440, b=b at entry=0x7ffff7ec0660, a=a at entry=0x7fffffffd3b0, end=2) at Python/compile.c:4974 4974 a->a_postorder[--j] = b; (gdb) bt #0 dfs (c=c at entry=0x7fffffffd440, b=b at entry=0x7ffff7ec0660, a=a at entry=0x7fffffffd3b0, end=2) at Python/compile.c:4974 #1 0x00000000004e9e86 in assemble (c=c at entry=0x7fffffffd440, addNone=) at Python/compile.c:5530 #2 0x00000000004f45c6 in compiler_mod (mod=0x9a86a8, c=0x7fffffffd440) at Python/compile.c:1641 #3 PyAST_CompileObject (mod=mod at entry=0x9a86a8, filename=filename at entry=0x7ffff7e510d8, flags=flags at entry=0x7fffffffd5e0, optimize=optimize at entry=-1, arena=arena at entry=0x7ffff7fb81e0) at Python/compile.c:345 #4 0x0000000000520025 in run_mod (arena=0x7ffff7fb81e0, flags=0x7fffffffd5e0, locals=0x7ffff7f38d80, globals=0x7ffff7f38d80, filename=0x7ffff7e510d8, mod=0x9a86a8) at Python/pythonrun.c:1028 #5 PyRun_InteractiveOneObjectEx (fp=fp at entry=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename=filename at entry=0x7ffff7e510d8, flags=flags at entry=0x7fffffffd5e0) at Python/pythonrun.c:256 #6 0x0000000000520326 in PyRun_InteractiveLoopFlags (fp=fp at entry=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename_str=filename_str at entry=0x5f1345 "", flags=flags at entry=0x7fffffffd5e0) at Python/pythonrun.c:120 #7 0x000000000052049c in PyRun_AnyFileExFlags (fp=0x7ffff749b8a0 <_IO_2_1_stdin_>, filename=0x5f1345 "", closeit=0, flags=0x7fffffffd5e0) at Python/pythonrun.c:78 #8 0x000000000042e0be in pymain_run_stdin (pymain=0x7fffffffd6f0, pymain=0x7fffffffd6f0, cf=0x7fffffffd5e0, config=0x922ea8) at Modules/main.c:1185 #9 pymain_run_python (interp=0x922e20, pymain=0x7fffffffd6f0) at Modules/main.c:1613 #10 pymain_main (pymain=0x7fffffffd6f0) at Modules/main.c:1758 #11 0x000000000042e309 in _Py_UnixMain (argc=, argv=) at Modules/main.c:1795 #12 0x00007ffff711b4db in __libc_start_main () from /lib64/libc.so.6 #13 0x000000000042ae6a in _start () (gdb) frame #0 dfs (c=c at entry=0x7fffffffd440, b=b at entry=0x7ffff7ec0660, a=a at entry=0x7fffffffd3b0, end=2) at Python/compile.c:4974 4974 a->a_postorder[--j] = b; (gdb) c Continuing. weird pointer has value of: 0x1 >>> Breakpoint 2, Custom_dealloc (self=0x7ffff7ec0660) at custom.c:16 16 { (gdb) print(self->test_field) $1 = (PyObject *) 0x1 (gdb) print(&self->test_field) $2 = (PyObject **) 0x7ffff7ec0680 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:29:22 2018 From: report at bugs.python.org (Sorin Sbarnea) Date: Sun, 04 Nov 2018 17:29:22 +0000 Subject: [issue29705] socket.gethostbyname, getaddrinfo etc broken on MacOS 10.12 In-Reply-To: <1488497815.81.0.0112571433534.issue29705@psf.upfronthosting.co.za> Message-ID: <1541352562.45.0.788709270274.issue29705@psf.upfronthosting.co.za> Sorin Sbarnea added the comment: It seems that the bug is still present. There is some additional information on the new report https://bugs.python.org/issue35164 ---------- nosy: +ssbarnea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:40:10 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 04 Nov 2018 17:40:10 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541353210.6.0.788709270274.issue35119@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Ah, sorry, I didn't understand this was a documentation issue. Please feel free to submit a PR that fixes the example to use `super().__setattr__()`. ---------- resolution: not a bug -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:42:18 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 04 Nov 2018 17:42:18 +0000 Subject: [issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 In-Reply-To: <1541332325.94.0.788709270274.issue35160@psf.upfronthosting.co.za> Message-ID: <1541353338.44.0.788709270274.issue35160@psf.upfronthosting.co.za> Benjamin Peterson added the comment: PyObject_New is a low-level allocation function. It doesn't initialize anything but the type pointer and ref count. If you want a field to be NULL, set it to NULL. ---------- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 12:43:20 2018 From: report at bugs.python.org (Denis Osipov) Date: Sun, 04 Nov 2018 17:43:20 +0000 Subject: [issue35165] Possible wrong method name in attribute references doc Message-ID: <1541353400.8.0.788709270274.issue35165@psf.upfronthosting.co.za> New submission from Denis Osipov : 6.3.1. Attribute references says: "The primary must evaluate to an object of a type that supports attribute references, which most objects do. This object is then asked to produce the attribute whose name is the identifier. This production can be customized by overriding the __getattr__() method. If this attribute is not available, the exception AttributeError is raised." It seems that __getattribute__ method is meaning. ---------- assignee: docs at python components: Documentation messages: 329245 nosy: denis-osipov, docs at python priority: normal severity: normal status: open title: Possible wrong method name in attribute references doc type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 13:06:16 2018 From: report at bugs.python.org (Denis Osipov) Date: Sun, 04 Nov 2018 18:06:16 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1541354776.01.0.788709270274.issue31583@psf.upfronthosting.co.za> Change by Denis Osipov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 13:24:22 2018 From: report at bugs.python.org (Serafeim Mellos) Date: Sun, 04 Nov 2018 18:24:22 +0000 Subject: [issue35160] PyObjects initialized with PyObject_New have uninitialized pointers to set to 0x1 In-Reply-To: <1541332325.94.0.788709270274.issue35160@psf.upfronthosting.co.za> Message-ID: <1541355862.81.0.788709270274.issue35160@psf.upfronthosting.co.za> Serafeim Mellos added the comment: Ok, I understand your point about PyObject_New not initializing custom fields (although it looks like something is initializing the memory since it's not random, it's either 0x0 or 0x1). However, if that's the expected behavior, it's not very clear why there's a difference between the default values when invoking the same commands in different ways or between different python versions, eg: Python3.8 ========= Python 3.8.0a0 (heads/master-dirty:f98c1623ec, Nov 4 2018, 17:16:57) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import custom; custom.Custom() weird pointer has value of: 0x0 >>> import custom; >>> custom.Custom() weird pointer has value of: 0x1 deallocating weird pointer >>> deallocating weird pointer zsh: segmentation fault ../cpython/python Python 3.6 ========== Python 3.6.5 (default, Nov 4 2018, 18:20:36) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import custom; custom.Custom() weird pointer has value of: 0x0 deallocating weird pointer >>> import custom >>> custom.Custom() weird pointer has value of: 0x0 deallocating weird pointer Is there any discussions or documentation I can refer to, in order to better understand this behavior or why it was changed since python 3.7? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 13:26:17 2018 From: report at bugs.python.org (Petter S) Date: Sun, 04 Nov 2018 18:26:17 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1541355977.6.0.788709270274.issue27682@psf.upfronthosting.co.za> Change by Petter S : ---------- keywords: +patch pull_requests: +9624 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 13:28:41 2018 From: report at bugs.python.org (Jorge Ramos) Date: Sun, 04 Nov 2018 18:28:41 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541356121.78.0.788709270274.issue35157@psf.upfronthosting.co.za> Jorge Ramos added the comment: Hello: I followed the same command: PCBuild\build.bat -d -p x64 -r --pgo and in summary, it found 5 errors (the last part of this messages contains the PGInstrument|x64 interpreter verbose). I include a number between parenthesis to show the test number: *********************************************************************************************** test_distutils failed in 43 sec 783 ms (107) test_httpservers failed (171) test_platform failed (246) test_regrtest failed in 1 min 36 sec (273) test_sysconfig failed (330) *********************************************************************************************** And for the sake of completeness I also runh the command "python.exe -m test.pythoninfo" which basically gave the same results as yours. But my problem is not with the exixting python installation but at compile time when using PGO. *********************************************************************************************** Running PGInstrument|x64 interpreter... Run tests sequentially 0:00:00 [ 1/407] test_grammar 0:00:00 [ 2/407] test_opcodes 0:00:00 [ 3/407] test_dict 0:00:01 [ 4/407] test_builtin 0:00:02 [ 5/407] test_exceptions 0:00:10 [ 6/407] test_types 0:00:11 [ 7/407] test_unittest 0:00:18 [ 8/407] test_doctest 0:00:25 [ 9/407] test_doctest2 0:00:26 [ 10/407] test_support 0:00:26 [ 11/407] test___all__ 0:00:33 [ 12/407] test___future__ 0:00:33 [ 13/407] test__locale 0:00:33 [ 14/407] test__opcode 0:00:33 [ 15/407] test__osx_support 0:00:33 [ 16/407] test_abc 0:00:34 [ 17/407] test_abstract_numbers 0:00:34 [ 18/407] test_aifc 0:00:35 [ 19/407] test_argparse 0:00:41 [ 20/407] test_array 0:00:46 [ 21/407] test_asdl_parser 0:00:46 [ 22/407] test_ast -- test_asdl_parser skipped 0:00:52 [ 23/407] test_asyncgen 0:00:53 [ 24/407] test_asynchat 0:00:56 [ 25/407] test_asyncio Executing .start() done, defined at E:\RepoGiT\cpython\lib\test\test_asyncio\test_pep492.py:150> result=None created at E:\RepoGiT\cpython\lib\asyncio\base_events.py:452> took 0.141 seconds 0:02:28 [ 26/407] test_asyncore -- test_asyncio passed in 1 min 32 sec 0:02:28 [ 27/407] test_atexit -- test_asyncore skipped 0:02:29 [ 28/407] test_audioop 0:02:29 [ 29/407] test_augassign 0:02:29 [ 30/407] test_base64 0:02:32 [ 31/407] test_baseexception 0:02:32 [ 32/407] test_bdb 0:02:32 [ 33/407] test_bigaddrspace 0:02:32 [ 34/407] test_bigmem 0:02:33 [ 35/407] test_binascii 0:02:33 [ 36/407] test_binhex 0:02:33 [ 37/407] test_binop 0:02:34 [ 38/407] test_bisect 0:02:34 [ 39/407] test_bool 0:02:34 [ 40/407] test_buffer 0:03:18 [ 41/407] test_bufio -- test_buffer passed in 43 sec 970 ms 0:03:22 [ 42/407] test_bytes 0:03:31 [ 43/407] test_bz2 0:03:39 [ 44/407] test_calendar 0:03:58 [ 45/407] test_call 0:03:59 [ 46/407] test_capi 0:04:12 [ 47/407] test_cgi 0:04:12 [ 48/407] test_cgitb 0:04:14 [ 49/407] test_charmapcodec 0:04:15 [ 50/407] test_class 0:04:15 [ 51/407] test_cmath 0:04:15 [ 52/407] test_cmd 0:04:16 [ 53/407] test_cmd_line 0:04:38 [ 54/407] test_cmd_line_script 0:05:19 [ 55/407] test_code -- test_cmd_line_script passed in 41 sec 453 ms 0:05:19 [ 56/407] test_code_module 0:05:20 [ 57/407] test_codeccallbacks 0:05:20 [ 58/407] test_codecencodings_cn 0:05:21 [ 59/407] test_codecencodings_hk 0:05:22 [ 60/407] test_codecencodings_iso2022 0:05:23 [ 61/407] test_codecencodings_jp 0:05:26 [ 62/407] test_codecencodings_kr 0:05:27 [ 63/407] test_codecencodings_tw 0:05:27 [ 64/407] test_codecmaps_cn 0:05:27 [ 65/407] test_codecmaps_hk 0:05:28 [ 66/407] test_codecmaps_jp 0:05:28 [ 67/407] test_codecmaps_kr 0:05:28 [ 68/407] test_codecmaps_tw 0:05:28 [ 69/407] test_codecs 0:05:35 [ 70/407] test_codeop 0:05:35 [ 71/407] test_collections 0:05:39 [ 72/407] test_colorsys 0:05:39 [ 73/407] test_compare 0:05:39 [ 74/407] test_compile 0:05:40 [ 75/407] test_compileall 0:06:27 [ 76/407] test_complex -- test_compileall passed in 46 sec 78 ms 0:06:28 [ 77/407] test_concurrent_futures 0:08:34 [ 78/407] test_configparser -- test_concurrent_futures passed in 2 min 6 sec 0:08:36 [ 79/407] test_contains 0:08:37 [ 80/407] test_contextlib 0:08:37 [ 81/407] test_copy 0:08:37 [ 82/407] test_copyreg 0:08:38 [ 83/407] test_coroutines 0:08:39 [ 84/407] test_cprofile 0:08:40 [ 85/407] test_crashers 0:08:40 [ 86/407] test_crypt 0:08:40 [ 87/407] test_csv -- test_crypt skipped 0:08:41 [ 88/407] test_ctypes 0:08:44 [ 89/407] test_curses 0:08:44 [ 90/407] test_datetime -- test_curses skipped (resource denied) 0:08:50 [ 91/407] test_dbm 0:08:51 [ 92/407] test_dbm_dumb 0:08:52 [ 93/407] test_dbm_gnu 0:08:52 [ 94/407] test_dbm_ndbm -- test_dbm_gnu skipped 0:08:52 [ 95/407] test_decimal -- test_dbm_ndbm skipped 0:09:14 [ 96/407] test_decorators 0:09:14 [ 97/407] test_defaultdict 0:09:14 [ 98/407] test_deque 0:09:25 [ 99/407] test_descr 0:09:30 [100/407] test_descrtut 0:09:31 [101/407] test_devpoll 0:09:31 [102/407] test_dict_version -- test_devpoll skipped 0:09:31 [103/407] test_dictcomps 0:09:31 [104/407] test_dictviews 0:09:32 [105/407] test_difflib 0:09:37 [106/407] test_dis 0:09:38 [107/407] test_distutils xxmodule.c E:\RepoGiT\cpython\include\Python.h(8): fatal error C1083: No se puede abrir el archivo incluir: 'pyconfig.h': No such file or directory foo.c Creando biblioteca D:\Users\yorch\AppData\Local\Temp\tmpjxcggbzn\tempt\Users\yorch\AppData\Local\Temp\tmpi66qfp2r\foo.cp36-win_amd64.lib y objeto D:\Users\yorch\AppData\Local\Temp\tmpjxcggbzn\tempt\Users\yorch\AppData\Local\Temp\tmpi66qfp2r\foo.cp36-win_amd64.exp Generando c?digo Generaci?n de c?digo finalizada foo.c Creando biblioteca D:\Users\yorch\AppData\Local\Temp\tmpjxcggbzn\tempt\Users\yorch\AppData\Local\Temp\tmpi66qfp2r\foo.cp36-win_amd64.lib y objeto D:\Users\yorch\AppData\Local\Temp\tmpjxcggbzn\tempt\Users\yorch\AppData\Local\Temp\tmpi66qfp2r\foo.cp36-win_amd64.exp Generando c?digo Generaci?n de c?digo finalizada xxmodule.c E:\RepoGiT\cpython\include\Python.h(8): fatal error C1083: No se puede abrir el archivo incluir: 'pyconfig.h': No such file or directory foo.c Creando biblioteca D:\Users\yorch\AppData\Local\Temp\tmpc9c13nr5\tempt\Users\yorch\AppData\Local\Temp\tmpb0jw9032\foo.cp36-win_amd64.lib y objeto D:\Users\yorch\AppData\Local\Temp\tmpc9c13nr5\tempt\Users\yorch\AppData\Local\Temp\tmpb0jw9032\foo.cp36-win_amd64.exp Generando c?digo Generaci?n de c?digo finalizada foo.c Creando biblioteca D:\Users\yorch\AppData\Local\Temp\tmpc9c13nr5\tempt\Users\yorch\AppData\Local\Temp\tmpb0jw9032\foo.cp36-win_amd64.lib y objeto D:\Users\yorch\AppData\Local\Temp\tmpc9c13nr5\tempt\Users\yorch\AppData\Local\Temp\tmpb0jw9032\foo.cp36-win_amd64.exp Generando c?digo Generaci?n de c?digo finalizada xxmodule.c E:\RepoGiT\cpython\include\Python.h(8): fatal error C1083: No se puede abrir el archivo incluir: 'pyconfig.h': No such file or directory D:\Users\yorch\AppData\Local\Temp\test_python_17544>exit 1 D:\Users\yorch\AppData\Local\Temp\test_python_17544>exit 0 0:10:22 [108/407] test_docxmlrpc -- test_distutils failed in 43 sec 783 ms 0:10:32 [109/407] test_dtrace 0:10:32 [110/407] test_dummy_thread 0:10:32 [111/407] test_dummy_threading 0:10:32 [112/407] test_dynamic 0:10:33 [113/407] test_dynamicclassattribute 0:10:33 [114/407] test_eintr 0:10:33 [115/407] test_email 0:10:46 [116/407] test_ensurepip 0:10:47 [117/407] test_enum 0:10:48 [118/407] test_enumerate 0:10:49 [119/407] test_eof 0:10:49 [120/407] test_epoll 0:10:49 [121/407] test_errno -- test_epoll skipped 0:10:50 [122/407] test_exception_hierarchy 0:10:50 [123/407] test_exception_variations 0:10:50 [124/407] test_extcall 0:10:51 [125/407] test_faulthandler 0:11:19 [126/407] test_fcntl 0:11:19 [127/407] test_file -- test_fcntl skipped 0:11:20 [128/407] test_file_eintr 0:11:20 [129/407] test_filecmp 0:11:21 [130/407] test_fileinput 0:11:21 [131/407] test_fileio 0:11:22 [132/407] test_finalization 0:11:26 [133/407] test_float 0:11:27 [134/407] test_flufl 0:11:27 [135/407] test_fnmatch 0:11:28 [136/407] test_fork1 0:11:28 [137/407] test_format -- test_fork1 skipped 0:11:28 [138/407] test_fractions 0:11:29 [139/407] test_frame 0:11:29 [140/407] test_fstring 0:11:31 [141/407] test_ftplib 0:11:40 [142/407] test_funcattrs 0:11:40 [143/407] test_functools 0:11:41 [144/407] test_future 0:11:42 [145/407] test_future3 0:11:42 [146/407] test_future4 0:11:42 [147/407] test_future5 0:11:43 [148/407] test_gc 0:11:52 [149/407] test_gdb 0:11:53 [150/407] test_generator_stop -- test_gdb skipped 0:11:53 [151/407] test_generators 0:11:54 [152/407] test_genericpath 0:11:54 [153/407] test_genexps 0:11:55 [154/407] test_getargs2 0:11:55 [155/407] test_getopt 0:11:55 [156/407] test_getpass 0:11:56 [157/407] test_gettext 0:11:56 [158/407] test_glob 0:12:02 [159/407] test_global 0:12:02 [160/407] test_grp 0:12:02 [161/407] test_gzip -- test_grp skipped 0:12:05 [162/407] test_hash 0:12:14 [163/407] test_hashlib 0:12:16 [164/407] test_heapq 0:12:20 [165/407] test_hmac 0:12:21 [166/407] test_html 0:12:21 [167/407] test_htmlparser 0:12:22 [168/407] test_http_cookiejar 0:12:22 [169/407] test_http_cookies 0:12:23 [170/407] test_httplib 0:12:31 [171/407] test_httpservers 0:12:38 [172/407] test_idle -- test_httpservers failed 0:12:41 [173/407] test_imaplib 0:12:50 [174/407] test_imghdr 0:12:50 [175/407] test_imp 0:12:50 [176/407] test_import 0:12:55 [177/407] test_importlib 0:13:05 [178/407] test_index 0:13:05 [179/407] test_inspect 0:13:09 [180/407] test_int 0:13:10 [181/407] test_int_literal 0:13:10 [182/407] test_io 0:13:55 [183/407] test_ioctl -- test_io passed in 45 sec 312 ms 0:13:56 [184/407] test_ipaddress -- test_ioctl skipped 0:13:57 [185/407] test_isinstance 0:13:57 [186/407] test_iter 0:13:58 [187/407] test_iterlen 0:13:59 [188/407] test_itertools 0:14:22 [189/407] test_json 0:14:32 [190/407] test_keyword 0:14:35 [191/407] test_keywordonlyarg 0:14:35 [192/407] test_kqueue 0:14:36 [193/407] test_largefile -- test_kqueue skipped 0:14:36 [194/407] test_lib2to3 0:15:42 [195/407] test_linecache -- test_lib2to3 passed in 1 min 5 sec 0:15:42 [196/407] test_list 0:15:44 [197/407] test_listcomps 0:15:44 [198/407] test_locale 0:15:45 [199/407] test_logging 0:16:03 [200/407] test_long 0:16:18 [201/407] test_longexp 0:16:19 [202/407] test_lzma 0:16:25 [203/407] test_macpath 0:16:26 [204/407] test_macurl2path 0:16:26 [205/407] test_mailbox 0:16:31 [206/407] test_mailcap 0:16:31 [207/407] test_marshal 0:16:33 [208/407] test_math 0:16:42 [209/407] test_memoryio 0:16:43 [210/407] test_memoryview 0:16:47 [211/407] test_metaclass 0:16:47 [212/407] test_mimetypes 0:16:48 [213/407] test_minidom 0:16:49 [214/407] test_mmap 0:16:50 [215/407] test_module 0:16:52 [216/407] test_modulefinder 0:16:54 [217/407] test_msilib 0:16:54 [218/407] test_multibytecodec 0:17:01 [219/407] test_multiprocessing_fork 0:17:01 [220/407] test_multiprocessing_forkserver -- test_multiprocessing_fork skipped 0:17:01 [221/407] test_multiprocessing_main_handling -- test_multiprocessing_forkserver skipped 0:17:02 [222/407] test_multiprocessing_spawn -- test_multiprocessing_main_handling skipped 0:17:02 [223/407] test_netrc -- test_multiprocessing_spawn skipped 0:17:03 [224/407] test_nis 0:17:03 [225/407] test_nntplib -- test_nis skipped 0:17:04 [226/407] test_normalization 0:17:04 [227/407] test_ntpath 0:17:05 [228/407] test_numeric_tower 0:17:07 [229/407] test_openpty 0:17:07 [230/407] test_operator -- test_openpty skipped 0:17:08 [231/407] test_optparse 0:17:08 [232/407] test_ordered_dict 0:17:16 [233/407] test_os 0:17:33 [234/407] test_ossaudiodev 0:17:34 [235/407] test_osx_env -- test_ossaudiodev skipped (resource denied) 0:17:34 [236/407] test_parser 0:17:35 [237/407] test_pathlib 0:17:38 [238/407] test_pdb 0:17:41 [239/407] test_peepholer 0:17:42 [240/407] test_pickle 0:18:17 [241/407] test_pickletools -- test_pickle passed in 35 sec 298 ms 0:18:25 [242/407] test_pipes 0:18:26 [243/407] test_pkg -- test_pipes skipped 0:18:26 [244/407] test_pkgimport 0:18:27 [245/407] test_pkgutil 0:18:27 [246/407] test_platform b'' b"Fatal Python error: Py_Initialize: unable to load the file system codec\nModuleNotFoundError: No module named 'encodings'\n\nCurrent thread 0x000036ac (most recent call first):\n" 0:18:30 [247/407] test_plistlib -- test_platform failed 0:18:30 [248/407] test_poll 0:18:31 [249/407] test_popen -- test_poll skipped 0:18:32 [250/407] test_poplib 0:18:39 [251/407] test_posix 0:18:40 [252/407] test_posixpath -- test_posix skipped 0:18:41 [253/407] test_pow 0:18:42 [254/407] test_pprint 0:18:42 [255/407] test_print 0:18:43 [256/407] test_profile 0:18:43 [257/407] test_property 0:18:44 [258/407] test_pstats 0:18:44 [259/407] test_pty 0:18:45 [260/407] test_pulldom -- test_pty skipped 0:18:45 [261/407] test_pwd 0:18:46 [262/407] test_py_compile -- test_pwd skipped 0:18:46 [263/407] test_pyclbr 0:18:57 [264/407] test_pydoc 0:19:08 [265/407] test_pyexpat 0:19:09 [266/407] test_queue 0:19:13 [267/407] test_quopri 0:19:14 [268/407] test_raise 0:19:14 [269/407] test_random 0:19:19 [270/407] test_range 0:19:23 [271/407] test_re 0:19:29 [272/407] test_readline 0:19:29 [273/407] test_regrtest -- test_readline skipped 0:21:06 [274/407] test_repl -- test_regrtest failed in 1 min 36 sec 0:21:07 [275/407] test_reprlib 0:21:07 [276/407] test_resource 0:21:08 [277/407] test_richcmp -- test_resource skipped 0:21:08 [278/407] test_rlcompleter 0:21:09 [279/407] test_robotparser 0:21:09 [280/407] test_runpy 0:21:20 [281/407] test_sax 0:21:21 [282/407] test_sched 0:21:22 [283/407] test_scope 0:21:23 [284/407] test_script_helper 0:21:25 [285/407] test_secrets 0:21:25 [286/407] test_select 0:21:26 [287/407] test_selectors 0:21:28 [288/407] test_set 0:21:36 [289/407] test_setcomps 0:21:37 [290/407] test_shelve 0:21:38 [291/407] test_shlex 0:21:38 [292/407] test_shutil 0:21:40 [293/407] test_signal 0:21:43 [294/407] test_site 0:21:52 [295/407] test_slice 0:21:53 [296/407] test_smtpd 0:21:54 [297/407] test_smtplib 0:21:55 [298/407] test_smtpnet 0:21:56 [299/407] test_sndhdr -- test_smtpnet skipped (resource denied) 0:21:56 [300/407] test_socket 0:22:20 [301/407] test_socketserver 0:22:20 [302/407] test_sort -- test_socketserver skipped (resource denied) 0:22:21 [303/407] test_source_encoding 0:22:26 [304/407] test_spwd 0:22:26 [305/407] test_sqlite -- test_spwd skipped 0:22:28 [306/407] test_ssl 0:22:37 [307/407] test_startfile 0:22:38 [308/407] test_stat 0:22:39 [309/407] test_statistics 0:22:43 [310/407] test_strftime 0:22:44 [311/407] test_string 0:22:45 [312/407] test_string_literals 0:22:47 [313/407] test_stringprep 0:22:47 [314/407] test_strptime 0:22:48 [315/407] test_strtod 0:22:53 [316/407] test_struct 0:22:56 [317/407] test_structmembers 0:22:57 [318/407] test_structseq 0:22:57 [319/407] test_subclassinit 0:22:58 [320/407] test_subprocess 0:22:58 [321/407] test_sunau -- test_subprocess skipped 0:22:59 [322/407] test_sundry 0:22:59 [323/407] test_super 0:23:00 [324/407] test_symbol 0:23:01 [325/407] test_symtable 0:23:01 [326/407] test_syntax 0:23:02 [327/407] test_sys 0:23:13 [328/407] test_sys_setprofile 0:23:14 [329/407] test_sys_settrace 0:23:15 [330/407] test_sysconfig (b'', b"Fatal Python error: Py_Initialize: unable to load the file system codec\nModuleNotFoundError: No module named 'encodings'\n\nCurrent thread 0x00001ff4 (most recent call first):\n") 0:23:16 [331/407] test_syslog -- test_sysconfig failed 0:23:16 [332/407] test_tarfile -- test_syslog skipped 0:24:10 [333/407] test_tcl -- test_tarfile passed in 53 sec 625 ms 0:24:13 [334/407] test_telnetlib 0:24:13 [335/407] test_tempfile 0:24:24 [336/407] test_textwrap 0:24:24 [337/407] test_thread 0:24:26 [338/407] test_threaded_import 0:24:29 [339/407] test_threadedtempfile 0:24:30 [340/407] test_threading 0:24:45 [341/407] test_threading_local 0:24:47 [342/407] test_threadsignals 0:24:48 [343/407] test_time -- test_threadsignals skipped 0:24:50 [344/407] test_timeit 0:24:51 [345/407] test_timeout 0:24:51 [346/407] test_tix -- test_timeout skipped (resource denied) 0:24:52 [347/407] test_tk -- test_tix skipped (resource denied) 0:24:52 [348/407] test_tokenize -- test_tk skipped (resource denied) 0:25:01 [349/407] test_tools 0:25:34 [350/407] test_trace -- test_tools passed in 33 sec 298 ms 0:26:01 [351/407] test_traceback 0:26:10 [352/407] test_tracemalloc 0:26:17 [353/407] test_ttk_guionly 0:26:59 [354/407] test_ttk_textonly -- test_ttk_guionly skipped (resource denied) in 42 sec 625 ms 0:27:00 [355/407] test_tuple 0:27:18 [356/407] test_turtle 0:27:18 [357/407] test_typechecks 0:27:19 [358/407] test_typing 0:27:20 [359/407] test_ucn 0:27:21 [360/407] test_unary 0:27:22 [361/407] test_unicode 0:27:28 [362/407] test_unicode_file 0:27:28 [363/407] test_unicode_file_functions 0:27:30 [364/407] test_unicode_identifiers 0:27:30 [365/407] test_unicodedata 0:27:44 [366/407] test_univnewlines 0:27:45 [367/407] test_unpack 0:27:45 [368/407] test_unpack_ex 0:27:46 [369/407] test_urllib 0:27:48 [370/407] test_urllib2 0:27:50 [371/407] test_urllib2_localnet 0:28:10 [372/407] test_urllib2net 0:28:11 [373/407] test_urllib_response -- test_urllib2net skipped (resource denied) 0:28:11 [374/407] test_urllibnet 0:28:12 [375/407] test_urlparse -- test_urllibnet skipped (resource denied) 0:28:12 [376/407] test_userdict 0:28:13 [377/407] test_userlist 0:28:14 [378/407] test_userstring 0:28:21 [379/407] test_utf8source 0:28:21 [380/407] test_uu 0:28:22 [381/407] test_uuid 0:28:22 [382/407] test_venv 0:29:19 [383/407] test_wait3 -- test_venv passed in 56 sec 531 ms 0:29:19 [384/407] test_wait4 -- test_wait3 skipped 0:29:20 [385/407] test_warnings -- test_wait4 skipped 0:29:28 [386/407] test_wave 0:29:29 [387/407] test_weakref 0:30:48 [388/407] test_weakset -- test_weakref passed in 1 min 18 sec 0:30:50 [389/407] test_webbrowser 0:30:50 [390/407] test_winconsoleio ?^Z abc123 ?????? A?B ??AA? ??? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 0:30:51 [391/407] test_winreg 0:30:54 [392/407] test_winsound 0:30:54 [393/407] test_with -- test_winsound skipped (resource denied) 0:30:55 [394/407] test_wsgiref 0:30:56 [395/407] test_xdrlib 0:30:56 [396/407] test_xml_dom_minicompat 0:30:57 [397/407] test_xml_etree 0:31:00 [398/407] test_xml_etree_c 0:31:04 [399/407] test_xmlrpc 0:31:11 [400/407] test_xmlrpc_net 0:31:11 [401/407] test_yield_from -- test_xmlrpc_net skipped (resource denied) 0:31:12 [402/407] test_zipapp 0:31:13 [403/407] test_zipfile 0:31:38 [404/407] test_zipfile64 0:31:39 [405/407] test_zipimport -- test_zipfile64 skipped (resource denied) 0:31:40 [406/407] test_zipimport_support 0:31:44 [407/407] test_zlib Total duration: 31 min 46 sec Tests result: FAILURE E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" "E:\RepoGiT\cpython\PCbuild\\pythoncore.vcxproj" /t:KillPython /nologo /v:m /p:Configuration=PGInstrument /p:Platform=x64 /p:KillPython=true Killing any running python.exe instances... E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" "E:\RepoGiT\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /p:Configuration=PGUpdate /p:Platform=x64 /p:IncludeExternals=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" Killing any running python.exe instances... E:\RepoGiT\cpython\PCbuild\pyproject.props(173,5): error : PGO run did not succeed (no python36!*.pgc files) and there is no data to merge [E:\RepoGiT\cpython\PCbuild\pythoncore.vcxproj] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 13:28:59 2018 From: report at bugs.python.org (Petter S) Date: Sun, 04 Nov 2018 18:28:59 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1541356139.04.0.788709270274.issue27682@psf.upfronthosting.co.za> Petter S added the comment: > I think this is what Petter is trying to do in . That's right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:07:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 19:07:07 +0000 Subject: [issue35163] locale: setlocale(..., 'eo') sets non-existing locale In-Reply-To: <1541346877.51.0.788709270274.issue35163@psf.upfronthosting.co.za> Message-ID: <1541358427.31.0.788709270274.issue35163@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:16:55 2018 From: report at bugs.python.org (Denis Osipov) Date: Sun, 04 Nov 2018 19:16:55 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541359015.0.0.788709270274.issue35119@psf.upfronthosting.co.za> Change by Denis Osipov : ---------- keywords: +patch pull_requests: +9625 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:31:03 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 19:31:03 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541359863.25.0.788709270274.issue33486@psf.upfronthosting.co.za> Ned Deily added the comment: If we are going to bump the tools version from 2.65 to 2.69 for master, we should probably bump them for all active branches. It creates confusion and makes backporting more difficult. Besides, it appears that, at the moment, the checked-in configure files for 3.7, 3.6, and 2.7 were all generated with 2.69 anyway :) if doing so, the reference to 2.65 in the devguide setup.rst should also be updated. ---------- status: closed -> open versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:31:20 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 19:31:20 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541359880.4.0.788709270274.issue33486@psf.upfronthosting.co.za> Change by Ned Deily : ---------- resolution: fixed -> stage: resolved -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:34:06 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 19:34:06 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541360046.31.0.788709270274.issue33486@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Hi Ned, thanks for this clarification ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:34:23 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 19:34:23 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541360063.83.0.788709270274.issue33486@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- pull_requests: +9626 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:43:32 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 19:43:32 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541360612.13.0.788709270274.issue33486@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: -9626 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:43:41 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 19:43:41 +0000 Subject: [issue33486] regen autotools related files In-Reply-To: <1526238483.3.0.682650639539.issue33486@psf.upfronthosting.co.za> Message-ID: <1541360621.91.0.788709270274.issue33486@psf.upfronthosting.co.za> Change by Ned Deily : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:47:23 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 04 Nov 2018 19:47:23 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541360843.35.0.788709270274.issue10536@psf.upfronthosting.co.za> ?ric Araujo added the comment: I will try to find some time in the next month! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 14:54:20 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 19:54:20 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541361260.74.0.788709270274.issue10536@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Serhyi and Eric, for which version of Python, only 2.7? or master, 3.6 & 3.7? ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:02:43 2018 From: report at bugs.python.org (Roffild) Date: Sun, 04 Nov 2018 20:02:43 +0000 Subject: [issue35154] subprocess.list2cmdline() does not allow running some commands. In-Reply-To: <1541278553.41.0.788709270274.issue35154@psf.upfronthosting.co.za> Message-ID: <1541361763.54.0.788709270274.issue35154@psf.upfronthosting.co.za> Roffild added the comment: Yes, the string with spaces must be enclosed in double quotes. But when a programmer calls CreateProcess(), he himself puts double quotes or calls CommandLineToArgvW(). subprocess.list2cmdline() is always called and can spoil the launch string. I propose to add an additional argument list2cmdline=False in subprocess.run() to disable this function. subprocess.run(['"program path"', '/param="space space"'], list2cmdline=False) subprocess.run('"program path" /param="space space"', list2cmdline=False) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:22:21 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 04 Nov 2018 20:22:21 +0000 Subject: [issue35108] inspect.getmembers passes exceptions from object's properties through In-Reply-To: <1540887635.53.0.788709270274.issue35108@psf.upfronthosting.co.za> Message-ID: <1541362941.43.0.788709270274.issue35108@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: There are some relevant docs in the inspect module about properties triggering code execution and thus using getattr_static to fetch attributes. Ref : https://docs.python.org/3/library/inspect.html#fetching-attributes-statically . I tried the below and it passes for your code but there might be still cases where getattr_static triggers an exception too where we need to decide whether to skip the attribute from being listed and if so with a test for the scenario. Using getattr_static first causes test_inspect.TestPredicates.test_get_slot_members to fail by including slot_member. Thus we try for getattr and if it raises an exception that is not AttributeError (@property might also raise AttributeError consciously at runtime) and then use getattr_static in case of exception other than AttributeError. This helps in passing the test suite and also the example attached listing bar which raises NotImplementedError or other Exceptions. diff --git a/Lib/inspect.py b/Lib/inspect.py index b8a142232b..9df2173e0c 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -341,7 +341,12 @@ def getmembers(object, predicate=None): # like calling their __get__ (see bug #1785), so fall back to # looking in the __dict__. try: - value = getattr(object, key) + try: + value = getattr(object, key) + except Exception as e: + if isinstance(e, AttributeError): + raise e + value = getattr_static(object, key) # handle the duplicate key if key in processed: raise AttributeError I am adding Yury. Removing 3.5 and 3.4 since they are in security fixes only mode. Also see issue30533 a proposal for implementation of getmembers that uses getattr_static instead of getattr. Thanks ---------- nosy: +yselivanov versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:26:54 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 04 Nov 2018 20:26:54 +0000 Subject: [issue30533] missing feature in inspect module: getmembers_static In-Reply-To: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za> Message-ID: <1541363214.77.0.788709270274.issue30533@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: +1 from me too. issue35108 could help from this implementation where properties execute code that might cause runtime exception. Initially I tried using getattr_static inside getmembers at msg329254 but I think a separate function or an option to use getattr_static only in getmembers is more clean. Bumping the version to 3.8. Thanks! ---------- nosy: +xtreak versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:39:02 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Nov 2018 20:39:02 +0000 Subject: [issue35154] subprocess.list2cmdline() does not allow running some commands. In-Reply-To: <1541278553.41.0.788709270274.issue35154@psf.upfronthosting.co.za> Message-ID: <1541363942.48.0.788709270274.issue35154@psf.upfronthosting.co.za> Eryk Sun added the comment: > he himself puts double quotes or calls CommandLineToArgvW CommandLineToArgvW has nothing to do with creating a command line for use with CreateProcess. It's used by a process to parse its own command line using the common VC++ rules. > subprocess.list2cmdline() is always called No, it's only called for an args sequence, not a command-line string. If you have your own function to convert a sequence to a command-line, then call it explicitly, e.g. subprocess.run(mylist2cmdline(args)). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:41:36 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 20:41:36 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation In-Reply-To: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> Message-ID: <1541364096.56.0.788709270274.issue35159@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 0edc7b1b1a2b22d4d200f80995454d01927bf93e by Julien Palard (St?phane Wirtel) in branch 'master': bpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) (GH-10316) https://github.com/python/cpython/commit/0edc7b1b1a2b22d4d200f80995454d01927bf93e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:41:58 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 20:41:58 +0000 Subject: [issue35159] Add a link to the devguide in the sidebar of the documentation In-Reply-To: <1541318229.4.0.788709270274.issue35159@psf.upfronthosting.co.za> Message-ID: <1541364118.64.0.788709270274.issue35159@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 15:59:02 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 20:59:02 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541365142.23.0.788709270274.issue10536@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- pull_requests: +9627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:02:02 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 21:02:02 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541365322.75.0.788709270274.issue10536@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Serhiy & ?ric, I have ported the patch to a PR for master (3.8). I have removed the double spaces and some useless diffs. You will find my diff file I have used for the PR. the git revision was 5d744a8855bb4d411e5f32cfd365f0581e30ef48 Author: Stefan Krah Date: Fri Nov 26 11:07:04 2010 +0000 Merged revisions 86791 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r86791 | stefan.krah | 2010-11-26 11:54:09 +0100 (Fri, 26 Nov 2010) | 1 line Indentation cleanup. ---------- Added file: https://bugs.python.org/file47904/bpo-10536.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:02:14 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 04 Nov 2018 21:02:14 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541365334.47.0.788709270274.issue10536@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:21:30 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:21:30 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541366490.75.0.788709270274.issue21263@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 59668aa8b7f174b59304eab833c1c1181886c3c6 by Ned Deily (Lysandros Nikolaou) in branch 'master': bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) https://github.com/python/cpython/commit/59668aa8b7f174b59304eab833c1c1181886c3c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:21:48 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Nov 2018 21:21:48 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541366508.04.0.788709270274.issue21263@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:24:03 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Nov 2018 21:24:03 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541366643.25.0.788709270274.issue21263@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:31:17 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 21:31:17 +0000 Subject: [issue25410] Clean up and fix OrderedDict In-Reply-To: <1444896308.75.0.718152743923.issue25410@psf.upfronthosting.co.za> Message-ID: <1541367077.4.0.788709270274.issue25410@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Maybe it's considered undefined behavior for a subclass to use > a method of one of its bases which it has overriden. In general, it's true that if OrderedDict is a subclass of dict, then it would have no defense against someone making a direct call to the dict base class. Such a call should be expected to violate the OrderedDicts invariants. > it's a complete coin toss on whether one of the many internal > API function will set an attribute or name via PyDict_SetItem > or PyObject_SetItem. Not really. The CPython source is supposed to only call PyDict_SetItem when the target is known to be an exact dictionary. If you find a case where that isn't true, please file a bug report and we'll fix it. > It might be more appropriate to start a new issue for this, but I'll > leave that decision to somehow who would know for sure. No need. We've known about this sort of problem for years. See https://bugs.python.org/issue10977 for example. There isn't really much we could do about it without causing other issues that would be worse. FWIW, this doesn't seem to be a problem in practice. Further, OrderedDict is expected to become less relevant now that regular dicts are order preserving. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:40:05 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:40:05 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541367605.67.0.788709270274.issue21263@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10325) https://github.com/python/cpython/commit/96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:40:28 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:40:28 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541367628.14.0.788709270274.issue21263@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8 by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10326) https://github.com/python/cpython/commit/f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:42:41 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:42:41 +0000 Subject: [issue21263] test_gdb failures on os x 10.9.2 In-Reply-To: <1397674257.45.0.239061101467.issue21263@psf.upfronthosting.co.za> Message-ID: <1541367761.65.0.788709270274.issue21263@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, everyone! Fixed for 3.8.0, 3.7.2, and 3.6.8. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:46:48 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 21:46:48 +0000 Subject: [issue31873] Inconsistent capitalization of proper noun - Unicode. In-Reply-To: <1509023732.92.0.213398074469.issue31873@psf.upfronthosting.co.za> Message-ID: <1541368008.91.0.788709270274.issue31873@psf.upfronthosting.co.za> Julien Palard added the comment: Currently in our documentation there's 89 "Unicode obj" vs 8 "unicode obj" so I'll go for it. ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:48:42 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sun, 04 Nov 2018 21:48:42 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1541368122.17.0.788709270274.issue24916@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Following up on https://github.com/python/cpython/pull/10321#discussion_r230604393 I would like to summarise here what's been going on, in order to move the discussion here forward. I've tried to make a PR for this issue, in which _PY_VERSION in Lib/sysconfig.py and py_version in Lib/distutils/command/install.py are updated to get their value from sys.version_info instead of sys.version. This PR removes the '+' from both so the issue remains, if we want to keep the '+' info or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 16:52:30 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 21:52:30 +0000 Subject: [issue30999] statistics module: add "key" keyword argument to median, mode, ... In-Reply-To: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za> Message-ID: <1541368350.2.0.788709270274.issue30999@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This issue (as originally proposed) should be closed. A key function for median() and mode() likely isn't a good idea. Those two functions should be kept parallel with mean() as returning simple descriptive statistics. Work towards a select() function with a key function can be pursued in a separate tracker item. That would suffice to locate a specific record occurring at a median (or quartile or decile). FWIW, that is how MS Excel approaches the problem as well (using RANK with INDEX to locate a record by its sort position, leaving AVERAGE, MODE.SNGL, and MEDIAN for straight descriptive statistics). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:02:49 2018 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sun, 04 Nov 2018 22:02:49 +0000 Subject: [issue31873] Inconsistent capitalization of proper noun - Unicode. In-Reply-To: <1509023732.92.0.213398074469.issue31873@psf.upfronthosting.co.za> Message-ID: <1541368969.49.0.788709270274.issue31873@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: If you want to do this correctly, you have to check each case: * if "unicode object" refers to a C PyUnicode object, it's probably better to use "PyUnicode object" * if "unicode object" refers to a C PyObject object, with type "unicode", it's probably better to leave it as is * if "unicode object" refers to a Python unicode object, it's probably better to call it "Unicode string object" or just "string object" in Python 3 * if "unicode object" does not indicate whether Python or C is meant, "Unicode object" is probably better ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:12:36 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Nov 2018 22:12:36 +0000 Subject: [issue31887] docs for email.generator are missing a comment on special multipart/signed handling In-Reply-To: <1509125027.89.0.213398074469.issue31887@psf.upfronthosting.co.za> Message-ID: <1541369556.91.0.788709270274.issue31887@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 622935d9a69d12e125e470ce9a9ff3cad9e8e296 by Miss Islington (bot) (Saptak Sengupta) in branch 'master': bpo-31887: Adds documentations for special multipart/signed handling (GH-4268) https://github.com/python/cpython/commit/622935d9a69d12e125e470ce9a9ff3cad9e8e296 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:19:48 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 22:19:48 +0000 Subject: [issue35034] Add closing and iteration to threading.Queue In-Reply-To: <1540078155.51.0.788709270274.issue35034@psf.upfronthosting.co.za> Message-ID: <1541369988.56.0.788709270274.issue35034@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I've put some more thought into this and have discussed it with another core developer. While the idea was inspired, I think we should decline the API expansion. When I last talked with Guido about this module, he opined that he didn't want to module to get further into the business of moderating between the producer and consumer, that it should focus on its core task of being a one-way thread-safe message queue. I agree that users do craft various ways of communicating via sentinel objects; however, there is no one pattern that dominates so much that it warrants deforming the API to accommodate. FWIW, I use email as the basis for my mental model of how Queue is used. With email, we don't don't need a special part of the API to communicate that we're not going to send messages any more; instead, we either stop sending messages or send a farewell message. Of the two ideas, making queues iterable is more plausible. However, it doesn't fit will common ways of using a queue. For non-blocking queues it makes zero sense. For daemon threads that block until sent a message, the usual pattern is while True loop that blocks on a get(). In such a case, a for-loop might be more compact but doesn't reflect how we think about the problem (implying that the loop may terminate and it obscures that the get() is what is actually blocking). Sorry for taking a while to evaluate this. I looked at the effort you put in to the patch and wanted to really think it through. This idea is inspired, but in the end I don't think it is a good fit for how people typically use the Queue module (or its cousin in the Multiprocessing module). Do consider posting a queue variant to the Python Package Index. Though not for all users, there may well be some uptake for a few users. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:24:44 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 22:24:44 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541370284.26.0.788709270274.issue10536@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 55f3317e984cc35bd18ba0326ed98766a2750ffd by Julien Palard (St?phane Wirtel) in branch 'master': bpo-10536: Enhancements to gettext docs (GH-10324) https://github.com/python/cpython/commit/55f3317e984cc35bd18ba0326ed98766a2750ffd ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:27:10 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 22:27:10 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541370430.24.0.788709270274.issue10536@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:34:24 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 22:34:24 +0000 Subject: [issue35118] Add peek() or first() method in queue In-Reply-To: <1540956018.19.0.788709270274.issue35118@psf.upfronthosting.co.za> Message-ID: <1541370864.8.0.788709270274.issue35118@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 98b85354153883b0a080f678f213729cd0764fee by Raymond Hettinger (Windson yang) in branch 'master': bpo-35118: Improve docs regarding indexing (GH-10265) https://github.com/python/cpython/commit/98b85354153883b0a080f678f213729cd0764fee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:34:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 22:34:54 +0000 Subject: [issue35118] Add peek() or first() method in queue In-Reply-To: <1540956018.19.0.788709270274.issue35118@psf.upfronthosting.co.za> Message-ID: <1541370894.32.0.788709270274.issue35118@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:36:27 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Nov 2018 22:36:27 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1541370987.64.0.788709270274.issue9842@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b4db249c9544fc4425c32feb86d610f3224ca3d8 by Miss Islington (bot) (Pablo Galindo) in branch 'master': bpo-9842: Add cross-reference to the ellipsis object (GH-4063) https://github.com/python/cpython/commit/b4db249c9544fc4425c32feb86d610f3224ca3d8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:40:34 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Nov 2018 22:40:34 +0000 Subject: [issue19675] Pool dies with excessive workers, but does not cleanup In-Reply-To: <1384998739.89.0.441869255184.issue19675@psf.upfronthosting.co.za> Message-ID: <1541371234.73.0.788709270274.issue19675@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 5d236cafd7126e640fb25541fcc7e0a494450143 by Julien Palard in branch 'master': bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614) https://github.com/python/cpython/commit/5d236cafd7126e640fb25541fcc7e0a494450143 ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 17:50:14 2018 From: report at bugs.python.org (ppperry) Date: Sun, 04 Nov 2018 22:50:14 +0000 Subject: [issue19675] Pool dies with excessive workers, but does not cleanup In-Reply-To: <1384998739.89.0.441869255184.issue19675@psf.upfronthosting.co.za> Message-ID: <1541371814.8.0.788709270274.issue19675@psf.upfronthosting.co.za> Change by ppperry : ---------- nosy: -ppperry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 18:12:15 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 04 Nov 2018 23:12:15 +0000 Subject: [issue35165] Possible wrong method name in attribute references doc In-Reply-To: <1541353400.8.0.788709270274.issue35165@psf.upfronthosting.co.za> Message-ID: <1541373135.04.0.788709270274.issue35165@psf.upfronthosting.co.za> Steven D'Aprano added the comment: https://docs.python.org/3/reference/expressions.html#attribute-references __getattr__ is the correct method to override in most (but not all) cases. I don't think we should encourage people to override __getattribute__ as the first resort. __getattribute__ is a more specialised method that is used by the interpreter at a deeper level. It is called on every attribute access, so it ought to be as fast as possible, while __getattr__ is only called if the named attribute doesn't exist. I don't think anything needs to change here. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 18:20:54 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Sun, 04 Nov 2018 23:20:54 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1541373654.19.0.788709270274.issue34022@psf.upfronthosting.co.za> Change by Elvis Pranskevichus : ---------- pull_requests: +9630 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 18:27:34 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Sun, 04 Nov 2018 23:27:34 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1541374054.24.0.788709270274.issue34022@psf.upfronthosting.co.za> Elvis Pranskevichus added the comment: https://github.com/python/cpython/pull/10327 fixes the remaining test failures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 18:58:27 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 04 Nov 2018 23:58:27 +0000 Subject: [issue32285] In `unicodedata`, it should be possible to check a unistr's normal form without necessarily copying it In-Reply-To: <1513041370.04.0.213398074469.issue32285@psf.upfronthosting.co.za> Message-ID: <1541375907.39.0.788709270274.issue32285@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 2810dd7be9876236f74ac80716d113572c9098dd by Benjamin Peterson (Max B?langer) in branch 'master': closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) https://github.com/python/cpython/commit/2810dd7be9876236f74ac80716d113572c9098dd ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 21:36:07 2018 From: report at bugs.python.org (Jonathan Gossage) Date: Mon, 05 Nov 2018 02:36:07 +0000 Subject: [issue35018] Sax parser provides no user access to lexical handlers In-Reply-To: <1539879741.38.0.788709270274.issue35018@psf.upfronthosting.co.za> Message-ID: <1541385367.01.0.788709270274.issue35018@psf.upfronthosting.co.za> Change by Jonathan Gossage : ---------- keywords: +patch pull_requests: +9631 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 21:36:07 2018 From: report at bugs.python.org (Jonathan Gossage) Date: Mon, 05 Nov 2018 02:36:07 +0000 Subject: [issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes In-Reply-To: <1250018393.94.0.435666063731.issue6686@psf.upfronthosting.co.za> Message-ID: <1541385367.07.0.663665092547.issue6686@psf.upfronthosting.co.za> Change by Jonathan Gossage : ---------- pull_requests: +9632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 21:36:07 2018 From: report at bugs.python.org (Jonathan Gossage) Date: Mon, 05 Nov 2018 02:36:07 +0000 Subject: [issue9731] Add ABCMeta.has_methods and tests that use it In-Reply-To: <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za> Message-ID: <1541385367.17.0.626387309121.issue9731@psf.upfronthosting.co.za> Change by Jonathan Gossage : ---------- pull_requests: +9633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 4 22:10:56 2018 From: report at bugs.python.org (Chris Jerdonek) Date: Mon, 05 Nov 2018 03:10:56 +0000 Subject: [issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close() In-Reply-To: <1483731701.21.0.630358100063.issue29183@psf.upfronthosting.co.za> Message-ID: <1541387456.08.0.788709270274.issue29183@psf.upfronthosting.co.za> Chris Jerdonek added the comment: This may or may not be the same as what you're suggesting, Martin. But is another option to make close() a no-op if it is called a second time? Otherwise, it seems we'd need to make sure that no code path can result in close() being called twice (even during exception handling, etc). ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 00:46:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 05:46:01 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1541396761.04.0.788709270274.issue9842@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 00:47:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 05:47:38 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1541396858.88.0.788709270274.issue9842@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 10330 adds few references for using an ellipsis as a placeholder. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 01:11:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 06:11:42 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541398302.54.0.788709270274.issue10536@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it is worth to enhance documentation for other versions too. See also my comments on GitHub. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 01:23:01 2018 From: report at bugs.python.org (Dan Snider) Date: Mon, 05 Nov 2018 06:23:01 +0000 Subject: [issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses Message-ID: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za> New submission from Dan Snider : >>> class Dict(dict): def keys(self): assert 0 def update(*args, **kwds): assert 0 def __getitem__(self, key): assert 0 def __iter__(self): assert 0 >>> {**Dict(a=1)} {'a': 1} The opcode uses PyDict_Update, which calls the internal dict_merge function which contains the following line: if (PyDict_Check(b) && (Py_TYPE(b)->tp_iter == (getiterfunc)dict_iter)) Translated to Python, that should be equal to if type(b).__flags__ & (1<<29) and type.__getattribute__(type(b), '__iter__') is type.__getattribute__(dict, '__iter__')` Both that and the line in C evaluate to false for me (while a dict subclass that doesn't override __iter__ evaluates to true), so I apparently can't help narrow down the problem any further assuming people agree that this is even is a problem... The BUILD_MAP_UNPACK_WITH_CALL, CALL_FUNCTION_EX, and CALL_FUNCTION_KW opcodes are affected as well. ---------- components: Interpreter Core messages: 329280 nosy: bup priority: normal severity: normal status: open title: BUILD_MAP_UNPACK doesn't function as expected for dict subclasses type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 01:30:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 06:30:31 +0000 Subject: [issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses In-Reply-To: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za> Message-ID: <1541399431.73.0.788709270274.issue35166@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Traceback (most recent call last): File "", line 1, in File "", line 2, in keys AssertionError This works as expected to me. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 02:14:10 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 05 Nov 2018 07:14:10 +0000 Subject: [issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses In-Reply-To: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za> Message-ID: <1541402050.08.0.788709270274.issue35166@psf.upfronthosting.co.za> Steven D'Aprano added the comment: You say it doesn't work as expected, but you don't say what you expect or why. (Don't make me guess what you mean -- explicit is better than implicit.) When I try your subclass in 3.6, I get an unexpected TypeError: py> class Dict(dict): ... def keys(self): assert 0 ... def update(*args, **kwds): assert 0 ... def __getitem__(self, key): assert 0 ... def __iter__(self): assert 0 ... py> {**Dict(a=1)} {'a': 1} py> Dict(a=1).keys() Traceback (most recent call last): File "", line 1, in File "", line 2, in keys TypeError ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 02:17:36 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 05 Nov 2018 07:17:36 +0000 Subject: [issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses In-Reply-To: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za> Message-ID: <1541402256.29.0.788709270274.issue35166@psf.upfronthosting.co.za> Steven D'Aprano added the comment: How weird... after restarting the interpreter, I can't reproduce that TypeError. I get the AssertionError Serhiy showed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 02:55:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 07:55:19 +0000 Subject: [issue15245] ast.literal_eval fails on some literals In-Reply-To: <1341346286.65.0.729285382693.issue15245@psf.upfronthosting.co.za> Message-ID: <1541404519.48.0.788709270274.issue15245@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: ast.literal_eval('...') works in 3.8. The question is should we make it working in older versions? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 02:58:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 07:58:23 +0000 Subject: [issue33460] "..." is used to confusingly indicate many different things in chapter 3 In-Reply-To: <1525995197.73.0.682650639539.issue33460@psf.upfronthosting.co.za> Message-ID: <1541404703.16.0.788709270274.issue33460@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 03:01:21 2018 From: report at bugs.python.org (=?utf-8?q?S=C5=82awomir_Nizio?=) Date: Mon, 05 Nov 2018 08:01:21 +0000 Subject: [issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError In-Reply-To: <1460449938.56.0.948695426963.issue26740@psf.upfronthosting.co.za> Message-ID: <1541404881.47.0.788709270274.issue26740@psf.upfronthosting.co.za> S?awomir Nizio added the comment: I had the same problem with entries: SCHILY.xattr.system.posix_acl_default, SCHILY.xattr.system.posix_acl_access in a tarball with pax header. This seems to be fixed for Python 3 in the issue 8633, commit 1465cc2 in cpython. Tarfile from Python 2 assumes (in _proc_pax) that the values can be always decoded as utf-8 string. ---------- nosy: +snizio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 03:28:53 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 05 Nov 2018 08:28:53 +0000 Subject: [issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self" In-Reply-To: <1448654213.28.0.807225788685.issue25750@psf.upfronthosting.co.za> Message-ID: <1541406533.32.0.788709270274.issue25750@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > Is it necessary to use METH_FASTCALL? In Python 3, the bug only occurs with METH_FASTCALL. The issue is a reference counting bug and the temporary tuple used for a METH_VARARGS method avoids the bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 03:30:09 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 05 Nov 2018 08:30:09 +0000 Subject: [issue34751] Hash collisions for tuples In-Reply-To: <1537450047.43.0.956365154283.issue34751@psf.upfronthosting.co.za> Message-ID: <1541406609.08.0.788709270274.issue34751@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Many thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 03:37:42 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 05 Nov 2018 08:37:42 +0000 Subject: [issue19675] Pool dies with excessive workers, but does not cleanup In-Reply-To: <1384998739.89.0.441869255184.issue19675@psf.upfronthosting.co.za> Message-ID: <1541407062.89.0.788709270274.issue19675@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 04:45:47 2018 From: report at bugs.python.org (Denis Osipov) Date: Mon, 05 Nov 2018 09:45:47 +0000 Subject: [issue35165] Possible wrong method name in attribute references doc In-Reply-To: <1541353400.8.0.788709270274.issue35165@psf.upfronthosting.co.za> Message-ID: <1541411147.47.0.788709270274.issue35165@psf.upfronthosting.co.za> Denis Osipov added the comment: Got it. But now docs says that overriding the __getattr__() method is enough to customize attribute access. It's not completely true. If I understand it correct, to make __getattr__() work every time you need to call it by __getattribute__ or raise AttributeError, e.g. store attributes somewhere not in instance __dict__. In this case you need to override __setattr__ too. class MyGetattrClass: def __init__(self): super().__setattr__("attrs", {}) def __setattr__(self, name, value): self.attrs[name] = value def __getattr__(self, name): try: print(f"{name} equals {self.attrs[name]}") except KeyError: raise AttributeError( f"{type(self).__name__!r} object has no attribute {name!r}" ) from None If it's correct, we probably should add some clarification in expressions doc. Or maybe just link to https://docs.python.org/3/reference/datamodel.html#object.__getattr__ (which mention about it) will be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 05:31:59 2018 From: report at bugs.python.org (orlnub123) Date: Mon, 05 Nov 2018 10:31:59 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541413919.86.0.788709270274.issue35105@psf.upfronthosting.co.za> orlnub123 added the comment: I take back my previous suggestion, I agree that documenting it in setattr() (and **kwargs) is the way to go. It's obvious that you can assign anything to the __dict__, since it represents a dict, but setattr() is more ambiguous. 'Anything' was the key word for me here. For example you can assign ints to __dict__ and it won't complain but try to do the same with setattr()/getattr() and it results in an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 06:17:35 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 05 Nov 2018 11:17:35 +0000 Subject: [issue34305] inspect.getsourcefile and inspect.getcomments do not work with decorated functions In-Reply-To: <1533108053.89.0.56676864532.issue34305@psf.upfronthosting.co.za> Message-ID: <1541416655.45.0.788709270274.issue34305@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 06:29:01 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 11:29:01 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541417341.84.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 06:44:46 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 11:44:46 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541418286.62.0.788709270274.issue35134@psf.upfronthosting.co.za> Nick Coghlan added the comment: > To be honest, I'm not sure that I understand how "Py_LIMITED_API+0 >= 0x03050000" works and should be used. It's described here: https://docs.python.org/3/c-api/stable.html If a stable ABI consumer just declares "#define PY_LIMITED_API 1", then they'll get the original stable ABI as defined in Python 3.2. If they don't care about versions prior to 3.6, they can instead declare "#define PY_LIMITED_API 0x03060000", and get access to the functions added to the stable ABI in 3.3, 3.4, 3.5, and 3.6. For this PR though, I think it's OK to ignore that detail, as once all the internal APIs are in "Include/internal", and all the APIs that don't offer ABI stability guarantees are in "Include/TBD" (see note below), then the general rule to follow is that everything added to the headers directly in "Include/" needs a Py_LIMITED_API guard that matches the upcoming release. Note: I wrote "TBD" rather than "pycapi" above, as "pycapi" sounds like the name of a preferred public API to me, rather than "code compiled against this API is not portable to later versions, and may not be portable to other implementations". Given the name of the macro, "Include/unlimited/*.h" may make sense, especially if those header files are all written to error out at compile time if PY_LIMITED_API is defined. "Include/unstable_abi/*.h" would be another self-describing name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 06:49:15 2018 From: report at bugs.python.org (Robert Pollak) Date: Mon, 05 Nov 2018 11:49:15 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541418555.51.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: I have created the attached sqlite database file (with SQLiteStudio) for testing. I contains a table `t` with a TEXT column `x` and a DATETIME (according to SQLiteStudio) column `y`. The table contains a single row with the value `2018-11-05 12:20:30` for both columns. For some reason SQLiteStudio manages to know these types (although the columns contain the same value, and even after renaming the file and reconnecting to it), so sqlite3 should also be able to detect them. ---------- Added file: https://bugs.python.org/file47905/SQLiteStudio-3449.sqlite _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 06:53:31 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 11:53:31 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1541418811.63.0.788709270274.issue35134@psf.upfronthosting.co.za> Nick Coghlan added the comment: On actually looking at the initial changes in the PR: * declarations that aren't part of the stable ABI in any version (i.e. "#ifndef PY_LIMITED_API", "#if !defined(PY_LIMITED_API)") should move to the new directory * declarations that are part of the stable ABI in *some* version should remain where they are (i.e. in "Include/*.h") In your initial PR, the only API that subtle distinction affects is PyObject_Calloc (since that's a new addition to the stable ABI in 3.5+), and moving that back to the public header means you can add the desired "Py_LIMITED_API is not defined" check to the header in the new directory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 07:03:50 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 12:03:50 +0000 Subject: [issue32512] Add an option to profile to run library module as a script In-Reply-To: <1515344427.94.0.467229070634.issue32512@psf.upfronthosting.co.za> Message-ID: <1541419430.62.0.788709270274.issue32512@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 by Nick Coghlan (Mario Corchero) in branch 'master': bpo-32512: Add -m option to profile for profiling modules (#5132) https://github.com/python/cpython/commit/ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 07:11:53 2018 From: report at bugs.python.org (Mario Corchero) Date: Mon, 05 Nov 2018 12:11:53 +0000 Subject: [issue32512] Add an option to profile to run library module as a script In-Reply-To: <1515344427.94.0.467229070634.issue32512@psf.upfronthosting.co.za> Message-ID: <1541419913.88.0.788709270274.issue32512@psf.upfronthosting.co.za> Change by Mario Corchero : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 07:17:08 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 12:17:08 +0000 Subject: [issue25711] Rewrite zipimport from scratch In-Reply-To: <1448296120.48.0.872112518039.issue25711@psf.upfronthosting.co.za> Message-ID: <1541420228.23.0.788709270274.issue25711@psf.upfronthosting.co.za> Nick Coghlan added the comment: Noticed this was still open when reviewing Elvis's zipimport patch for issue 34022. Given the Python implementation has been merged, should we close this as resolved, and open new issues for any further changes (performance or otherwise)? ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 07:29:01 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 05 Nov 2018 12:29:01 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1541420941.34.0.788709270274.issue35164@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I agree with Ned. The code fragment works for me as well on 10.14.1 and I've used simular code in the past on different versions of macOS as well. @ssbarnea: - What is the hostname as shown in the "Sharing" preference pane? Does the name include special characters (anything but ASCII letters and digits)? - What version of macOS do you use? - How did you install Python? (Python.org installer, homebrew, self built, ...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 07:33:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 12:33:36 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541421216.4.0.788709270274.issue35133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here is a script used for searching and fixing such errors. It produces a large number of false detections, so it need manual work for clearing the result. In general this can't be automated, because the correctness depends on the context. ---------- Added file: https://bugs.python.org/file47906/fixstringssplit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 08:37:24 2018 From: report at bugs.python.org (Jonathan Gossage) Date: Mon, 05 Nov 2018 13:37:24 +0000 Subject: [issue9371] pulldom doesn't provide END_DOCUMENT or COMMENT nodes. In-Reply-To: <1279976512.14.0.00983593867016.issue9371@psf.upfronthosting.co.za> Message-ID: <1541425044.16.0.788709270274.issue9371@psf.upfronthosting.co.za> Change by Jonathan Gossage : ---------- pull_requests: +9635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 08:43:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 13:43:16 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options Message-ID: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently command line options for gzip and json.tool are listed as general command line options, together with other options for the Python interpreter. They should be listed as options of separate programs. See "command line option" on https://docs.python.org/3/genindex-C.html. ---------- assignee: serhiy.storchaka components: Documentation messages: 329297 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Specify program for gzip and json.tool command line options versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 08:45:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 13:45:53 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541425553.74.0.788709270274.issue35167@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9636 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 08:48:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 13:48:52 +0000 Subject: [issue25711] Rewrite zipimport from scratch In-Reply-To: <1448296120.48.0.872112518039.issue25711@psf.upfronthosting.co.za> Message-ID: <1541425732.98.0.788709270274.issue25711@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 08:57:10 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Mon, 05 Nov 2018 13:57:10 +0000 Subject: [issue34726] Add support of checked hash-based pycs in zipimport In-Reply-To: <1537300190.96.0.956365154283.issue34726@psf.upfronthosting.co.za> Message-ID: <1541426230.5.0.788709270274.issue34726@psf.upfronthosting.co.za> Change by Elvis Pranskevichus : ---------- pull_requests: +9637 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:00:30 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Mon, 05 Nov 2018 14:00:30 +0000 Subject: [issue23734] zipimport should not check pyc timestamps against zipped py files In-Reply-To: <1426964347.09.0.21067648462.issue23734@psf.upfronthosting.co.za> Message-ID: <1541426430.87.0.788709270274.issue23734@psf.upfronthosting.co.za> Change by Elvis Pranskevichus : ---------- keywords: +patch pull_requests: +9638 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:16:56 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Nov 2018 14:16:56 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541427416.38.0.788709270274.issue35157@psf.upfronthosting.co.za> Steve Dower added the comment: Those are just the distutils tests failing, which probably means the extra environment variables or paths involved in the PGO profiling run are confusing the logic for detecting when it is running in a source tree. We should fix it, but it won't affect either PGO or to resulting build. ---------- components: +Distutils -Build nosy: +dstufft, eric.araujo type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:20:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 14:20:28 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541427628.64.0.788709270274.issue35133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d by Serhiy Storchaka in branch 'master': bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) https://github.com/python/cpython/commit/34fd4c20198dea6ab2fe8dc6d32d744d9bde868d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:20:47 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Nov 2018 14:20:47 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541427647.49.0.788709270274.issue35133@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:26:38 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Nov 2018 14:26:38 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541427998.54.0.788709270274.issue35156@psf.upfronthosting.co.za> Steve Dower added the comment: Most people building Python from the devguide are doing it for contributions, so I'd be very hesitant to change the default recommendations. But we should highlight how to make a working installable build (including the extra dependencies) and the common options on our scripts, as well as their -h options. I also have a "layout" script coming that will make it easier for people to produce their own custom installers by at least copying the files into the right place. ---------- stage: -> needs patch versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:53:09 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Nov 2018 14:53:09 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541429589.16.0.788709270274.issue35133@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 by Miss Islington (bot) in branch '3.7': bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) https://github.com/python/cpython/commit/7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 09:56:04 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 14:56:04 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541429764.18.0.788709270274.issue35133@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 10:13:55 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 15:13:55 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541430835.08.0.788709270274.issue35133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d by Serhiy Storchaka in branch '3.6': [3.6] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) https://github.com/python/cpython/commit/7054e5c80b6e98cd44e22d1bc2d7f0a94343089d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 10:14:46 2018 From: report at bugs.python.org (Mark Lawrence) Date: Mon, 05 Nov 2018 15:14:46 +0000 Subject: [issue9731] Add ABCMeta.has_methods and tests that use it In-Reply-To: <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za> Message-ID: <1541430886.56.0.788709270274.issue9731@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 10:46:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 15:46:20 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541432780.17.0.788709270274.issue35133@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 10:47:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 15:47:30 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541432850.03.0.788709270274.issue35167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 083a7a172b8c8888252d72031f21dcfea3c0d73f by Serhiy Storchaka in branch 'master': bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332) https://github.com/python/cpython/commit/083a7a172b8c8888252d72031f21dcfea3c0d73f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:16:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:16:29 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541434589.32.0.788709270274.issue35133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 by Serhiy Storchaka in branch '2.7': [2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336) https://github.com/python/cpython/commit/3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:19:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:19:59 +0000 Subject: [issue35133] Bugs in concatenating string literals on different lines In-Reply-To: <1541075709.76.0.788709270274.issue35133@psf.upfronthosting.co.za> Message-ID: <1541434799.96.0.788709270274.issue35133@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:25:36 2018 From: report at bugs.python.org (Jorge Ramos) Date: Mon, 05 Nov 2018 16:25:36 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541435136.85.0.788709270274.issue35157@psf.upfronthosting.co.za> Jorge Ramos added the comment: Hi: Hmm.. but the installation does fail ("PGO run did not succeed (no python36!*.pgc files) and there is no data to merge"): ************************************************************************* Total duration: 35 min 2 sec Tests result: FAILURE E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" "E:\RepoGiT\cpython\PCbuild\\pythoncore.vcxproj" /t:KillPython /nologo /v:m /p:Configuration=PGInstrument /p:Platform=x64 /p:KillPython=true Killing any running python.exe instances... E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" "E:\RepoGiT\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /p:Configuration=PGUpdate /p:Platform=x64 /p:IncludeExternals=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" Killing any running python.exe instances... E:\RepoGiT\cpython\PCbuild\pyproject.props(173,5): error : PGO run did not succeed (no python36!*.pgc files) and there is no data to merge [E:\RepoGiT\cpython\PCbuild\pythoncore.vcxproj] ************************************************************************ So I can?t omit these issues and call it a day. =( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:27:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:27:18 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541435238.4.0.788709270274.issue35167@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:28:46 2018 From: report at bugs.python.org (Jorge Ramos) Date: Mon, 05 Nov 2018 16:28:46 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541435326.74.0.788709270274.issue35156@psf.upfronthosting.co.za> Jorge Ramos added the comment: Thank you, I think that will suffice. At least guide folks like myself who want to build from source and with optimizations in the right direction (on which folder to work on and which commands to issue to the terminal) Please keep me posted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:33:25 2018 From: report at bugs.python.org (Jorge Ramos) Date: Mon, 05 Nov 2018 16:33:25 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541435605.09.0.788709270274.issue35156@psf.upfronthosting.co.za> Jorge Ramos added the comment: One more thing: point in case #6 does credit a revision IMO. The build_pgo.bat file does not exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:44:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:44:12 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541436252.9.0.788709270274.issue35167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6ad277b2592cfac0f138e9adca4374dd1f354bdf by Serhiy Storchaka in branch '3.7': [3.7] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) https://github.com/python/cpython/commit/6ad277b2592cfac0f138e9adca4374dd1f354bdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:44:25 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Nov 2018 16:44:25 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541436265.18.0.788709270274.issue35167@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 11:56:49 2018 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 05 Nov 2018 16:56:49 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541437009.42.0.788709270274.issue35145@psf.upfronthosting.co.za> Paul Ganssle added the comment: With regards to automatically deducing column types, I am -1 on that. It has way too many dangerous edge cases, and I know of countless bugs in software that are the direct result of stringly-typed data being coerced into a specific data type based on its form. For example, if you have an excel column of alphanumeric strings and happen to get one that looks like "13943E1", that will be coerced (lossily) into the number 139430.0, because it happens to take the form of exponential notation. > I contains a table `t` with a TEXT column `x` and a DATETIME (according to SQLiteStudio) column `y`. It sounds to me like SQLiteStudio is doing the same thing that Python is doing, by extending the "types" available to include a DATETIME. Presumably they do it the same way, with "datetime" in the column name. If that's the case then it's just a mismatch between what they call their datetime adapter and what python does, and you just need to rename the relevant columns to say "timestamp" instead of "datetime". As an aside, this is what we get from people not offering real datetime types in their standards. JSON has the exact same problem - people need to transmit datetimes but there's no way to do it in the standard, so everyone extends the standard in a sightly different way and you end up with a bunch of incompatible ways of storing datetimes as strings. Bah humbug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 12:02:26 2018 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Nov 2018 17:02:26 +0000 Subject: [issue35125] asyncio shield: remove inner callback on outer cancellation In-Reply-To: <1540999121.33.0.788709270274.issue35125@psf.upfronthosting.co.za> Message-ID: <1541437346.46.0.788709270274.issue35125@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +9644 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 12:32:14 2018 From: report at bugs.python.org (tphh) Date: Mon, 05 Nov 2018 17:32:14 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency Message-ID: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> New submission from tphh : The newly added shlex.punctuation_chars is special compared to the other public instance variables: It can ONLY be used when constructing a shlex instance, unlike other public instance variables, such as commenters, which can ONLY be set later. >>> s = shlex.shlex('abc // def') >>> s.commenters = '/' >>> list(s) ['abc', '', ''] >>> s = shlex.shlex('abc // def', punctuation_chars = '/') >>> list(s) ['abc', '//', 'def'] However, setting punctuation_chars later shows this rather useless error message: >>> s = shlex.shlex('abc // def') >>> s.punctuation_chars = '/' >>> list(s) Traceback (most recent call last): File "", line 1, in File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 295, in __next__ token = self.get_token() File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 105, in get_token raw = self.read_token() File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 133, in read_token if self.punctuation_chars and self._pushback_chars: AttributeError: 'shlex' object has no attribute '_pushback_chars' ---------- components: Library (Lib) messages: 329310 nosy: tphh priority: normal severity: normal status: open title: shlex punctuation_chars inconsistency type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 12:51:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 17:51:41 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541440301.91.0.788709270274.issue35167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': [3.6] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) (GH-10339) https://github.com/python/cpython/commit/8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 12:59:35 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 05 Nov 2018 17:59:35 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency In-Reply-To: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> Message-ID: <1541440775.66.0.788709270274.issue35168@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. The code was added with c1f974c944a3e73cbc9102356d8700a190dcafb3 and self._pushback_chars is declared only when punctuation_chars is passed to shlex.shlex in the constructor as you have mentioned in https://github.com/python/cpython/blob/master/Lib/shlex.py#L59 . Adding Vinay for thoughts on the usage. ---------- nosy: +vinay.sajip, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 12:59:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 17:59:52 +0000 Subject: [issue35167] Specify program for gzip and json.tool command line options In-Reply-To: <1541425396.23.0.788709270274.issue35167@psf.upfronthosting.co.za> Message-ID: <1541440792.68.0.788709270274.issue35167@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:17:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 19:17:32 +0000 Subject: [issue35169] Improve error messages for assignment Message-ID: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : This is a follow up of issue34641. >>> f(lambda x: x = 1) File "", line 1 SyntaxError: lambda cannot contain assignment >>> f(x.y = 1) File "", line 1 SyntaxError: keyword can't be an expression The error message "keyword can't be an expression" still looks confusing to me. This is because the term "keyword" is ambiguous. Usually it means reserved identifier like "if" or "def". Some keywords, like "None" and "True" can be expressions. Perhaps "keyword name can't be an expression" would be better. But I think that in these cases it is most likely that "=" was used instead of "==". And it would be better to generalize the error message for lambdas and point on a possible typo. >>> f(x.y = 1) File "", line 1 SyntaxError: expression cannot contain assignment, perhaps you meant "=="? The proposed PR changes this error message. It makes also an error message for forbidden assignment more concrete: "cannot assign to __debug__" instead of "assignment to keyword" (the latter is actually incorrect, because __debug__ is not true keyword in tokenizer). This restores Python 2 error messages. Improved also other error messages for forbidden assigning: dict and set displays, f-string expressions are not literals. ---------- components: Interpreter Core messages: 329313 nosy: benjamin.peterson, brett.cannon, gvanrossum, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Improve error messages for assignment type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:21:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 19:21:18 +0000 Subject: [issue35169] Improve error messages for assignment In-Reply-To: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> Message-ID: <1541445678.27.0.788709270274.issue35169@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9645 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:29:57 2018 From: report at bugs.python.org (Oleksandr Buchkovskyi) Date: Mon, 05 Nov 2018 19:29:57 +0000 Subject: [issue17560] problem using multiprocessing with really big objects? In-Reply-To: <1364399521.2.0.696890688109.issue17560@psf.upfronthosting.co.za> Message-ID: <1541446197.27.0.788709270274.issue17560@psf.upfronthosting.co.za> Change by Oleksandr Buchkovskyi : ---------- keywords: +patch pull_requests: +9646 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:43:12 2018 From: report at bugs.python.org (Roffild) Date: Mon, 05 Nov 2018 19:43:12 +0000 Subject: [issue35154] subprocess.list2cmdline() does not allow running some commands. In-Reply-To: <1541278553.41.0.788709270274.issue35154@psf.upfronthosting.co.za> Message-ID: <1541446992.78.0.788709270274.issue35154@psf.upfronthosting.co.za> Roffild added the comment: Yes, my mistake. 3.6/Lib/subprocess.py:970 ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:45:07 2018 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 05 Nov 2018 19:45:07 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency In-Reply-To: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> Message-ID: <1541447107.01.0.788709270274.issue35168@psf.upfronthosting.co.za> Vinay Sajip added the comment: I agree that it's inconsistent, but quite a bit of setting up is done when punctuation_chars is provided, as per the link in msg329312. One could convert the attribute to a property and have a setter that does the equivalent set up, but some of the setup is one-time (removing things from wordchars, etc.), and would require additional work to handle the case where the property is reassigned multiple times. I have no problem updating the documentation to indicate in a note that it must be provided in the constructor and not later, but apart from the fact that it's inconsistent, is there a use case for supporting setting it later? That would mean setting it up so that you could set it several times, unset it, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 14:56:30 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Mon, 05 Nov 2018 19:56:30 +0000 Subject: [issue23734] zipimport should not check pyc timestamps against zipped py files In-Reply-To: <1426964347.09.0.21067648462.issue23734@psf.upfronthosting.co.za> Message-ID: <1541447790.89.0.788709270274.issue23734@psf.upfronthosting.co.za> Elvis Pranskevichus added the comment: I don't think that breaking the .pyc contract by assumption is a good thing. The desired behavior of never checking the .pyc freshness can be achieved by using unchecked hash-based compilation, or using hash-based compilation and --check-hash-based-pycs=never. Perhaps we can go further and add a --check-timestamp-based-pycs=never, but IMO, this should be explicit in all cases, including zipimport. ---------- nosy: +Elvis.Pranskevichus _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 15:03:36 2018 From: report at bugs.python.org (lana.deere) Date: Mon, 05 Nov 2018 20:03:36 +0000 Subject: [issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build Message-ID: <1541448216.81.0.788709270274.issue35170@psf.upfronthosting.co.za> New submission from lana.deere : When I try to compile 3.7.1 on CentOS6.10 it fails to build _ctypes, but I can't find any indication of why. There are several mentions of _ctypes during compiles, building '_ctypes_test' extension creating build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes /usr/bin/gcc -pthread -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include -I. -I/usr/local/include -I/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Include -I/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1 -c /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.c -o build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.o /usr/bin/gcc -pthread -shared build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.o -L/usr/local/lib -lm -o build/lib.linux-x86_64-3.7/_ctypes_test.cpython-37m-x86_64-linux-gnu.so After that, it gets to listing modules later and says: INFO: Could not locate ffi libs and/or headers Python build finished successfully! The necessary bits to build these optional modules were not found: _ssl To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _ctypes _uuid Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381 I can see the problem with _uuid, it's a conflict between headers. In file included from /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:8: /usr/include/uuid.h:94: error: conflicting types for ?uuid_t? /usr/include/uuid/uuid.h:44: note: previous declaration of ?uuid_t? was here /usr/include/uuid.h:107: error: conflicting types for ?uuid_compare? /usr/include/uuid/uuid.h:73: note: previous declaration of ?uuid_compare? was here /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c: In function ?py_uuid_generate_time_safe?: /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:15: error: storage size of ?uuid? isn?t known /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:15: warning: unused variable ?uuid? However, I see nothing indicating building the _ctypes extension other than the ctypes_test I mentioned already above. Eventually the build aborts because of the missing _ctypes. Generating grammar tables from /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1-install/lib/python3.7/lib2to3/PatternGrammar.txt Writing grammar tables to /home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1-install/lib/python3.7/lib2to3/PatternGrammar3.7.1.final.0.pickle if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Traceback (most recent call last): File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip._internal File "/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in File "/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in File "/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in File "/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in File "/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' make: *** [install] Error 1 I have attached the complete log captured from the build to this report. Any suggestions about the cause of this would be appreciated. Note that I had no problem building 3.6.1 on the same system. $ python3 Python 3.6.1 (default, Apr 21 2017, 11:56:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import _ctypes >>> help(_ctypes) Help on module _ctypes: [...] ---------- components: Build, Installation, ctypes files: Log.python.install.xz messages: 329317 nosy: lana.deere priority: normal severity: normal status: open title: 3.7.1 compile failure on CentOS 6.10; _ctypes did not build type: compile error versions: Python 3.7 Added file: https://bugs.python.org/file47907/Log.python.install.xz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 16:20:59 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 05 Nov 2018 21:20:59 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1541452859.4.0.788709270274.issue31793@psf.upfronthosting.co.za> Change by Julien Palard : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 16:21:26 2018 From: report at bugs.python.org (Michael Felt) Date: Mon, 05 Nov 2018 21:21:26 +0000 Subject: [issue34897] distutils test errors when CXX is not set In-Reply-To: <1538684546.1.0.545547206417.issue34897@psf.upfronthosting.co.za> Message-ID: <1541452886.76.0.788709270274.issue34897@psf.upfronthosting.co.za> Michael Felt added the comment: Thx. So, while "" is not None (i.e., "" is not False), it does test as a Boolean expression as 'False' so the test for None or "" is the same as testing for "" (but not the same as testing for None). I accept your logic - and shall make the change in the test in Lib/test/support/__init__.py rather than in the assignment in Lib/distutils/ccompiler.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 16:47:21 2018 From: report at bugs.python.org (Robert Pollak) Date: Mon, 05 Nov 2018 21:47:21 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541454441.71.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: Paul, the sniffing would be only active for people who explicitly add a connect() argument like detect_types=DETECT_DATETIME, which can have the appropriate warning in the docs. You can also extend the sniffing to all values, not just the first non-missing one. (I'd gladly pay the computational price.) How many cases are there where a column is full of `YYYY-MM-DD HH:MM:SS.SSS` data, DETECT_DATETIME is switched on, and the user _doesn't_ want this column to be interpreted as datetime? (I'm of course not suggesting to try detecting REAL as Julian day, or INTEGER as Unix Time.) Forget about my test file, by the way: I have now found out that I can extract the DATETIME type information from my test file SQLiteStudio-3449.sqlite in the following two ways: ``` In [3]: pd.read_sql_query('pragma table_info("t")', con) Out[3]: cid name type notnull dflt_value pk 0 0 x TEXT 0 None 0 1 1 y DATETIME 0 None 0 In [4]: pd.read_sql_query('SELECT SQL FROM sqlite_master WHERE name = "t"', con) Out[4]: sql 0 CREATE TABLE t (x TEXT, y DATETIME) ``` For my real use case however, those two statements yield empty results :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 17:53:29 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Mon, 05 Nov 2018 22:53:29 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules Message-ID: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : I've got the following on OpenSUSE Tumbleweed (glibc 2.27): ====================================================================== FAIL: test_TimeRE_recreation_timezone (test.test_strptime.CacheTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/scratch2/izbyshev/cpython/Lib/test/support/__init__.py", line 1683, in inner return func(*args, **kwds) File "/scratch2/izbyshev/cpython/Lib/test/test_strptime.py", line 702, in test_TimeRE_recreation_timezone self.assertEqual(tm.tm_isdst, 1) AssertionError: 0 != 1 This test sets TZ environment variable to 'STD-1DST' and calls time.tzset() (inside support.run_with_tz decorator). This TZ value lacks rules that specify when DST transitions happen. POSIX seems to be silent what should be done if the rule is missing, thought it does specify that the rule is optional[1]. What actually happens at least on Linux/glibc[2] and FreeBSD[3] is that those rules are taken from 'posixrules' file. On OpenSUSE, it's linked to '/etc/localtime', which is linked to 'Europe/Moscow' in my case. DST transitions were cancelled in Russia in 2011, so when Python tries to get timezone names for two points of the year (https://github.com/python/cpython/blob/570e371fd6e8615ece9b9e21fbe77149ebeb172e/Modules/timemodule.c#L1603), it gets unexpected values instead. The actual values depend on the bugginess of the libc used: * Glibc seems to be confused by having 'posixrules' file with DST cancelled but a specification which includes the DST timezone part, so localtime() returns 'MSK' in tm_zone (both for January and July). * musl doesn't implement 'posixrules' fallback, so it uses "all-zero" rules instead which cause it return 'DST' in both cases. * FreeBSD 11.1 (with 'posixrules' linked to 'Europe/Moscow') returns 'STD' in both cases. With any of the above, the test fails because strptime is called with the same timezone name two times. Note that even if PyInit_timezone() didn't probe January/July and used 'tzname' global instead, it wouldn't work as expected at least on FreeBSD: it sets tzname[1] to the empty string in the test above. ISTM the best way to fix this is to remove dependence on 'posixrules' file by specifying the rules in TZ. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08 [2] http://man7.org/linux/man-pages/man3/tzset.3.html [3] https://www.freebsd.org/cgi/man.cgi?query=tzset&sektion=3 ---------- components: Tests messages: 329320 nosy: benjamin.peterson, izbyshev, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: test_TimeRE_recreation_timezone failure on systems with non-default posixrules type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 17:55:17 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Mon, 05 Nov 2018 22:55:17 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541458517.38.0.788709270274.issue35171@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9647 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 18:17:53 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Mon, 05 Nov 2018 23:17:53 +0000 Subject: [issue30533] missing feature in inspect module: getmembers_static In-Reply-To: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za> Message-ID: <1541459873.13.0.788709270274.issue30533@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 18:33:08 2018 From: report at bugs.python.org (Ali Rizvi-Santiago) Date: Mon, 05 Nov 2018 23:33:08 +0000 Subject: [issue35172] Add support for other MSVC compiler versions to distutils. distutils makes two incorrect assumption that MSVC compiler versions scale linearly and that the crt's are the same. Message-ID: <1541460788.89.0.788709270274.issue35172@psf.upfronthosting.co.za> New submission from Ali Rizvi-Santiago : Distutils makes a few incorrect assumptions that prevent it from supporting the newer Microsoft-y C compilers. This patch fixes it up till MSVC 14.0. There are 2 assumptions that are made by distutils and they are as follows. The first one is that MSVC's versions scale linearly (subtracting 6). This assumption breaks when encountering major version 13.0 as VS2013 (12.0) uses 1800 and VS2015 (14.0) uses 1900 and so the calculation for version 13.0 does not actually exist. This was fixed in the patch for both msvc9compiler.py and msvccompiler.py by skipping the major version 13. The second assumption is in the get_msvcr() function in cygwinccompiler.py and is responsible for identifying the CRT name. The newer versions of MSVC aren't listed, so these were added in the patch. However, for version 1900 (MSVC 14.0) the crt is now named "vcruntime140" which was included. It might be better to to make this table-based if there is long-term interest in supporting these other compilers. These are the only issues that I've ever encountered over the years with building CPython 2.7.x with the newer VS compilers. ---------- components: Distutils files: distutils.patch keywords: patch messages: 329321 nosy: Ali Rizvi-Santiago, dstufft, eric.araujo priority: normal severity: normal status: open title: Add support for other MSVC compiler versions to distutils. distutils makes two incorrect assumption that MSVC compiler versions scale linearly and that the crt's are the same. type: enhancement versions: Python 2.7 Added file: https://bugs.python.org/file47908/distutils.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 19:18:27 2018 From: report at bugs.python.org (Ali Rizvi-Santiago) Date: Tue, 06 Nov 2018 00:18:27 +0000 Subject: [issue35173] Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path Message-ID: <1541463507.29.0.788709270274.issue35173@psf.upfronthosting.co.za> New submission from Ali Rizvi-Santiago : This is specific to the Windows platform as it's the only platform that uses the registry and other path hacks to identify the default module path. This patch is mostly intended for embedded Python, but is also applicable to a stand-alone Python. A few years ago, I was looking at relocating my Python interpreter so that an embedded application (that I didn't have control over) would use the correct module path. While merging my code into CPython, I quickly noticed that Python already supported doing this with Py_ENABLE_SHARED but due to the implementation wasn't actually using it for some reason. The code that implements this is 10+ years old, so perhaps it was just an oversight or some other reason that I didn't know about. Inside PC/getpathp.c there's a static variable, "dllpath", that is initialized with the path to the DLL that is being dynamically loaded when Py_ENABLE_SHARED is specified. Normally arg0 is used to locate the module path, but when embedding Python the .exe and thus arg0 is not involved. So, this patch uses "dllpath" by adding a final case to the calculation of the path by assigning it to "pythonhome" if the home was not able to be determined by any other means. This is done in 2 places within "calculatepath()". This allows one to have multiple versions of Python (32-bit, 64-bit, older versions, etc) on the same Windows system and so a user should not need to copy the Python library into their System path or explicitly set any environment variables (unless truly desired of course). This should greatly simplify relocation of Python as the DLL and executable can be moved around without being dependant on any external invariants. ---------- components: Interpreter Core files: relocate-with-dllpath.patch keywords: patch messages: 329322 nosy: Ali Rizvi-Santiago priority: normal severity: normal status: open title: Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path type: enhancement versions: Python 2.7 Added file: https://bugs.python.org/file47909/relocate-with-dllpath.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 19:26:49 2018 From: report at bugs.python.org (Ali Rizvi-Santiago) Date: Tue, 06 Nov 2018 00:26:49 +0000 Subject: [issue35173] Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path according to the shared library In-Reply-To: <1541463507.29.0.788709270274.issue35173@psf.upfronthosting.co.za> Message-ID: <1541464009.77.0.788709270274.issue35173@psf.upfronthosting.co.za> Change by Ali Rizvi-Santiago : ---------- title: Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path -> Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path according to the shared library _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 19:38:57 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 06 Nov 2018 00:38:57 +0000 Subject: [issue33462] reversible dict In-Reply-To: <1526009418.33.0.682650639539.issue33462@psf.upfronthosting.co.za> Message-ID: <1541464737.81.0.788709270274.issue33462@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 6531bf6309c8fda1954060a0fb5ea930b1efb656 by INADA Naoki (R?mi Lapeyre) in branch 'master': bpo-33462: Add __reversed__ to dict and dict views (GH-6827) https://github.com/python/cpython/commit/6531bf6309c8fda1954060a0fb5ea930b1efb656 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 19:39:55 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 06 Nov 2018 00:39:55 +0000 Subject: [issue33462] reversible dict In-Reply-To: <1526009418.33.0.682650639539.issue33462@psf.upfronthosting.co.za> Message-ID: <1541464795.2.0.788709270274.issue33462@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:19:59 2018 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 06 Nov 2018 01:19:59 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541467199.81.0.788709270274.issue35171@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:38:25 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 06 Nov 2018 01:38:25 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency In-Reply-To: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> Message-ID: <1541468305.72.0.788709270274.issue35168@psf.upfronthosting.co.za> Raymond Hettinger added the comment: It makes sense to me that information used in an expensive one-time setup should be specified in advance where other parameters that are more easily changed are specified downstream. The API reflects the a sensible way to use the tool. Making it to easy to change later increases the risk of misuse. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:53:25 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Tue, 06 Nov 2018 01:53:25 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541469205.95.0.788709270274.issue35119@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: New changeset 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f by Ivan Levkivskyi (Denis Osipov) in branch 'master': bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://github.com/python/cpython/commit/0bee3c36d406e47fa9f99cfc1e07b701512c4f3f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:53:35 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 01:53:35 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541469215.69.0.788709270274.issue35119@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:57:38 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 06 Nov 2018 01:57:38 +0000 Subject: [issue22021] shutil.make_archive() root_dir do not work In-Reply-To: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> Message-ID: <1541469458.06.0.788709270274.issue22021@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Is anybody working on this or can I submit a PR? ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:58:31 2018 From: report at bugs.python.org (E Kawashima) Date: Tue, 06 Nov 2018 01:58:31 +0000 Subject: [issue22276] pathlib glob ignores trailing slash in pattern In-Reply-To: <1409053042.7.0.771163532868.issue22276@psf.upfronthosting.co.za> Message-ID: <1541469511.34.0.788709270274.issue22276@psf.upfronthosting.co.za> Change by E Kawashima : ---------- keywords: +patch pull_requests: +9649 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 20:59:19 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 01:59:19 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541469559.17.0.788709270274.issue35119@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 558dc8adbec0b85e0ff257fcedc85c5d89cd2825 by Miss Islington (bot) in branch '3.7': bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://github.com/python/cpython/commit/558dc8adbec0b85e0ff257fcedc85c5d89cd2825 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:00:37 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Tue, 06 Nov 2018 02:00:37 +0000 Subject: [issue35119] Customizing module attribute access example raises RecursionError In-Reply-To: <1540959974.35.0.788709270274.issue35119@psf.upfronthosting.co.za> Message-ID: <1541469637.81.0.788709270274.issue35119@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:23:45 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 02:23:45 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471025.36.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +9650 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:30:36 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 02:30:36 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471436.78.0.788709270274.issue35099@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 5e7909032491cef17754a3208872655fe350e9be by Terry Jan Reedy in branch 'master': bpo-35099: Improve the doc about IDLE running user code. (#10350) https://github.com/python/cpython/commit/5e7909032491cef17754a3208872655fe350e9be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:30:47 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 02:30:47 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471447.53.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:30:57 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 02:30:57 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471457.98.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:35:22 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 02:35:22 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471722.9.0.788709270274.issue35099@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a437c285fa4f21720802e7a91770b2281d576554 by Miss Islington (bot) in branch '3.7': bpo-35099: Improve the doc about IDLE running user code. (GH-10350) https://github.com/python/cpython/commit/a437c285fa4f21720802e7a91770b2281d576554 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:35:54 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 02:35:54 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541471754.12.0.788709270274.issue35099@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 927a113ae2be33a9dd929569930f28948aa5c965 by Miss Islington (bot) in branch '3.6': bpo-35099: Improve the doc about IDLE running user code. (GH-10350) https://github.com/python/cpython/commit/927a113ae2be33a9dd929569930f28948aa5c965 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:48:14 2018 From: report at bugs.python.org (Camion) Date: Tue, 06 Nov 2018 02:48:14 +0000 Subject: [issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass Message-ID: <1541472494.47.0.788709270274.issue35174@psf.upfronthosting.co.za> New submission from Camion : I don't know if this is by design (for what reason ?) or if it is a bug, but I have noticed this quite counter-intuitive behaviour : Doing that, it seems that the logical way to make the __repr__ and __str__ methods, would be to override respectively the parent __repr__ and _str__ methods, and calling them from the inherited versions, but for some reason, it seems that calling super().__str__ leads to call self.__repr__. I have written the following piece of python-3 code in which I subclass the list class in order to make a class which supports storing names and unnamed fields the same way you can have variable named and unnamed parameters in a function call : class struct(list): def __init__(self, *args, **kwargs): super().__init__(args) for key, value in kwargs.items(): setattr(self, key, value) def __repr__(self): s = super().__repr__()[1:-1] for key, val in self.__dict__.items(): s += ', '+key+'='+repr(val) return 'struct('+s+')' def __str__(self): s = super().__str__()[1:-1] print('Debug : super().__str__() = "'+super().__str__()+'"') print('Debug : list(self).__str__() = "'+list(self).__str__()+'"') print('Debug : s = "'+s+'"') for key, val in self.__dict__.items(): s += ', '+key+'='+str(val) return '{'+s+'}' a = struct(1, 2, 3, a="akeja", b=21, c=True, d="lkj") print('repr(a)="'+repr(a)+'"\n') print('str(a)="'+str(a)+'"\n') Executing this code in idle-3.5.2 will yield the following result : >>> RESTART: struct.py repr(a)="struct(1, 2, 3, b=21, d='lkj', a='akeja', c=True)" Debug : super().__str__() = "struct(1, 2, 3, b=21, d='lkj', a='akeja', c=True)" Debug : list(self).__str__() = "[1, 2, 3]" Debug : s = "truct(1, 2, 3, b=21, d='lkj', a='akeja', c=True" str(a)="{truct(1, 2, 3, b=21, d='lkj', a='akeja', c=True, b=21, d=lkj, a=akeja, c=True}" >>> As one can see in the second debug lines, the call to `super().__str__()` which I expect to return the result from a call to the `__str__` function from my super class (`list`), will in fact return something which looks very much like the expected return from `self.__repr__()` It seems that `super().__str__()` calls `self.__repr__()` instead of `list(self).__str__()` or even `super().__repr__()`. ---------- components: Interpreter Core messages: 329331 nosy: Camion priority: normal severity: normal status: open title: Calling for super().__str__ seems to call self.__repr__ in list subclass type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:50:38 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 02:50:38 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541472638.59.0.788709270274.issue35099@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I either removed or augmented occurrences of 'console' in the renamed section. ---------- dependencies: -IDLE Doc: Text consumes unlimited RAM, consoles likely not, IDLE: Document how Shell displays user code output resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:57:38 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 02:57:38 +0000 Subject: [issue9731] Add ABCMeta.has_methods and tests that use it In-Reply-To: <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za> Message-ID: <1541473058.31.0.788709270274.issue9731@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- pull_requests: -9633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 21:58:56 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 02:58:56 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541473136.58.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- pull_requests: +9653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:13:17 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Nov 2018 03:13:17 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541473997.73.0.788709270274.issue35157@psf.upfronthosting.co.za> Steve Dower added the comment: How much have you edited the error messages you are posting? Those two build commands shouldn't be next to each other (the tests should be in between), so perhaps something is wrong in that script? Or maybe you trimmed the output before pasting it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:15:16 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Nov 2018 03:15:16 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541474116.36.0.788709270274.issue35156@psf.upfronthosting.co.za> Steve Dower added the comment: If you're able, you might be the best person to do some of those updates right now :) The rest of us will have to set aside time to get back up to speed on some of the details, and while we'll likely have to do that to review changes anyway, at least that's one less person to wait for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:18:01 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 03:18:01 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541474281.07.0.788709270274.issue35099@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset f1d3efc2fba704692d539acc3cb0376a1dd9d98f by Terry Jan Reedy in branch 'master': bpo-35099: Update idlelib/help.html (#10353) https://github.com/python/cpython/commit/f1d3efc2fba704692d539acc3cb0376a1dd9d98f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:18:21 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 03:18:21 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541474301.82.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:18:32 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 03:18:32 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541474312.97.0.788709270274.issue35099@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:36:17 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 03:36:17 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541475377.86.0.788709270274.issue35099@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069 by Miss Islington (bot) in branch '3.7': bpo-35099: Update idlelib/help.html (GH-10353) https://github.com/python/cpython/commit/4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 22:39:58 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 03:39:58 +0000 Subject: [issue35099] Improve the IDLE - console differences doc In-Reply-To: <1540783513.03.0.788709270274.issue35099@psf.upfronthosting.co.za> Message-ID: <1541475598.16.0.788709270274.issue35099@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 54bcb6c0f185be29b2a626d2f1430c110c823a7d by Miss Islington (bot) in branch '3.6': bpo-35099: Update idlelib/help.html (GH-10353) https://github.com/python/cpython/commit/54bcb6c0f185be29b2a626d2f1430c110c823a7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:25:38 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 04:25:38 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541478338.07.0.788709270274.issue23220@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +9656 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:29:11 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 06 Nov 2018 04:29:11 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541478551.96.0.788709270274.issue35171@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset f1b9ad3d38c11676b45edcbf2369239bae436e56 by Benjamin Peterson (Alexey Izbyshev) in branch 'master': closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) https://github.com/python/cpython/commit/f1b9ad3d38c11676b45edcbf2369239bae436e56 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:29:26 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:29:26 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541478566.53.0.788709270274.issue35171@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:29:37 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:29:37 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541478577.68.0.788709270274.issue35171@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:29:48 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:29:48 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541478588.67.0.788709270274.issue35171@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:32:01 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 04:32:01 +0000 Subject: [issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass In-Reply-To: <1541472494.47.0.788709270274.issue35174@psf.upfronthosting.co.za> Message-ID: <1541478721.46.0.788709270274.issue35174@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Adding the related StackOverflow question here for some context : https://stackoverflow.com/questions/53156623/calling-for-super-str-seem-to-call-self-repr-in-list-subclass Thanks ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:47:14 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:47:14 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541479634.23.0.788709270274.issue35171@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ca592bcf56fca93210331327777fe20fdeff985a by Miss Islington (bot) in branch '3.7': closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) https://github.com/python/cpython/commit/ca592bcf56fca93210331327777fe20fdeff985a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:50:06 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:50:06 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541479806.88.0.788709270274.issue35171@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d0e3105f7ca3fc54b167edc756ce545cbab0ce95 by Miss Islington (bot) in branch '3.6': closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) https://github.com/python/cpython/commit/d0e3105f7ca3fc54b167edc756ce545cbab0ce95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:59:10 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 04:59:10 +0000 Subject: [issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules In-Reply-To: <1541458409.73.0.788709270274.issue35171@psf.upfronthosting.co.za> Message-ID: <1541480350.23.0.788709270274.issue35171@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ffbce43c1aa457b5976665eb2e47771198c7af06 by Miss Islington (bot) in branch '2.7': closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) https://github.com/python/cpython/commit/ffbce43c1aa457b5976665eb2e47771198c7af06 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 5 23:59:21 2018 From: report at bugs.python.org (Jorge Ramos) Date: Tue, 06 Nov 2018 04:59:21 +0000 Subject: [issue35157] Missing pyconfig.h when building from source and pgo flag is enabled In-Reply-To: <1541289168.57.0.788709270274.issue35157@psf.upfronthosting.co.za> Message-ID: <1541480361.12.0.788709270274.issue35157@psf.upfronthosting.co.za> Jorge Ramos added the comment: Yes, my last message is a trimmed version of my next to last message (which itself is a trimmed version of all the verbose of the build, showing just after the PGO interpreter wakes up). Although, obviously they where run at different times (one run completed in 31 minutes while the other was in 35 minutes), because I no longer had the output of my next to last message available. Other than that, the messages are 'identical'. The commands followed to get to this are: git clone git at github.com:neyuru/cpython.git git remote add upstream git at github.com:python/cpython.git git remote -v cd cpython git checkout 3.6 PCBuild\get_externals.bat Tools\msi\get_externals.bat PCBuild\build.bat -d -p x64 PCBuild\build.bat --pgo -p x64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 00:10:27 2018 From: report at bugs.python.org (Jorge Ramos) Date: Tue, 06 Nov 2018 05:10:27 +0000 Subject: [issue35156] Consider revising documentation on Python Builds from source In-Reply-To: <1541288069.11.0.788709270274.issue35156@psf.upfronthosting.co.za> Message-ID: <1541481027.92.0.788709270274.issue35156@psf.upfronthosting.co.za> Jorge Ramos added the comment: Although I appreciate the confidence placed in me, I think I'm not exactly the most competent person to make changes to such an important project. I know what -probably- could be improved (from my very narrow point of view) but I don't even know where or how to start so to not screw things up. Don't get me wrong, participating in a project like this (no matter how minor the contribution) is an exciting thought but I ignore so many things that I'm afraid I would probably make it worse rather than making it better. Those things where written for a reason and I'm not even close to know or understand the context on why it was so, as to make a meaningful contribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 00:38:27 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 05:38:27 +0000 Subject: [issue17185] unittest mock create_autospec doesn't correctly replace mocksignature In-Reply-To: <1360621900.03.0.519438692167.issue17185@psf.upfronthosting.co.za> Message-ID: <1541482707.6.0.788709270274.issue17185@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Is this being worked on or can I try fixing this? My analysis so far is as below : 1. For functions : inspect.signature looks for attribute __signature__ for functions and while creating the mock for a function since we already have the signature we can set __signature__ attribute during _set_signature. I don't know why __signature__ was set. I downloaded mock from GitHub to look at the actual mocksignature implementation which uses lambda signature: _mock_signature to form a mock function which I hope is done here too with a function constructed and evald with sig.bind used for parameter checking. I am still new to the mocksignature internals so I couldn't understand how mocksignature worked. 2. For class and partial functions _check_signature is called and __call__ is overriden in the mock class to check for signature during initialization acting like a constructor. The actual signature will have self along with rest of the parameters but _get_signature_object checks for __init__ and skips the self thus the constructor signature skips self to return a partial function which makes comparing actual constructor call with self and the partial function signature without self to fail. Attaching a sample patch with tests. Hope I am on the right track and guidance would help. I am changing the version to 3.8 diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a9c82dcb5d..8cbef0e514 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -103,6 +103,7 @@ def _check_signature(func, mock, skipfirst, instance=False): sig.bind(*args, **kwargs) _copy_func_details(func, checksig) type(mock)._mock_check_sig = checksig + type(mock).__signature__ = sig def _copy_func_details(func, funcopy): @@ -172,11 +173,11 @@ def _set_signature(mock, original, instance=False): return mock(*args, **kwargs)""" % name exec (src, context) funcopy = context[name] - _setup_func(funcopy, mock) + _setup_func(funcopy, mock, sig) return funcopy -def _setup_func(funcopy, mock): +def _setup_func(funcopy, mock, sig): funcopy.mock = mock # can't use isinstance with mocks @@ -224,6 +225,7 @@ def _setup_func(funcopy, mock): funcopy.assert_called = assert_called funcopy.assert_not_called = assert_not_called funcopy.assert_called_once = assert_called_once + funcopy.__signature__ = sig mock._mock_delegate = funcopy Initial set of tests where partial function and class test fails : def test_spec_inspect_signature(self): def foo(a: int, b: int=10, *, c:int) -> int: return a b c mock = create_autospec(foo) assert inspect.getfullargspec(mock) == inspect.getfullargspec(foo) self.assertRaises(TypeError, mock, 1) def test_spec_inspect_signature_partial(self): def foo(a: int, b: int=10, *, c:int) -> int: return a b c import functools partial_object = functools.partial(foo, 1) mock = create_autospec(partial_object) assert inspect.getfullargspec(mock) == inspect.getfullargspec(partial_object) # Fails self.assertRaises(TypeError, partial_object) def test_spec_inspect_signature_class(self): class Bar: def __init__(self, a: int): self.a = a mock = create_autospec(Bar) assert inspect.getfullargspec(mock) == inspect.getfullargspec(Bar) # Fails since mock signature has no self self.assertRaises(TypeError, mock) self._check_someclass_mock(mock) ---------- versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:05:53 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 06 Nov 2018 07:05:53 +0000 Subject: [issue33578] cjkcodecs missing getstate and setstate implementations In-Reply-To: <1526713206.06.0.682650639539.issue33578@psf.upfronthosting.co.za> Message-ID: <1541487953.7.0.788709270274.issue33578@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:17:48 2018 From: report at bugs.python.org (Tal Einat) Date: Tue, 06 Nov 2018 07:17:48 +0000 Subject: [issue34897] distutils test errors when CXX is not set In-Reply-To: <1538684546.1.0.545547206417.issue34897@psf.upfronthosting.co.za> Message-ID: <1541488668.93.0.788709270274.issue34897@psf.upfronthosting.co.za> Tal Einat added the comment: Michael, please read more about comparisons[1] and the None object[2]. [1] https://docs.python.org/3/library/stdtypes.html#comparisons [2] https://docs.python.org/3/library/stdtypes.html#the-null-object ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:22:36 2018 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Nov 2018 07:22:36 +0000 Subject: [issue35143] Annotations future requires unparse, but not accessible from Python In-Reply-To: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> Message-ID: <1541488956.53.0.788709270274.issue35143@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:26:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Nov 2018 07:26:30 +0000 Subject: [issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass In-Reply-To: <1541472494.47.0.788709270274.issue35174@psf.upfronthosting.co.za> Message-ID: <1541489190.25.0.788709270274.issue35174@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: list inherits __str__ from object. object.__str__() calls __repr__() which can be overridden in subclasses. So if you want repr() and str() returned the same, you need to define only the __repr__() method. This is a feature, not a bug. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:40:29 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 07:40:29 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> Message-ID: <1541490029.74.0.788709270274.issue30129@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I did some analysis with the given example script. Related issue where Aaron has some analysis : issue12154 . The patch doesn't break anything since there are no tests for this that also could be added. 1. When we do inspect.getdoc(c.sum) it looks for obj.__doc__ (c.sum.__doc__) returning partialmethod.__doc__ ("new function with partial...") instead of checking if c.sum is a partial method and returning obj.func.__doc__ which contains the relevant doc ("sum doc"). Thus getdoc needs to check before trying for obj.__doc__ if the obj is a partialmethod or partial object thus returning the original function object. 2. When we do inspect.getdoc(Child.sum) it looks for obj.__doc__ (Child.sum.__doc__) and since Child.sum is a partialmethod which has __get__ overridden it calls _make_unbound_method that returns a _method object with no doc and thus returning None. partialmethod object copies objects from the given function at https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L368 and the actual object is returned at https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L401 . Here self.func has the original function in this case Base.sum and _method._partialmethod has reference to Base.sum which contains the relevant docs but _method itself has no docs thus pydoc doesn't get any docs. So we can set _method.__doc__ = self.func.__doc__ and getdoc can pick up the docs. sample script with print(pydoc.render_doc(Child)) print(pydoc.render_doc(c)) print(inspect.getdoc(c.sum)) # Need to patch getdoc before it checks for obj.__doc__ to check if the c.sum is an instance of partialmethod or partial print(inspect.getdoc(Child.sum)) # Need to patch functools.partialmethod._make_unbound_method to copy the docs to _method Output : ``` Python Library Documentation: class Child in module __main__ class Child(builtins.object) | Methods defined here: | | diff(self, arg1, arg2) | diff doc | | sum = _method(self, arg2) | sum doc | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) Python Library Documentation: Child in module __main__ object class Child(builtins.object) | Methods defined here: | | diff(self, arg1, arg2) | diff doc | | sum = _method(self, arg2) | sum doc | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) sum doc sum doc ``` patch : diff --git a/Lib/functools.py b/Lib/functools.py index ab7d71e126..751f67fcd0 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -398,6 +398,7 @@ class partialmethod(object): return self.func(*call_args, **call_keywords) _method.__isabstractmethod__ = self.__isabstractmethod__ _method._partialmethod = self + _method.__doc__ = self.func.__doc__ or self.__doc__ return _method def __get__(self, obj, cls): diff --git a/Lib/inspect.py b/Lib/inspect.py index b8a142232b..2c796546b2 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -600,6 +600,9 @@ def getdoc(object): All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.""" + if isinstance(object, (functools.partialmethod, functools.partial)): + return object.func.__doc__ + try: doc = object.__doc__ except AttributeError: ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 02:53:20 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 07:53:20 +0000 Subject: [issue12154] PyDoc Partial Functions In-Reply-To: <1306142131.82.0.401706336814.issue12154@psf.upfronthosting.co.za> Message-ID: <1541490800.18.0.788709270274.issue12154@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Adding my analysis here which is also at related issue : issue30129. On the attached program written by @skip.montanaro both c.sum and Child.sum return None for inspect.getdocs thus docstrings in pydoc are empty which can be fixed in both functools and inspect module as below : 1. When we do inspect.getdoc(c.sum) where c is a partialmethod it looks for obj.__doc__ (c.sum.__doc__) returning partialmethod.__doc__ ("new function with partial...") instead of checking if c.sum is a partial method and returning obj.func.__doc__ which contains the relevant doc ("sum doc"). Thus getdoc needs to check before trying for obj.__doc__ if the obj is a partialmethod or partial object thus returning the original function object. 2. When we do inspect.getdoc(Child.sum) it looks for obj.__doc__ (Child.sum.__doc__) and since Child.sum is a partialmethod which has __get__ overridden it calls _make_unbound_method that returns a _method object with no doc and thus returning None. partialmethod object copies objects from the given function at [0] and the actual object is returned at [1] . Here self.func has the original function in this case Base.sum and _method._partialmethod has reference to Base.sum which contains the relevant docs but _method itself has no docs thus pydoc doesn't get any docs. So we can set _method.__doc__ = self.func.__doc__ and getdoc can pick up the docs. [0] https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L368 [1] https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L401 Before patch partialmethod.__doc__ : $ ./python.exe >>> import functools, inspect >>> inspect.getdoc(functools.partial(int, base=2)) 'partial(func, *args, **keywords) - new function with partial application\nof the given arguments and keywords.' After patch returns int.__doc__ : ./python.exe >>> import functools, inspect >>> inspect.getdoc(functools.partial(int, base=2)) "int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer ..." # Trimmed # Patch diff --git a/Lib/functools.py b/Lib/functools.py index ab7d71e126..751f67fcd0 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -398,6 +398,7 @@ class partialmethod(object): return self.func(*call_args, **call_keywords) _method.__isabstractmethod__ = self.__isabstractmethod__ _method._partialmethod = self + _method.__doc__ = self.func.__doc__ or self.__doc__ return _method def __get__(self, obj, cls): diff --git a/Lib/inspect.py b/Lib/inspect.py index b8a142232b..2c796546b2 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -600,6 +600,9 @@ def getdoc(object): All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.""" + if isinstance(object, (functools.partialmethod, functools.partial)): + return object.func.__doc__ + try: doc = object.__doc__ except AttributeError: ---------- nosy: +xtreak Added file: https://bugs.python.org/file47910/bpo30129.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 03:22:24 2018 From: report at bugs.python.org (Julien Palard) Date: Tue, 06 Nov 2018 08:22:24 +0000 Subject: [issue35015] availability directive breaks po files In-Reply-To: <1539852628.85.0.788709270274.issue35015@psf.upfronthosting.co.za> Message-ID: <1541492544.63.0.788709270274.issue35015@psf.upfronthosting.co.za> Change by Julien Palard : ---------- keywords: +patch pull_requests: +9660 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 04:43:06 2018 From: report at bugs.python.org (Robert Pollak) Date: Tue, 06 Nov 2018 09:43:06 +0000 Subject: [issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1541497386.23.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: Here is now a reduced version of my real use case: 2017v2-reduced.db. The file was originally created with "Oracle DBConvert". This file contains a table without rows. I was wrong in my last comment: There's also no sniffing needed here, see either of the following useful outputs: ``` In [5]: pd.read_sql_query('PRAGMA table_info("t2")', con)['type'] Out[5]: 0 DATETIME 1 VARCHAR (3) Name: type, dtype: object In [6]: pd.read_sql_query('SELECT SQL FROM sqlite_master WHERE name = "t2"', con).iloc[0,0] Out[6]: 'CREATE TABLE t2 (localtime DATETIME DEFAULT NULL, freq VARCHAR (3))' ``` This also works with the original file from "Oracle DBConvert". Wouldn't it make sense for sqlite3 to use this information, e.g. when connect() is called with something like `detect_types=CONVERT_DATETIME`? One could even call the option CONVERT_ORACLE_DATETIME to describe that one cannot expect it to work with files from other sources. If yes, then I suggest changing this issue's title to '"SELECT *" should optionally autoconvert DATETIME fields if found in DDL'. The question is of course how much sqlite generating software creates this metadata. But Oracle is certainly an important actor. And sqlite3 itself could also save this DDL instead of extending the field names (which seems more hacky). ---------- Added file: https://bugs.python.org/file47911/2017v2-reduced.db _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 06:07:28 2018 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 06 Nov 2018 11:07:28 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1536176195.07.0.56676864532.issue34589@psf.upfronthosting.co.za> Message-ID: <1541502448.95.0.788709270274.issue34589@psf.upfronthosting.co.za> Nick Coghlan added the comment: The discussion with Victor on https://bugs.python.org/issue34914 highlighted the fact that it's OK to use 8-bit string comparisons to check for "-E", "-I", and a "-X coerce_legacy_c_locale=0" due to the fact that all encodings used as locale encodings are sufficiently ASCII compatible for that to work as desired. So before proceeding with merging https://github.com/python/cpython/pull/9257, I'm going to review that possibility, and see how much code it would actually add to support an extra internal helper API like: int _Py_LegacyLocaleCoercionEnabled(int argv, char* argv[]); That would then inspect the unprocessed 8-bit command line arguments, as well as the process environment, to determine whether or not locale coercion should be attempted, making the complete dance: _Py_SetLocaleFromEnv(LC_CTYPE); if (_Py_LegacyLocaleDetected() && _Py_LegacyLocaleCoercionEnabled(argc, argv)) { _Py_CoerceLegacyLocale(&pymain.report_locale_coercion); } If we wanted to officially expose this for embedding apps, the API would need a bit more thought, so it probably makes sense to wait and see if the nominally-private-but-exposed-to-the-linker approach is good enough in practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 06:59:42 2018 From: report at bugs.python.org (Camion) Date: Tue, 06 Nov 2018 11:59:42 +0000 Subject: [issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass In-Reply-To: <1541472494.47.0.788709270274.issue35174@psf.upfronthosting.co.za> Message-ID: <1541505582.35.0.788709270274.issue35174@psf.upfronthosting.co.za> Camion added the comment: @Serhiy Storchaka, this doesn't seem logical, is certainly counter intuitive, and I fear there is a lack of expressivity. - first of all, this is NOT about having str and repr returning the same at all, but about building the same _kind of_ structure representations for str and repr, but with str of sub elements in __str__, and with repr of sub elements in __repr__. It is not logical at all and completely counter intuitive, if you explicitely ask str of the superclass, to get repr of the subclass. Getting repr of the superclass would be logical, but not repr of the subclass. Now, it might happen that I missed another way to write what I tried (casting the object to it's super class with super(), to avoid explicitly naming the superclass) but if there is not, we then have something lacking in terms of expressivity. ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 07:56:13 2018 From: report at bugs.python.org (Julien Palard) Date: Tue, 06 Nov 2018 12:56:13 +0000 Subject: [issue34205] Ansible: _PyImport_LoadDynamicModuleWithSpec() crash on an invalid object (UNREF invalid object) In-Reply-To: <1532426324.25.0.56676864532.issue34205@psf.upfronthosting.co.za> Message-ID: <1541508973.86.0.788709270274.issue34205@psf.upfronthosting.co.za> Julien Palard added the comment: Can't reproduce in 3.6.7. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 07:58:12 2018 From: report at bugs.python.org (Daniel Stoinov) Date: Tue, 06 Nov 2018 12:58:12 +0000 Subject: [issue35175] Builtin function all() is handling dict() types in a weird way. Message-ID: <1541509092.34.0.788709270274.issue35175@psf.upfronthosting.co.za> New submission from Daniel Stoinov : When a dictionary is passed to all() function, it iterates the keys instead of the values. ---------- files: all-dict-example.py messages: 329354 nosy: stnv priority: normal severity: normal status: open title: Builtin function all() is handling dict() types in a weird way. type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47912/all-dict-example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 08:14:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 13:14:40 +0000 Subject: [issue22021] shutil.make_archive() root_dir do not work In-Reply-To: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> Message-ID: <1541510080.48.0.788709270274.issue22021@psf.upfronthosting.co.za> STINNER Victor added the comment: > Is anybody working on this or can I submit a PR? Yes: Joannah Nanjekye wrote PR 10191 (from Issue22021.patch) which has been rejected. This issue is more complex from what it looks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 08:16:59 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 13:16:59 +0000 Subject: [issue35175] Builtin function all() is handling dict() types in a weird way. In-Reply-To: <1541509092.34.0.788709270274.issue35175@psf.upfronthosting.co.za> Message-ID: <1541510219.58.0.788709270274.issue35175@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Dictionary iterates over keys and this is expected behavior. If you need to iterate by values you should use dict().values() $ python3 -c 'for i in dict(a=1): print(i)' a $ python3 -c 'print(all(dict(a=False)))' # Iterate by keys and thus 'a' is True True $ python3 -c 'print(all(dict(a=False).values()))' # Iterate by values explicitly False # Relevant PEP section : https://www.python.org/dev/peps/pep-0234/#dictionary-iterators > Dictionaries implement a tp_iter slot that returns an efficient iterator that iterates over the keys of the dictionary. During such an iteration, the dictionary should not be modified, except that setting the value for an existing key is allowed (deletions or additions are not, nor is the update() method). This means that we can write > for k in dict: ... https://stackoverflow.com/questions/3294889/iterating-over-dictionaries-using-for-loops This is not a bug but an expected behavior unless I am missing something from the script attached ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 08:28:07 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 06 Nov 2018 13:28:07 +0000 Subject: [issue35175] Builtin function all() is handling dict() types in a weird way. In-Reply-To: <1541509092.34.0.788709270274.issue35175@psf.upfronthosting.co.za> Message-ID: <1541510887.01.0.788709270274.issue35175@psf.upfronthosting.co.za> Change by Josh Rosenberg : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 08:56:41 2018 From: report at bugs.python.org (Dan Armentrout) Date: Tue, 06 Nov 2018 13:56:41 +0000 Subject: [issue35176] for loop range bug Message-ID: <1541512601.8.0.788709270274.issue35176@psf.upfronthosting.co.za> New submission from Dan Armentrout : If you run the following code: x=[3,4,5] a=x for i in range(0,len(a)): a[i]=0 All x values are changed to equal a. ---------- components: Windows messages: 329357 nosy: darmentr, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: for loop range bug versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:04:03 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 06 Nov 2018 14:04:03 +0000 Subject: [issue35176] for loop range bug In-Reply-To: <1541512601.8.0.788709270274.issue35176@psf.upfronthosting.co.za> Message-ID: <1541513043.67.0.788709270274.issue35176@psf.upfronthosting.co.za> Steven D'Aprano added the comment: This is not a bug, this is standard behaviour, working as designed. 'a' is not a copy of the list 'x', 'a' is another name for the same list as 'x'. Any in-place modifications you make to 'a' happens to the object itself, the list, which is visible regardless of which name you refer to it by. If you are a C programmer, you can think of this as being similar to pointers: think of 'x' as a pointer to the list, and 'a' as a pointer to the same list. (That's more or less what happens under the hood.) From the Python level, we say that both names 'a' and 'x' refer to the same object. If you want a copy, you can use the copy module, or for lists, you can take a slice: a = x[:] makes a copy of the list. For immutable objects like strings, you don't need a copy, because you cannot modify them in place: any operation on a string always creates a new string, leaving the old one untouched. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:08:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 14:08:41 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files Message-ID: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> New submission from STINNER Victor : Currently, there are *implicit* dependencies between AST/parser header files. For example, ast.h uses node and mod_ty types but don't include node.h nor Python-ast.h. And parsetok.h uses node and grammer but don't include nor grammar.h. Because of that, C files have to include header files in the "correct order" and need to include header files even if they don't use directly. At the end, we get something like pythonrun.c: #include "Python-ast.h" #include "pycore_state.h" #include "grammar.h" #include "node.h" #include "token.h" #include "parsetok.h" #include "errcode.h" #include "code.h" #include "symtable.h" #include "ast.h" #include "marshal.h" #include "osdefs.h" #include whereas most header files are useless, pythonrun.c still compiles with: #include "pycore_state.h" #include "token.h" /* INDENT in err_input() */ #include "parsetok.h" /* PyParser_ParseFileObject() */ #include "errcode.h" /* E_EOF */ #include "symtable.h" /* PySymtable_BuildObject() */ #include "ast.h" /* PyAST_FromNodeObject() */ #include "marshal.h" /* PyMarshal_ReadLongFromFile */ #include I propose to add explicit dependencies in header files directly, rather than using black magic in C files. Attached PR fix this issue. ---------- components: Interpreter Core messages: 329359 nosy: vstinner priority: normal severity: normal status: open title: Add missing dependencies between AST/parser header files versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:09:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 14:09:36 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1541513376.7.0.788709270274.issue35177@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9661 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:23:25 2018 From: report at bugs.python.org (Dan Armentrout) Date: Tue, 06 Nov 2018 14:23:25 +0000 Subject: [issue35176] for loop range bug In-Reply-To: <1541513043.67.0.788709270274.issue35176@psf.upfronthosting.co.za> Message-ID: Dan Armentrout added the comment: Thank you for your quick explanation of this to me. Dan On Tue, Nov 6, 2018 at 8:04 AM Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > > This is not a bug, this is standard behaviour, working as designed. > > 'a' is not a copy of the list 'x', 'a' is another name for the same list > as 'x'. Any in-place modifications you make to 'a' happens to the object > itself, the list, which is visible regardless of which name you refer to it > by. > > If you are a C programmer, you can think of this as being similar to > pointers: think of 'x' as a pointer to the list, and 'a' as a pointer to > the same list. (That's more or less what happens under the hood.) From the > Python level, we say that both names 'a' and 'x' refer to the same object. > > If you want a copy, you can use the copy module, or for lists, you can > take a slice: a = x[:] makes a copy of the list. > > For immutable objects like strings, you don't need a copy, because you > cannot modify them in place: any operation on a string always creates a new > string, leaving the old one untouched. > > ---------- > nosy: +steven.daprano > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:26:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 14:26:29 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541514389.32.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9662 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:39:26 2018 From: report at bugs.python.org (tphh) Date: Tue, 06 Nov 2018 14:39:26 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency In-Reply-To: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> Message-ID: <1541515166.75.0.788709270274.issue35168@psf.upfronthosting.co.za> tphh added the comment: So a documentation update and a better run time error message which clarifies that shlex.punctuation_chars is read-only? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 09:59:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 14:59:57 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541516397.88.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5ed6995675b084fe583b71f96fdde4413bb2a77b by Victor Stinner in branch 'master': bpo-35081: Add _PyCoreConfig_AsDict() (GH-10362) https://github.com/python/cpython/commit/5ed6995675b084fe583b71f96fdde4413bb2a77b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 10:07:10 2018 From: report at bugs.python.org (Tashrif Billah) Date: Tue, 06 Nov 2018 15:07:10 +0000 Subject: [issue35178] Typo/trivial mistake in warnings.py (may be related to 2.x to 3.x conversion) Message-ID: <1541516830.55.0.788709270274.issue35178@psf.upfronthosting.co.za> New submission from Tashrif Billah : ``` 2018-11-06 09:51:27,314 /home/tb571/Downloads/pnlpipe/pnlscripts/wmql.py DEBUG Running ['/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/scripts/tract_math', '/home/tb571/Downloads/pnlpipe/_data/003_GNX_007/Ukf-003_GNX_007-761f2a551e.vtk', 'tract_remove_short_tracts', '2', '/tmp/tmpq2z9fmfc/ukfpruned.vtk'] Traceback (most recent call last): File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/scripts/tract_math", line 115, in main tractography, *args.operation_parameters) File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tract_math/decorator.py", line 141, in wrapper process_output(out, file_output=file_output) File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tract_math/decorator.py", line 176, in process_output tractography_to_file(file_output, output) File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tractography/__init__.py", line 85, in tractography_to_file return tractography_to_vtk_file(filename, tractography, **kwargs) File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tractography/vtkInterface.py", line 29, in tractography_to_vtk_file tractography.tracts_data() File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tractography/vtkInterface.py", line 324, in write_vtkPolyData poly_data = tracts_to_vtkPolyData(tracts, tracts_data=tracts_data) File "/home/tb571/Downloads/pnlpipe/soft_dir/tract_querier-c57d670/tract_querier/tractography/vtkInterface.py", line 267, in tracts_to_vtkPolyData vtk_ids = ns.numpy_to_vtkIdTypeArray(ids, deep=True) File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/site-packages/vtk/util/numpy_support.py", line 198, in numpy_to_vtkIdTypeArray return numpy_to_vtk(num_array, deep, vtk.VTK_ID_TYPE) File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/site-packages/vtk/util/numpy_support.py", line 137, in numpy_to_vtk assert not numpy.issubdtype(z.dtype, complex), \ File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/site-packages/numpy/core/numerictypes.py", line 743, in issubdtype FutureWarning, stacklevel=2 File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/warnings.py", line 101, in _showwarnmsg _showwarnmsg_impl(msg) File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/warnings.py", line 28, in _showwarnmsg_impl text = _formatwarnmsg(msg) File "/home/tb571/miniconda3/envs/pnlpipe3/lib/python3.6/warnings.py", line 116, in _formatwarnmsg msg.filename, msg.lineno, line= msg.line) TypeError: custom_formatwarning() got an unexpected keyword argument 'line' ``` ---------- components: Argument Clinic messages: 329363 nosy: larry, tashrifbillah priority: normal pull_requests: 9663 severity: normal status: open title: Typo/trivial mistake in warnings.py (may be related to 2.x to 3.x conversion) type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 10:11:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 15:11:02 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541517062.06.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9664 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 10:22:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Nov 2018 15:22:23 +0000 Subject: [issue35178] Typo/trivial mistake in warnings.py (may be related to 2.x to 3.x conversion) In-Reply-To: <1541516830.55.0.788709270274.issue35178@psf.upfronthosting.co.za> Message-ID: <1541517743.61.0.788709270274.issue35178@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This may be a consequence of issue26568. ---------- nosy: +serhiy.storchaka, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 11:18:20 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 06 Nov 2018 16:18:20 +0000 Subject: [issue22021] shutil.make_archive() root_dir do not work In-Reply-To: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> Message-ID: <1541521100.85.0.788709270274.issue22021@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Since Serhiy said that this is a pure documentation issue, I thought that a doc PR is all that was needed, which I would be happy to make. Am I missing something here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 11:41:31 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 06 Nov 2018 16:41:31 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 Message-ID: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> New submission from Andrew Svetlov : On Linux maximum data size for sendfile call is 0x7ffff000: sendfile() will transfer at most 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually transferred. (This is true on both 32-bit and 64-bit systems.) Limiting max block size to this value on all OSes makes sense: splitting transferring the very huge file into several syscalls doesn't hurt performance anyway. Windows uses DWORD for size in TransmitFile, so the size is limited as well. ---------- components: macOS messages: 329366 nosy: asvetlov, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Limit max sendfile chunk to 0x7ffff000 versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 11:42:08 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 06 Nov 2018 16:42:08 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541522528.31.0.788709270274.issue35179@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- components: +Library (Lib), asyncio -macOS nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 11:42:33 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 06 Nov 2018 16:42:33 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541522553.81.0.788709270274.issue35179@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- nosy: +giampaolo.rodola -ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 11:47:10 2018 From: report at bugs.python.org (Bob) Date: Tue, 06 Nov 2018 16:47:10 +0000 Subject: [issue35180] Ctypes segfault or TypeError tested for python2.7 and 3 Message-ID: <1541522830.02.0.788709270274.issue35180@psf.upfronthosting.co.za> New submission from Bob : ~Description of the problem: I was using ctypes to get a directory file descriptor, and to do so I found this mailing list (https://lists.gt.net/python/dev/696028) from 2008 where a user wrote a piece that could do what the asking user and me were looking for. What concerns me is how much this code has been used when I looked though Github and Google and came across the same exact pieces. The code provided looks like this: from ctypes import CDLL, c_char_p, c_int, Structure, POINTER from ctypes.util import find_library class c_dir(Structure): """Opaque type for directory entries, corresponds to struct DIR""" c_dir_p = POINTER(c_dir) c_lib = CDLL(find_library("c")) opendir = c_lib.opendir opendir.argtypes = [c_char_p] opendir.restype = c_dir_p dirfd = c_lib.dirfd < -- IT FAILS HERE // STACK TRACE PROVIDED dirfd.argtypes = [c_dir_p] dirfd.restype = c_int closedir = c_lib.closedir closedir.argtypes = [c_dir_p] closedir.restype = c_int dir_p = opendir(".") print "dir_p = %r" % dir_p dir_fd = dirfd(dir_p) print "dir_fd = %r" % dir_fd print "closed (rc %r)" % closedir(dir_p) When I implemented it in my machine, I changed it a bit so "opendir()" got its arguments from an imputed value, and the final program looks like this: from ctypes import * import sys import ctypes from ctypes.util import find_library class c_dir(Structure): """Opaque type for directory entries, corresponds to struct DIR""" def get_directory_file_descriptor(directory): c_dir_p = POINTER(c_dir) c_lib = CDLL(find_library("c")) opendir = c_lib.opendir opendir.argtypes = [c_char_p] opendir.restype = c_dir_p dirfd = c_lib.dirfd < -- SAME. FAILS HERE. dirfd.argtypes = [c_dir_p] dirfd.restype = c_int closedir = c_lib.closedir closedir.argtypes = [c_dir_p] closedir.restype = c_int dir_p = opendir("%s" % directory) print ("dir_p = %s:%r" % (directory, dir_p)) dir_fd = dirfd(dir_p) print("dir_fd = %r" % dir_fd) print ("closed (rc %r)" % closedir(dir_p)) get_directory_file_descriptor(sys.argv[1]) When I run it *with python 2.7*, the program runs normally if I enter the expected value, like "/home/". But if I don't, the program exits with a segmentation fault. In python 3, it fails no matter what with a TypeError. INPUT when NOT giving the error (in python 2.7): /home/ INPUT when giving the error: aaa ~Stack trace from python 2.7: Program received signal SIGSEGV, Segmentation fault. dirfd (dirp=0x0) at ../sysdeps/posix/dirfd.c:27 27 ../sysdeps/posix/dirfd.c: No such file or directory. (gdb) bt #0 dirfd (dirp=0x0) at ../sysdeps/posix/dirfd.c:27 #1 0x00007ffff6698e40 in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #2 0x00007ffff66988ab in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #3 0x00007ffff68a83df in _call_function_pointer (argcount=1, resmem=0x7fffffffd630, restype=, atypes=, avalues=0x7fffffffd610, pProc=0x7ffff78b8960 , flags=4353) at /build/python2.7-dPs3Rr/python2.7-2.7.12/Modules/_ctypes/callproc.c:837 #4 _ctypes_callproc (pProc=0x7ffff78b8960 , argtuple=, flags=4353, argtypes=(,), restype=<_ctypes.PyCSimpleType at remote 0xa38ce0>, checker=0x0) at /build/python2.7-dPs3Rr/python2.7-2.7.12/Modules/_ctypes/callproc.c:1180 #5 0x00007ffff68acd82 in PyCFuncPtr_call.lto_priv.107 (self=self at entry=0x7ffff7e322c0, inargs=inargs at entry=(,), kwds=kwds at entry=0x0) at /build/python2.7-dPs3Rr/python2.7-2.7.12/Modules/_ctypes/_ctypes.c:3954 #6 0x00000000004c15bf in PyObject_Call (kw=0x0, arg=(,), func=<_FuncPtr(__name__='dirfd') at remote 0x7ffff7e322c0>) at ../Objects/abstract.c:2546 #7 do_call (nk=, na=, pp_stack=0x7fffffffd890, func=<_FuncPtr(__name__='dirfd') at remote 0x7ffff7e322c0>) at ../Python/ceval.c:4567 #8 call_function (oparg=, pp_stack=0x7fffffffd890) at ../Python/ceval.c:4372 #9 PyEval_EvalFrameEx () at ../Python/ceval.c:2987 #10 0x00000000004c136f in fast_function (nk=, na=, n=1, pp_stack=0x7fffffffd9b0, func=) at ../Python/ceval.c:4435 #11 call_function (oparg=, pp_stack=0x7fffffffd9b0) at ../Python/ceval.c:4370 #12 PyEval_EvalFrameEx () at ../Python/ceval.c:2987 #13 0x00000000004b9ab6 in PyEval_EvalCodeEx () at ../Python/ceval.c:3582 #14 0x00000000004eb30f in PyEval_EvalCode ( locals={'c_void_p': <_ctypes.PyCSimpleType at remote 0xa3df50>, 'c_int64': <_ctypes.PyCSimpleType at remote 0xa1d7b0>, 'c_ssize_t': <_ctypes.PyCSimpleType at remote 0xa1d7b0>, 'c_longdouble': <_ctypes.PyCSimpleType at remote 0xa3c360>, 'Union': <_ctypes.UnionType at remote 0x7ffff6abc400>, 'cdll': ) at remote 0x7ffff7e2c450>, 'c_wchar': <_ctypes.PyCSimpleType at remote 0xa3f0b0>, 'memset': , 'c_bool': <_ctypes.PyCSimpleType at remote 0xa3e620>, 'CFUNCTYPE': , 'DEFAULT_MODE': 0, 'string_at': , 'c_voidp': <_ctypes.PyCSimpleType at re---Type to continue, or q to quit--- mote 0xa3df50>, '__name__': '__main__', 'c_uint64': <_ctypes.PyCSimpleType at remote 0xa367b0>, 'sizeof': , 'byref': , 'pointer': , 'alignment': , 'pydll': ) at remote 0x7ffff7e2c...(truncated), globals={'c_void_p': <_ctypes.PyCSimpleType at remote 0xa3df50>, 'c_int64': <_ctypes.PyCSimpleType at remote 0xa1d7b0>, 'c_ssize_t': <_ctypes.PyCSimpleType at remote 0xa1d7b0>, 'c_longdouble': <_ctypes.PyCSimpleType at remote 0xa3c360>, 'Union': <_ctypes.UnionType at remote 0x7ffff6abc400>, 'cdll': ) at remote 0x7ffff7e2c450>, 'c_wchar': <_ctypes.PyCSimpleType at remote 0xa3f0b0>, 'memset': , 'c_bool': <_ctypes.PyCSimpleType at remote 0xa3e620>, 'CFUNCTYPE': , 'DEFAULT_MODE': 0, 'string_at': , 'c_voidp': <_ctypes.PyCSimpleType at remote 0xa3df50>, '__name__': '__main__', 'c_uint64': <_ctypes.PyCSimpleType at remote 0xa367b0>, 'sizeof': , 'byref': , 'pointer': , 'alignment': , 'pydll': ) at remote 0x7ffff7e2c...(truncated), co=0x7ffff7ed2d30) at ../Python/ceval.c:669 #15 run_mod.lto_priv () at ../Python/pythonrun.c:1376 #16 0x00000000004e5422 in PyRun_FileExFlags () at ../Python/pythonrun.c:1362 #17 0x00000000004e3cd6 in PyRun_SimpleFileExFlags () at ../Python/pythonrun.c:948 #18 0x0000000000493ae2 in Py_Main () at ../Modules/main.c:640 #19 0x00007ffff7810830 in __libc_start_main (main=0x4934c0
, argc=3, argv=0x7fffffffddf8, init=, fini=, rtld_fini=, stack_end=0x7fffffffdde8) at ../csu/libc-start.c:291 #20 0x00000000004933e9 in _start () ~The reason I thought that this may be a bug is because while researching the problem, I came across this other bug (https://bugzilla.redhat.com/show_bug.cgi?id=674206) where the user specifies a similar issue for RedHat. The difference, though, is that in that case it could be fixed by specifying the argtypes, while in my case it's already specified. I tested this on an Ubuntu 16.04 and ArchLinux machine and got the same results. ---------- components: ctypes messages: 329367 nosy: execve priority: normal severity: normal status: open title: Ctypes segfault or TypeError tested for python2.7 and 3 versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:07:49 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 06 Nov 2018 17:07:49 +0000 Subject: [issue35180] Ctypes segfault or TypeError tested for python2.7 and 3 In-Reply-To: <1541522830.02.0.788709270274.issue35180@psf.upfronthosting.co.za> Message-ID: <1541524069.14.0.788709270274.issue35180@psf.upfronthosting.co.za> Josh Rosenberg added the comment: The TypeError on Py3 would be because functions taking c_char_p need bytes-like objects, not str, on Python 3. '%s' % directory is pointless when directory is a str; instead you need to encode it to a bytes-like object, e.g. opendir(os.fsencode(directory)) (os.fsencode is Python 3 specific; plain str works fine on Py 2). Your segfault isn't occurring when you load dirfd, it occurs when you call it on the result of opendir, when opendir returned NULL on failure (due to the non-existent directory you call it with). You didn't check the return value, and end up doing flagrantly illegal things with it. In neither case is this a bug in Python; ctypes lets you do evil things that break the rules, and if you break the rules the wrong way, segfaults are to be expected. Fix your argument types (for Py3), check your return values (for Py2). ---------- nosy: +josh.r resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:16:31 2018 From: report at bugs.python.org (Bob) Date: Tue, 06 Nov 2018 17:16:31 +0000 Subject: [issue35180] Ctypes segfault or TypeError tested for python2.7 and 3 In-Reply-To: <1541524069.14.0.788709270274.issue35180@psf.upfronthosting.co.za> Message-ID: Bob added the comment: Hi Josh thanks for answering me and so quick. So if I understood correctly, by inserting an unexpected and unchecked on value, it could lead to a potential vulnerability in the program? Or just a plain failure (which could be a denial of service also)? Thanks again. Sent with ProtonMail Secure Email. ??????? Original Message ??????? On Tuesday, November 6, 2018 5:07 PM, Josh Rosenberg wrote: > Josh Rosenberg shadowranger+python at gmail.com added the comment: > > The TypeError on Py3 would be because functions taking c_char_p need bytes-like objects, not str, on Python 3. '%s' % directory is pointless when directory is a str; instead you need to encode it to a bytes-like object, e.g. opendir(os.fsencode(directory)) (os.fsencode is Python 3 specific; plain str works fine on Py 2). > > Your segfault isn't occurring when you load dirfd, it occurs when you call it on the result of opendir, when opendir returned NULL on failure (due to the non-existent directory you call it with). You didn't check the return value, and end up doing flagrantly illegal things with it. > > In neither case is this a bug in Python; ctypes lets you do evil things that break the rules, and if you break the rules the wrong way, segfaults are to be expected. Fix your argument types (for Py3), check your return values (for Py2). > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > nosy: +josh.r > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > Python tracker report at bugs.python.org > https://bugs.python.org/issue35180 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:37:42 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 17:37:42 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541525862.15.0.788709270274.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6 by Terry Jan Reedy in branch 'master': bpo-23220: Explain how IDLE's Shell displays output (GH-10356) https://github.com/python/cpython/commit/75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:37:48 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 17:37:48 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541525868.93.0.788709270274.issue23220@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:37:58 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 17:37:58 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541525878.4.0.788709270274.issue23220@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 12:53:52 2018 From: report at bugs.python.org (Tobias Kunze) Date: Tue, 06 Nov 2018 17:53:52 +0000 Subject: [issue22021] shutil.make_archive() root_dir do not work In-Reply-To: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> Message-ID: <1541526832.96.0.788709270274.issue22021@psf.upfronthosting.co.za> Tobias Kunze added the comment: Yes, this is a documentation issue: A patch clarifying what root_dir and base_dir do, and how they interact (or how they are to be used in combination) would be sufficient to close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:08:14 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 06 Nov 2018 18:08:14 +0000 Subject: [issue22021] shutil.make_archive() root_dir do not work In-Reply-To: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> Message-ID: <1541527694.06.0.788709270274.issue22021@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- pull_requests: +9668 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:14:44 2018 From: report at bugs.python.org (Mark Sapiro) Date: Tue, 06 Nov 2018 18:14:44 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541528084.82.0.788709270274.issue34155@psf.upfronthosting.co.za> Mark Sapiro added the comment: The issue is illustrated much more simply as follows: email.utils.parseaddr('John Doe jdoe at example.com ') returns ('', 'John Doe jdoe at example.com') whereas it should return ('John Doe jdoe at example.com', 'other at example.net') I'll look at developing a patch. ---------- nosy: +msapiro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:14:59 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 18:14:59 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541528099.13.0.788709270274.issue23220@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:26:50 2018 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Nov 2018 18:26:50 +0000 Subject: [issue9731] Add ABCMeta.has_methods and tests that use it In-Reply-To: <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za> Message-ID: <1541528810.72.0.788709270274.issue9731@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:27:23 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 18:27:23 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541528843.75.0.788709270274.issue23220@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 34fcee9ed81c954d6418241ad546f71e103d3b9b by Miss Islington (bot) in branch '3.7': bpo-23220: Explain how IDLE's Shell displays output (GH-10356) https://github.com/python/cpython/commit/34fcee9ed81c954d6418241ad546f71e103d3b9b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:42:14 2018 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Nov 2018 18:42:14 +0000 Subject: [issue35169] Improve error messages for assignment In-Reply-To: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> Message-ID: <1541529734.34.0.788709270274.issue35169@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:44:40 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Nov 2018 18:44:40 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541529880.9.0.788709270274.issue23220@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 13:59:44 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 18:59:44 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541530784.03.0.788709270274.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 7476fefb65075161d57435c8dd7e92437578d3c1 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6': bpo-23220: Explain how IDLE's Shell displays output (GH-10356) (#10369) https://github.com/python/cpython/commit/7476fefb65075161d57435c8dd7e92437578d3c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:14:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Nov 2018 19:14:43 +0000 Subject: [issue30455] Generate C code from token.py and not vice versa In-Reply-To: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> Message-ID: <1541531683.2.0.788709270274.issue30455@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:18:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Nov 2018 19:18:30 +0000 Subject: [issue30455] Generate C code from token.py and not vice versa In-Reply-To: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> Message-ID: <1541531910.2.0.788709270274.issue30455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Alternate PR 10370 generates all files from a single file Grammar/Tokens using a single script Tools/scripts/generate_token.py. In addition, the script doesn't write files when the content is not changed. Thus it can be used with read-only sources. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:23:24 2018 From: report at bugs.python.org (R. David Murray) Date: Tue, 06 Nov 2018 19:23:24 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541532204.68.0.788709270274.issue34155@psf.upfronthosting.co.za> R. David Murray added the comment: >>> m = message_from_string("From: John Doe jdoe at example.com \n\n", policy=default) >>> m['From'].addresses(Address(display_name='', username='John Doe jdoe', domain='example.com'),) The new policies have more error recovery for non-RFC compliant addresses than decode_header, but the two agree in this case. What is happening here is that (1) an unquoted/unencoded '@' is not allowed in a display name (2) if the address is not '<>' quoted, then everything before the @ is the username and (3) in the absence of a comma after the end of the fqdn (which is not allowed to contain blanks) any additional tokens are discarded. One could argue that we could treat the blank after the FQDN as a "missing comma", and there would be some merit to that argument. You could also argue that a "<>" quoted string would trump the occurrence of the @ earlier in the token list. However, the RFC822 grammar is designed to be parsed character by character, so that would not be a typical way for an RFC822 parser to try to do postel-style error recovery. So, I don't think there is a bug here, but I'd be curious what other email address parsing libraries do, and that could influence whether extensions to the "make a guess when the string doesn't conform to the RFC" code would be acceptable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:24:59 2018 From: report at bugs.python.org (R. David Murray) Date: Tue, 06 Nov 2018 19:24:59 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541532299.8.0.788709270274.issue34155@psf.upfronthosting.co.za> R. David Murray added the comment: The formatting of that doctest paragraph got messed up. Let me try again: >>> m = message_from_string("From: John Doe jdoe at example.com \n\n", policy=default) >>> m['From'].addresses (Address(display_name='', username='John Doe jdoe', domain='example.com'),) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:27:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Nov 2018 19:27:01 +0000 Subject: [issue30455] Generate all tokens related code and docs from Grammar/Tokens In-Reply-To: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> Message-ID: <1541532421.39.0.788709270274.issue30455@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- title: Generate C code from token.py and not vice versa -> Generate all tokens related code and docs from Grammar/Tokens versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:38:41 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 06 Nov 2018 19:38:41 +0000 Subject: [issue17560] problem using multiprocessing with really big objects? In-Reply-To: <1364399521.2.0.696890688109.issue17560@psf.upfronthosting.co.za> Message-ID: <1541533121.54.0.788709270274.issue17560@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset bccacd19fa7b56dcf2fbfab15992b6b94ab6666b by Antoine Pitrou (Alexander Buchkovsky) in branch 'master': bpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH-10305) https://github.com/python/cpython/commit/bccacd19fa7b56dcf2fbfab15992b6b94ab6666b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:39:00 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 06 Nov 2018 19:39:00 +0000 Subject: [issue17560] problem using multiprocessing with really big objects? In-Reply-To: <1364399521.2.0.696890688109.issue17560@psf.upfronthosting.co.za> Message-ID: <1541533140.31.0.788709270274.issue17560@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- assignee: davin -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:48:48 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 19:48:48 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541533728.64.0.788709270274.issue34155@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Is this a case of realname having @ inside an unquoted string? As I can see from the RFC the acceptable characters of an atom other than alphabets and digits that comprises a phrase are ['!', '#', '$', '%', '&', "'", '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~'] . So just curious if it's a case of @ inside unquoted string as name? >>> for char in accepted: ... print(parseaddr(f'John Doe jdoe{char}example.com ')) ... ('John Doe jdoe!example.com', 'other at example.net') ('John Doe jdoe#example.com', 'other at example.net') ('John Doe jdoe$example.com', 'other at example.net') ('John Doe jdoe%example.com', 'other at example.net') ('John Doe jdoe&example.com', 'other at example.net') ("John Doe jdoe'example.com", 'other at example.net') ('John Doe jdoe*example.com', 'other at example.net') ('John Doe jdoe+example.com', 'other at example.net') ('John Doe jdoe-example.com', 'other at example.net') ('John Doe jdoe/example.com', 'other at example.net') ('John Doe jdoe=example.com', 'other at example.net') ('John Doe jdoe?example.com', 'other at example.net') ('John Doe jdoe^example.com', 'other at example.net') ('John Doe jdoe_example.com', 'other at example.net') ('John Doe jdoe`example.com', 'other at example.net') ('John Doe jdoe{example.com', 'other at example.net') ('John Doe jdoe|example.com', 'other at example.net') ('John Doe jdoe}example.com', 'other at example.net') ('John Doe jdoe~example.com', 'other at example.net') >>> parseaddr('"John Doe jdoe at example.com" ') ('John Doe jdoe at example.com', 'other at example.net') >>> parseaddr('John Doe jdoe at example.com ') ('', 'John Doe jdoe at example.com') ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 14:55:26 2018 From: report at bugs.python.org (Mark Sapiro) Date: Tue, 06 Nov 2018 19:55:26 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541534126.03.0.788709270274.issue34155@psf.upfronthosting.co.za> Mark Sapiro added the comment: I agree that my example with an @ in the 'display name', although actually seen in the wild, is non-compliant, and that the behavior of parseaddr() in this case is not a bug. Sorry for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:02:10 2018 From: report at bugs.python.org (Oscar Esteban) Date: Tue, 06 Nov 2018 20:02:10 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1541534530.58.0.788709270274.issue22393@psf.upfronthosting.co.za> Oscar Esteban added the comment: Hi Antoine, I may take a stab at it. Before I start, should I branch from master or from 3.7.1 (as 3.7 is still accepting bugfixes). Best, Oscar ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:27:34 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Nov 2018 20:27:34 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541536054.45.0.788709270274.issue34155@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Ah sorry, I was typing so long and had an idle session that I didn't realize @r.david.murray added a comment with the explanation. Just to add I tried using Perl module (https://metacpan.org/release/Email-Address) that uses regex for parsing that returns me two addresses and the regex is also not much comprehensible. use v5.14; use Email::Address; my $line = 'John Doe jdoe at example.com '; my @addresses = Email::Address->parse($line); say $addresses[0]; say $addresses[1]; say "Angle address regex"; say $Email::Address::angle_addr; jdoe at example.com other at example.net Angle address regex (?^:(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*<(?^:(?^:(?^:(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*(?^:[^\x00-\x1F\x7F()<>\[\]:;@\\,."\s]+(?:\.[^\x00-\x1F\x7F()<>\[\]:;@\\,."\s]+)*)(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*)|(?^:(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*"(?^:(?^:[^\\"])|(?^:\\(?^:[^\x0A\x0D])))*"(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*))\@(?^:(?^:(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*(?^:[^\x00-\x1F\x7F()<>\[\]:;@\\,."\s]+(?:\.[^\x00-\x1F\x7F()<>\[\]:;@\\,."\s]+)*)(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*)|(?^:(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*\[(?:\s*(?^:(?^:[^\[\]\\])|(?^:\\(?^:[^\x0A\x0D]))))*\s*\](?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*)))>(?^:(?^:\s*\((?:\s*(?^:(?^:(?>[^()\\]+))|(?^:\\(?^:[^\x0A\x0D]))|))*\s*\)\s*)|\s+)*) Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:28:40 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 06 Nov 2018 20:28:40 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1541536120.12.0.788709270274.issue22393@psf.upfronthosting.co.za> Antoine Pitrou added the comment: You should start from master. Bugfixes can backported afterwards if appropriate. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:36:09 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Tue, 06 Nov 2018 20:36:09 +0000 Subject: [issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build In-Reply-To: <1541448216.81.0.788709270274.issue35170@psf.upfronthosting.co.za> Message-ID: <1541536569.64.0.788709270274.issue35170@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: The in-tree copy of libffi was removed in #27979 (between 3.6 and 3.7) for all platforms except Windows and macOS. Therefore, you need libffi development package installed in your system to build CPython 3.7. As for PIP, personally, I think that's an overkill to require ctypes, especially at CPython build time. If you don't want to build ctypes, I believe you may use '--without-ensurepip' configure option as a workaround. ---------- nosy: +izbyshev, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:46:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 20:46:40 +0000 Subject: [issue35178] Typo/trivial mistake in warnings.py (may be related to 2.x to 3.x conversion) In-Reply-To: <1541516830.55.0.788709270274.issue35178@psf.upfronthosting.co.za> Message-ID: <1541537200.62.0.788709270274.issue35178@psf.upfronthosting.co.za> STINNER Victor added the comment: > Typo/trivial mistake in warnings.py (may be related to 2.x to 3.x conversion) It's not a typo: it's that my change now requires the last argument of formatwarning() to be a keyword argument called 'line'. The error comes from numpy. But I'm fine to now require that the last formatwarning() argument is called 'line' and pass its value as an positional argument, not as a keyword argument. In that case, I would like to see an unit test to check that replacing warnings.formatwarning() with a new function and the last parameter of this function is not called 'line' still works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 15:59:54 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 06 Nov 2018 20:59:54 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541537994.47.0.788709270274.issue35179@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Do you mean raising an exception if "count" argument is passed and > 2,147,479,552? In that case I think asyncio's sendfile() should simply do the math to transmit that many bytes by taking into account that os.sendfile() may return less bytes than requested. With non-blocking sockets in particular that is true regardless from the size being passed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 16:32:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 21:32:10 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541539930.79.0.788709270274.issue35179@psf.upfronthosting.co.za> STINNER Victor added the comment: os.write(data) can write less than len(data) bytes. It's by contract, as socket.send(data) can send less than len(data). It is used to truncated the length argument to INT_MAX, to be able to cast it to an int on Windows. Extract of _Py_write(): #ifdef MS_WINDOWS if (count > 32767 && isatty(fd)) { /* Issue #11395: the Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage). */ count = 32767; } #endif if (count > _PY_WRITE_MAX) { count = _PY_WRITE_MAX; } with: #if defined(MS_WINDOWS) || defined(__APPLE__) /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). On macOS 10.13, read() and write() with more than INT_MAX bytes fail with EINVAL (bpo-24658). */ # define _PY_READ_MAX INT_MAX # define _PY_WRITE_MAX INT_MAX #else /* write() should truncate the input to PY_SSIZE_T_MAX bytes, but it's safer to do it ourself to have a portable behaviour */ # define _PY_READ_MAX PY_SSIZE_T_MAX # define _PY_WRITE_MAX PY_SSIZE_T_MAX #endif Can we do something similar for sendfile()? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 16:35:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 21:35:06 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541540106.6.0.788709270274.issue35179@psf.upfronthosting.co.za> STINNER Victor added the comment: > In that case I think asyncio's sendfile() should simply do the math to transmit that many bytes by taking into account that os.sendfile() may return less bytes than requested. The internal sendfile() implementation in asyncio already loops until all bytes are sent. Extract of unix_events.py: def _sock_sendfile_native_impl(self, fut, registered_fd, sock, fileno, offset, count, blocksize, total_sent): ... try: sent = os.sendfile(fd, fileno, offset, blocksize) except (BlockingIOError, InterruptedError): ... else: if sent == 0: # EOF self._sock_sendfile_update_filepos(fileno, offset, total_sent) fut.set_result(total_sent) else: offset += sent total_sent += sent self.add_writer(fd, self._sock_sendfile_native_impl, fut, ...) asyncio doesn't need to be modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 16:36:58 2018 From: report at bugs.python.org (Luna Chen) Date: Tue, 06 Nov 2018 21:36:58 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541540218.14.0.788709270274.issue34805@psf.upfronthosting.co.za> Luna Chen added the comment: Hi Pekka Kl?rck, I would like to work on this issue and make a PR if you haven't done it yet. Thanks!:) ---------- nosy: +BNMetrics _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 16:37:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 21:37:11 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541540231.89.0.788709270274.issue35179@psf.upfronthosting.co.za> STINNER Victor added the comment: The manual page says: sendfile() will transfer at most 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually transferred. (This is true on both 32-bit and 64-bit systems.) I understand that you can pass a larger length, but a single sendfile() function call will never copy more than 0x7ffff000 bytes. I see nothing wrong here. If you want to be sure, try to copy more bytes than 0x7ffff000 and see what happens :-) Use strace to check system calls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:00:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 22:00:05 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541541605.35.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:11:37 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Nov 2018 22:11:37 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541542297.69.0.788709270274.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I merged a first edition of the new section. It does not include Mac behavior, so will need revision. But I want to do some experiments with tk/inter on various systems before doing so. ---------- dependencies: +IDLE Doc: Text consumes unlimited RAM, consoles likely not stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:29:09 2018 From: report at bugs.python.org (Julien Palard) Date: Tue, 06 Nov 2018 22:29:09 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None Message-ID: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> New submission from Julien Palard : The documentation states that a __loader__ of a namespace package should be None: - [1] "For namespace packages this should be set to None." - [2] "To indicate to the import machinery that the spec represents a namespace portion. the path entry finder sets ?loader? on the spec to None". But this looks wrong [3], looks like it has been changed in [4]/[5]. I think one should rely on __file__ being None on namespace packages (which make sense as they span over multiple directories) instead of __loader__ being None (a side effect of the import machinery ?). [1]: https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.loader [2]: https://docs.python.org/3/reference/import.html#path-entry-finder-protocol [3]: https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none [4]: https://bugs.python.org/issue32303 [5]: https://github.com/python/cpython/pull/5481/files#diff-a6592cec2ebc8dba9bbf7d396370b138L319 ---------- assignee: docs at python components: Documentation messages: 329392 nosy: docs at python, mdk priority: normal severity: normal status: open title: Doc: Namespace Packages: Inconsistent documentation of __loader__ being None versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:31:55 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 06 Nov 2018 22:31:55 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541543515.31.0.788709270274.issue35179@psf.upfronthosting.co.za> Andrew Svetlov added the comment: My initial thought was that os.sendfile() raises OSError on sending more than 0x7fff_f000 but I was wrong. I've checked it, everything works as Victor described. Thank you guys for the feedback. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:37:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 22:37:23 +0000 Subject: [issue35179] Limit max sendfile chunk to 0x7ffff000 In-Reply-To: <1541522491.35.0.788709270274.issue35179@psf.upfronthosting.co.za> Message-ID: <1541543843.05.0.788709270274.issue35179@psf.upfronthosting.co.za> STINNER Victor added the comment: > I've checked it, everything works as Victor described. Yeah! That's great when it just works! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:39:39 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 06 Nov 2018 22:39:39 +0000 Subject: [issue34655] Support sendfile in asyncio streams API Message-ID: <1541543979.78.0.788709270274.issue34655@psf.upfronthosting.co.za> Change by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:40:15 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Tue, 06 Nov 2018 22:40:15 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541544015.7.0.788709270274.issue34805@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: Haven't created a PR yet. Go ahead and great one if you have time Luna! We'd need a decision about this too, but if the decision is no, then it would nevertheless be a good idea to mention in the docs that the order is not guaranteed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 17:59:53 2018 From: report at bugs.python.org (lana.deere) Date: Tue, 06 Nov 2018 22:59:53 +0000 Subject: [issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build In-Reply-To: <1541448216.81.0.788709270274.issue35170@psf.upfronthosting.co.za> Message-ID: <1541545193.67.0.788709270274.issue35170@psf.upfronthosting.co.za> lana.deere added the comment: I did 'yum install libffi-devel' on my machine as suggested and that cured the ctypes issue. This issue can be closed; if I run into any other problems I can open other issues for them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 18:41:53 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 06 Nov 2018 23:41:53 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1541547713.95.0.788709270274.issue35181@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 18:44:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 23:44:06 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541547846.7.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9fc57a384825530635ef5ec093a31d864ea14f7c by Victor Stinner in branch 'master': bpo-35081: Add pycore_fileutils.h (GH-10371) https://github.com/python/cpython/commit/9fc57a384825530635ef5ec093a31d864ea14f7c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 18:55:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Nov 2018 23:55:13 +0000 Subject: [issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build In-Reply-To: <1541448216.81.0.788709270274.issue35170@psf.upfronthosting.co.za> Message-ID: <1541548513.3.0.788709270274.issue35170@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: -> resolved status: -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 19:33:30 2018 From: report at bugs.python.org (Gus Goulart) Date: Wed, 07 Nov 2018 00:33:30 +0000 Subject: [issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type In-Reply-To: <1527587007.35.0.682650639539.issue33678@psf.upfronthosting.co.za> Message-ID: <1541550810.81.0.788709270274.issue33678@psf.upfronthosting.co.za> Gus Goulart added the comment: This error seems to come from base_events.py, lines 142-145, and since it's an OS specific limitation, I can't see Sebastien's suggestion as a feasible solution. Maybe we could come up with something along the lines of the following patch. What do you think about it? diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 3726c556d4..15ee4d9d1b 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -142,6 +142,9 @@ def _ipaddr_info(host, port, family, type, proto): if '%' in host: # Linux's inet_pton doesn't accept an IPv6 zone index after host, # like '::1%lo0'. + if sys.platform.startswith('linux'): + return OSError("Linux's inet_pton doesn't accept an IPv6 " + "zone index after host") return None for af in afs: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 6d544d1eda..1b944ff89e 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -109,6 +109,9 @@ class BaseEventTests(test_utils.TestCase): self.assertIsNone( base_events._ipaddr_info('::3', 1, INET, STREAM, TCP)) + @unittest.skipIf(sys.platform.startswith('linux'), + "Linux's inet_pton doesn't accept an IPv6 zone index after host") + def test_for(self): # IPv6 address with zone index. self.assertIsNone( base_events._ipaddr_info('::3%lo0', 1, INET6, STREAM, TCP)) ---------- keywords: +patch nosy: +gus.goulart, taleinat Added file: https://bugs.python.org/file47913/issue33678.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 19:37:21 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 00:37:21 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541551041.67.0.788709270274.issue34805@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I would kindly suggest waiting until there is some consensus on this before doing any Pull Request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 20:33:13 2018 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Nov 2018 01:33:13 +0000 Subject: [issue33529] Infinite loop on folding email if headers has no spaces In-Reply-To: <1526429548.63.0.682650639539.issue33529@psf.upfronthosting.co.za> Message-ID: <1541554393.92.0.788709270274.issue33529@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- pull_requests: +9673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 21:46:10 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 02:46:10 +0000 Subject: [issue35180] Ctypes segfault or TypeError tested for python2.7 and 3 In-Reply-To: <1541522830.02.0.788709270274.issue35180@psf.upfronthosting.co.za> Message-ID: <1541558770.67.0.788709270274.issue35180@psf.upfronthosting.co.za> Josh Rosenberg added the comment: As soon as you use ctypes, you sign up for all the security vulnerabilities, including denial of service, buffer overrun, use-after-free, etc. that plain old C programs are subject to. In this case, it's just a NULL pointer dereference (read: segfault in most normal cases), but in general, if you don't use ctypes with the same discipline as you would actual C code (at best it provides a little in the way of automatic memory management), you're subject to all the same problems. Side-note: When replying to e-mails, don't include the quotes from the e-mail you're replying to; it just clutters the tracker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 22:29:24 2018 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Nov 2018 03:29:24 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541561364.94.0.788709270274.issue34805@psf.upfronthosting.co.za> Guido van Rossum added the comment: Since this is how it works since 3.6, I think it's reasonable to make this part of the spec. For dictionary order we waited a release between implementing it that way and making it part of the spec; effectively we've already waited two releases (3.6 and 3.7) for this. So I say let's do it. This isn't something that's PEP-worthy anyway. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 23:12:59 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 07 Nov 2018 04:12:59 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541563979.59.0.788709270274.issue33000@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +9674 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 23:55:11 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 07 Nov 2018 04:55:11 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541566511.08.0.788709270274.issue33000@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 76cd0c30d60961d1a10e2673834a455d2b51f695 by Terry Jan Reedy in branch 'master': bpo-33000: Document that IDLE's shell has no line limit. (#10373) https://github.com/python/cpython/commit/76cd0c30d60961d1a10e2673834a455d2b51f695 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 23:55:38 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 04:55:38 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541566538.95.0.788709270274.issue33000@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 6 23:55:51 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 04:55:51 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541566551.2.0.788709270274.issue33000@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 00:06:58 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 05:06:58 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541567218.08.0.788709270274.issue33000@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2b2a8c130ceb47842cfbd0c725b5b6599b26cf27 by Miss Islington (bot) in branch '3.7': bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) https://github.com/python/cpython/commit/2b2a8c130ceb47842cfbd0c725b5b6599b26cf27 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 00:18:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 05:18:40 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541567920.58.0.788709270274.issue33000@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 25bd1073996f26ad4895d3eb2d09315361c3cc84 by Miss Islington (bot) in branch '3.6': bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) https://github.com/python/cpython/commit/25bd1073996f26ad4895d3eb2d09315361c3cc84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 01:05:44 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 07 Nov 2018 06:05:44 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1541570744.85.0.788709270274.issue33000@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 01:22:23 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 06:22:23 +0000 Subject: [issue22355] inconsistent results with inspect.getsource / .getsourcelines In-Reply-To: <1410101141.24.0.25482778458.issue22355@psf.upfronthosting.co.za> Message-ID: <1541571743.86.0.788709270274.issue22355@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think this issue is covered with issue35101. It has an open PR as per the proposed fix with tests : https://github.com/python/cpython/pull/10209/files ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 01:27:32 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 06:27:32 +0000 Subject: [issue17972] inspect module docs omits many functions In-Reply-To: <1368501068.91.0.677640111487.issue17972@psf.upfronthosting.co.za> Message-ID: <1541572052.16.0.788709270274.issue17972@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 04:07:00 2018 From: report at bugs.python.org (David Peall) Date: Wed, 07 Nov 2018 09:07:00 +0000 Subject: [issue31242] Add SSLContext.set_verify_callback() In-Reply-To: <1503265756.53.0.967490588927.issue31242@psf.upfronthosting.co.za> Message-ID: <1541581620.48.0.788709270274.issue31242@psf.upfronthosting.co.za> Change by David Peall : ---------- nosy: +David Peall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 04:45:13 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Cardona?=) Date: Wed, 07 Nov 2018 09:45:13 +0000 Subject: [issue34971] add support for tls/ssl sessions in asyncio In-Reply-To: <1539420460.92.0.788709270274.issue34971@psf.upfronthosting.co.za> Message-ID: <1541583913.84.0.788709270274.issue34971@psf.upfronthosting.co.za> R?mi Cardona added the comment: Hi Christian, Could you tell me more about this new openssl API? Right now my patch works with whatever the ssl module provides. Are you suggesting the ssl module is in some way incomplete? Would supporting TLS 1.3 sessions be incompatible with the current session API? I'd like to help wherever possible, but I'm probably missing some context and/or knowledge around all things TLS in cpython. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 04:50:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 09:50:37 +0000 Subject: [issue34898] add mtime argument to gzip.compress In-Reply-To: <1538688124.68.0.545547206417.issue34898@psf.upfronthosting.co.za> Message-ID: <1541584237.46.0.788709270274.issue34898@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 0e7497cb469b003a45a4abe4105b81ef6d0c4002 by Serhiy Storchaka (guoci) in branch 'master': bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704) https://github.com/python/cpython/commit/0e7497cb469b003a45a4abe4105b81ef6d0c4002 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 04:51:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 09:51:40 +0000 Subject: [issue34898] add mtime argument to gzip.compress In-Reply-To: <1538688124.68.0.545547206417.issue34898@psf.upfronthosting.co.za> Message-ID: <1541584300.87.0.788709270274.issue34898@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 05:08:23 2018 From: report at bugs.python.org (Christian Heimes) Date: Wed, 07 Nov 2018 10:08:23 +0000 Subject: [issue34971] add support for tls/ssl sessions in asyncio In-Reply-To: <1539420460.92.0.788709270274.issue34971@psf.upfronthosting.co.za> Message-ID: <1541585303.46.0.788709270274.issue34971@psf.upfronthosting.co.za> Christian Heimes added the comment: The session code of the ssl is not compatible with TLS 1.3. Actually the whole API doesn't work with TLS 1.3. In TLS 1.2 and before, sessions had multiple security implications. For example they break PFS. TLS 1.3 changed when sessions are exchanged and how session are resumed. Session data is no longer part of the handshake. Instead the server can send session tickets at any point after the handshake. A server can send multiple tickets (usually two) and tickets must only be reused once. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 05:09:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 10:09:37 +0000 Subject: [issue31553] Extend json.tool to handle jsonlines (with a flag) In-Reply-To: <1506098466.58.0.224432895447.issue31553@psf.upfronthosting.co.za> Message-ID: <1541585377.18.0.788709270274.issue31553@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f19447994983902aa88362d8fffe645f1ea2f2aa by Serhiy Storchaka (HongWeipeng) in branch 'master': bpo-31553: add --json-lines option to json.tool (#10051) https://github.com/python/cpython/commit/f19447994983902aa88362d8fffe645f1ea2f2aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 05:23:30 2018 From: report at bugs.python.org (Andriy Maletsky) Date: Wed, 07 Nov 2018 10:23:30 +0000 Subject: [issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits Message-ID: <1541586210.62.0.788709270274.issue35182@psf.upfronthosting.co.za> New submission from Andriy Maletsky : When communicate() is called in a loop, it crashes when the child process has already closed any piped standard stream, but still continues to be running. How this happens: 1) the parent waits for the child events inside communicate() call 2) the child closes its side of any attached pipes long before exiting (in my case there is some complex c++ application which had messed with its termination) 3) communicate() receives an epoll event, tries to read/write, receives SIGPIPE (for stdin) or EOF (for stdout), decides to close corresponding file descriptors from its side 4) communicate() waits for the death of the child, but a timeout is fired 5) parent handles timeout exception and calls communicate() again 6) an exception is raised when communicate() tries to register closed file in epoll I think there may be a simple solution: before registering file descriptors in epoll, we may check whether any of them is already closed, and don't register it in that case. Here is a simple reproducible example, ran on Linux 4.15.0-1021-aws x86_64: import subprocess child = subprocess.Popen( ['/usr/local/bin/python3.7', '-c', 'import os, time; os.close(1), time.sleep(30)'], stdout=subprocess.PIPE, ) while True: try: child.communicate(timeout=3) break except subprocess.TimeoutExpired: # do something useful here pass Here is a stacktrace: Traceback (most recent call last): File "test.py", line 10, in child.communicate(timeout=3) File "/usr/local/lib/python3.7/subprocess.py", line 933, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/usr/local/lib/python3.7/subprocess.py", line 1666, in _communicate selector.register(self.stdout, selectors.EVENT_READ) File "/usr/local/lib/python3.7/selectors.py", line 352, in register key = super().register(fileobj, events, data) File "/usr/local/lib/python3.7/selectors.py", line 238, in register key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data) File "/usr/local/lib/python3.7/selectors.py", line 225, in _fileobj_lookup return _fileobj_to_fd(fileobj) File "/usr/local/lib/python3.7/selectors.py", line 40, in _fileobj_to_fd "{!r}".format(fileobj)) from None ValueError: Invalid file object: <_io.BufferedReader name=3> ---------- messages: 329412 nosy: and800 priority: normal severity: normal status: open title: Popen.communicate() breaks when child closes its side of pipe but not exits type: crash versions: 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 Wed Nov 7 05:25:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 10:25:30 +0000 Subject: [issue31553] Extend json.tool to handle jsonlines (with a flag) In-Reply-To: <1506098466.58.0.224432895447.issue31553@psf.upfronthosting.co.za> Message-ID: <1541586330.31.0.788709270274.issue31553@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 05:35:45 2018 From: report at bugs.python.org (Andriy Maletsky) Date: Wed, 07 Nov 2018 10:35:45 +0000 Subject: [issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits In-Reply-To: <1541586210.62.0.788709270274.issue35182@psf.upfronthosting.co.za> Message-ID: <1541586945.54.0.788709270274.issue35182@psf.upfronthosting.co.za> Change by Andriy Maletsky : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 06:48:33 2018 From: report at bugs.python.org (Robert Wright) Date: Wed, 07 Nov 2018 11:48:33 +0000 Subject: [issue35123] Add style guide for sentinel usage In-Reply-To: <1540984925.04.0.788709270274.issue35123@psf.upfronthosting.co.za> Message-ID: <1541591313.96.0.788709270274.issue35123@psf.upfronthosting.co.za> Robert Wright added the comment: Perhaps there's confusion over what I mean by "style guide". I'd happily take Steven's message *as* the style guide. Or, at the very least, the clarification that sentinels are to be thought of as constants. It's one of those things that's obvious once mentioned, but might not be thought of when you're using them. Though Eric does raise an interesting point about C sentinels. Something like: kwargs = {} if mode is not _MISSING: kwargs.update(mode=mode) return open(name, "foo", **kwargs) would work a bit better with multiple arguments, but it's still not great. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 06:49:13 2018 From: report at bugs.python.org (Shaun Griffith) Date: Wed, 07 Nov 2018 11:49:13 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example Message-ID: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> New submission from Shaun Griffith : As with many entries on the os.path doc page, splitext needs a typical example. Not grokking the bare minimum text, I had to actually try it in the interpreter to see what it did. The one example that *is* there is an edge case, and does nothing to explain the normal behavior, or why this is the correct behavior for the edge case. Here is where I tripped up: Split the pathname path into a pair (root, ext) such that root + ext == path, and ext is empty or begins with a period and contains at most one period. One interpretation of this is that ext is either empty, or has a period, _and nothing else_. Here are 2 examples for typical use: >>> splitext('readme.txt') ('readme', '.txt') >>> splitext('/some/long/pathname/warble.csv') ('/some/long/pathname/warble', '.csv') ---------- assignee: docs at python components: Documentation messages: 329414 nosy: docs at python, shaungriffith priority: normal severity: normal status: open title: os.path.splitext documentation needs typical example type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 06:59:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 11:59:34 +0000 Subject: [issue35123] Add style guide for sentinel usage In-Reply-To: <1540984925.04.0.788709270274.issue35123@psf.upfronthosting.co.za> Message-ID: <1541591974.29.0.788709270274.issue35123@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree that there are not any problems that need solving. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 07:13:58 2018 From: report at bugs.python.org (Andriy Maletsky) Date: Wed, 07 Nov 2018 12:13:58 +0000 Subject: [issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits In-Reply-To: <1541586210.62.0.788709270274.issue35182@psf.upfronthosting.co.za> Message-ID: <1541592838.75.0.788709270274.issue35182@psf.upfronthosting.co.za> Change by Andriy Maletsky : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 07:57:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 12:57:40 +0000 Subject: [issue10536] Enhancements to gettext docs In-Reply-To: <1290730924.88.0.289473332428.issue10536@psf.upfronthosting.co.za> Message-ID: <1541595460.68.0.788709270274.issue10536@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- stage: resolved -> status: closed -> open versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:09:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 14:09:16 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541599756.85.0.788709270274.issue34160@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5598cc90c745dab827e55fadded42dbe85e31d33 by Serhiy Storchaka (Diego Rojas) in branch 'master': bpo-34160: Preserve order of attributes in minidom. (GH-10219) https://github.com/python/cpython/commit/5598cc90c745dab827e55fadded42dbe85e31d33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:12:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 14:12:24 +0000 Subject: [issue2504] Add gettext.pgettext() and variants support In-Reply-To: <1206756624.13.0.664664048525.issue2504@psf.upfronthosting.co.za> Message-ID: <1541599944.22.0.788709270274.issue2504@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 637a33b99685fd5d1032670fbe29c7c8a8f0ff63 by Serhiy Storchaka (Cheryl Sabella) in branch 'master': bpo-2504: Add pgettext() and variants to gettext. (GH-7253) https://github.com/python/cpython/commit/637a33b99685fd5d1032670fbe29c7c8a8f0ff63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:32:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 14:32:50 +0000 Subject: [issue2504] Add gettext.pgettext() and variants support In-Reply-To: <1206756624.13.0.664664048525.issue2504@psf.upfronthosting.co.za> Message-ID: <1541601170.88.0.788709270274.issue2504@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:43:39 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 07 Nov 2018 14:43:39 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1541601819.72.0.788709270274.issue35181@psf.upfronthosting.co.za> Change by G?ry : ---------- keywords: +patch pull_requests: +9677 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:47:06 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 07 Nov 2018 14:47:06 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1541602026.37.0.788709270274.issue35181@psf.upfronthosting.co.za> Change by G?ry : ---------- pull_requests: +9678 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 09:55:15 2018 From: report at bugs.python.org (Stephan Bergmann) Date: Wed, 07 Nov 2018 14:55:15 +0000 Subject: [issue34982] re.sub() different behavior in 3.7 In-Reply-To: <1539523972.89.0.788709270274.issue34982@psf.upfronthosting.co.za> Message-ID: <1541602515.74.0.788709270274.issue34982@psf.upfronthosting.co.za> Stephan Bergmann added the comment: So, just to make sure, that also means that re.sub('a*$', 'b', 'a') returning 'bb' instead of 'b' is intended behavior? ---------- nosy: +Stephan Bergmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 10:13:59 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 07 Nov 2018 15:13:59 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1541603639.79.0.788709270274.issue35181@psf.upfronthosting.co.za> G?ry added the comment: It looks like Barry Warsaw has not been fully updated the documentation after making the __spec__.loader attribute match with the __loader__ attribute, and the __spec__.file attribute match with the __file__ attribute for namespace packages. Here is a pull request to update the library documentation of importlib (your first link [1]) with the current Barry's implementation: https://github.com/python/cpython/pull/10016 Here is another pull request to update the reference documentation of the import system (your second link [2], but for a different paragraph, as I think the "To indicate to the import machinery that the spec represents a namespace portion the path entry finder sets ?loader? on the spec to None" sentence is correct, since the `_bootstrap.ModuleSpec.loader` attribute of a namespace package remains `None` until the call to the `importlib._bootstrap._init_module_attrs` function): https://github.com/python/cpython/pull/10376 ---------- nosy: +brett.cannon, eric.snow, maggyero, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 10:22:57 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 15:22:57 +0000 Subject: [issue34982] re.sub() different behavior in 3.7 In-Reply-To: <1539523972.89.0.788709270274.issue34982@psf.upfronthosting.co.za> Message-ID: <1541604177.32.0.788709270274.issue34982@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, it is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 10:55:51 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 07 Nov 2018 15:55:51 +0000 Subject: [issue28015] configure --with-lto builds fail when CC=clang on Linux, requires gold linker In-Reply-To: <1473320709.67.0.0429640617864.issue28015@psf.upfronthosting.co.za> Message-ID: <1541606151.58.0.788709270274.issue28015@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: The workaround indeed works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:24:07 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Cardona?=) Date: Wed, 07 Nov 2018 16:24:07 +0000 Subject: [issue34971] add support for tls/ssl sessions in asyncio In-Reply-To: <1539420460.92.0.788709270274.issue34971@psf.upfronthosting.co.za> Message-ID: <1541607847.1.0.788709270274.issue34971@psf.upfronthosting.co.za> R?mi Cardona added the comment: So, IOW, the ssl module needs a good shakeup wrt TLS 1.3 sessions before any asyncio work can be merged. Am I getting this right? In which case, a whole other issue/PR is needed and possibly better folks than me. I try to stay clear of low-level crypto APIs because I don't trust myself to get things right. Well? I certainly can look at it, but I fear I may be punching above my weight with this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:40:57 2018 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 16:40:57 +0000 Subject: [issue35168] shlex punctuation_chars inconsistency In-Reply-To: <1541439134.06.0.788709270274.issue35168@psf.upfronthosting.co.za> Message-ID: <1541608857.73.0.788709270274.issue35168@psf.upfronthosting.co.za> Vinay Sajip added the comment: > a better run time error message which clarifies that shlex.punctuation_chars is read-only That it can be set only via the __init__(), yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:47:20 2018 From: report at bugs.python.org (=?utf-8?q?Marta_G=C3=B3mez?=) Date: Wed, 07 Nov 2018 16:47:20 +0000 Subject: [issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1 Message-ID: <1541609240.08.0.788709270274.issue35184@psf.upfronthosting.co.za> New submission from Marta G?mez : Hello, I was getting this same error (https://bugs.python.org/issue35139) when compiling pyextat so I added these changes (https://github.com/python/cpython/pull/10291/files) to my Setup.dist. After running ./configure, the generated Makefile throws the following error: $ make Makefile:264: *** missing separator. Stop. I have tried this in both Python 3.7 and 3.6 and I get the error in both (the line numbers are different but the error is the same). I have tested this in both Ubuntu 16/18 and CentOS 7. Any hints in how could I fix this? Best regards, Marta ---------- components: Build messages: 329424 nosy: mgmacias95 priority: normal severity: normal status: open title: Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1 type: compile error versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:49:25 2018 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 16:49:25 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541609365.63.0.788709270274.issue32409@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 by Vinay Sajip (samstagern) in branch 'master': bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) https://github.com/python/cpython/commit/c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:50:26 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 16:50:26 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541609426.81.0.788709270274.issue32409@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9679 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:50:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Nov 2018 16:50:52 +0000 Subject: [issue11492] email.header.Header doesn't fold headers correctly In-Reply-To: <1300087978.39.0.703069545984.issue11492@psf.upfronthosting.co.za> Message-ID: <1541609452.94.0.788709270274.issue11492@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9680 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 11:56:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Nov 2018 16:56:13 +0000 Subject: [issue11492] email.header.Header doesn't fold headers correctly In-Reply-To: <1300087978.39.0.703069545984.issue11492@psf.upfronthosting.co.za> Message-ID: <1541609773.84.0.788709270274.issue11492@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote PR 10378 to show that I don't think that this bug must be fixed in Python 2: it would break any application relying on the current folding algorithm. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:15:59 2018 From: report at bugs.python.org (Martin Bijl-Schwab) Date: Wed, 07 Nov 2018 17:15:59 +0000 Subject: [issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x In-Reply-To: <1527679178.26.0.682650639539.issue33694@psf.upfronthosting.co.za> Message-ID: <1541610959.97.0.788709270274.issue33694@psf.upfronthosting.co.za> Change by Martin Bijl-Schwab : ---------- pull_requests: +9681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:21:29 2018 From: report at bugs.python.org (Ben Spiller) Date: Wed, 07 Nov 2018 17:21:29 +0000 Subject: [issue5166] ElementTree and minidom don't prevent creation of not well-formed XML In-Reply-To: <1233918825.25.0.360851750395.issue5166@psf.upfronthosting.co.za> Message-ID: <1541611289.74.0.788709270274.issue5166@psf.upfronthosting.co.za> Change by Ben Spiller : ---------- nosy: +Ben Spiller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:27:01 2018 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Nov 2018 17:27:01 +0000 Subject: [issue35180] Ctypes segfault or TypeError tested for python2.7 and 3 In-Reply-To: <1541522830.02.0.788709270274.issue35180@psf.upfronthosting.co.za> Message-ID: <1541611621.88.0.788709270274.issue35180@psf.upfronthosting.co.za> Eryk Sun added the comment: Assign an errcheck function to check the return value and raise an OSError exception on failure. Load the C library with use_errno=True to get the value of C errno. Make sure to properly handle encoding Unicode strings for the file-system encoding, including conversion of __fspath__ paths (e.g. 3.x pathlib). Finally, don't load libraries and define prototypes in API functions. It's redundant and inefficient. You're just needlessly increasing the loaders reference count on the shared library and needlessly redefining prototypes that never change. Load it once at module or class level. For example: import os import sys import ctypes import ctypes.util import contextlib libc = ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True) class DIR(ctypes.Structure): """Opaque type for directory entries""" PDIR = ctypes.POINTER(DIR) class c_fschar_p(ctypes.c_char_p): if sys.version_info[0] >= 3: @classmethod def from_param(cls, param): if isinstance(param, (str, bytes, os.PathLike)): param = os.fsencode(param) return super().from_param(param) else: @classmethod def from_param(cls, param): if isinstance(param, unicode): param = param.encode(sys.getfilesystemencoding()) return super(c_fschar_p, cls).from_param(param) def check_bool(result, func, args): if not result: err = ctypes.get_errno() raise OSError(err, os.strerror(err)) return args def check_int(result, func, args): if result == -1: err = ctypes.get_errno() raise OSError(err, os.strerror(err)) return args libc.opendir.errcheck = check_bool libc.opendir.argtypes = (c_fschar_p,) libc.opendir.restype = PDIR libc.dirfd.errcheck = check_int libc.dirfd.argtypes = (PDIR,) libc.closedir.errcheck = check_int libc.closedir.argtypes = (PDIR,) @contextlib.contextmanager def get_directory_file_descriptor(directory): dir_p = libc.opendir(directory) try: if __debug__: print("dir_p = %s:%r" % (directory, dir_p)) dir_fd = libc.dirfd(dir_p) if __debug__: print("dir_fd = %r" % dir_fd) yield dir_fd finally: libc.closedir(dir_p) if __debug__: print("closed %r" % dir_p) ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:31:26 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 17:31:26 +0000 Subject: [issue34011] Default preference not given to venv DLL's In-Reply-To: <1530353263.14.0.56676864532.issue34011@psf.upfronthosting.co.za> Message-ID: <1541611886.9.0.788709270274.issue34011@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: This buildbot is failing when raising when creating subprocess.CalledProcessError: https://buildbot.python.org/all/#/builders/40/builds/1135/steps/3/logs/stdio test_defaults (test.test_venv.BasicTest) ... ok test_executable (test.test_venv.BasicTest) ... ok test_executable_symlinks (test.test_venv.BasicTest) ... skipped 'Needs symlinks' test_isolation (test.test_venv.BasicTest) ... ok test_overwrite_existing (test.test_venv.BasicTest) ... ok test_prefixes (test.test_venv.BasicTest) ... ok test_prompt (test.test_venv.BasicTest) ... ok test_symlinking (test.test_venv.BasicTest) ... skipped 'Needs symlinks' test_unicode_in_batch_file (test.test_venv.BasicTest) ... ERROR test_unoverwritable_fails (test.test_venv.BasicTest) ... ok test_upgrade (test.test_venv.BasicTest) ... ok test_devnull (test.test_venv.EnsurePipTest) ... ok test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok test_with_pip (test.test_venv.EnsurePipTest) ... ok ====================================================================== ERROR: test_unicode_in_batch_file (test.test_venv.BasicTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_venv.py", line 302, in test_unicode_in_batch_file out, err = check_output( File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_venv.py", line 37, in check_output raise subprocess.CalledProcessError( TypeError: __init__() takes from 3 to 5 positional arguments but 6 were given ---------------------------------------------------------------------- I will prepare a PR fixing this ---------- nosy: +pablogsal status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:43:57 2018 From: report at bugs.python.org (Ben Spiller) Date: Wed, 07 Nov 2018 17:43:57 +0000 Subject: [issue35185] Logger race condition - loses lines if removeHandler called from another thread while logging Message-ID: <1541612637.38.0.788709270274.issue35185@psf.upfronthosting.co.za> New submission from Ben Spiller : I just came across a fairly serious thread-safety / race condition bug in the logging.Loggers class, which causes random log lines to be lost i.e. not get passed to some of the registered handlers, if (other, unrelated) handlers are being added/removed using add/removeHandler from another thread during logging. This potentially affects all log handler classes, though for timing reasons I've found it easiest to reproduce with the logging.FileHandler. See attached test program that reproduces this. I did some debugging and looks like although add/removeHandler are protected by _acquireLock(), they modify the self.handlers list in-place, and the callHandlers method iterates over self.handlers with no locking - so if you're unlucky you can end up with some of your handlers not being called. A trivial way to fix the bug is by editing callHandlers and copying the list before iterating over it: - for hdlr in c.handlers: + for hdlr in list(c.handlers): However since that could affect the performance of routine log statements a better fix is probably to change the implementation of add/removeHandler to avoid in-place modification of self.handlers so that (as a result of the GIL) it'll be safe to iterate over the list in callHandlers, e.g. change removeHandler like this: - self.handlers.remove(hdlr) + newhandlers = list(self.handlers) + newhandlers.remove(hdlr) + self.handlers = hdlr (and the equivalent in addHandler) ---------- components: Library (Lib) files: logger-race.py messages: 329429 nosy: benspiller priority: normal severity: normal status: open title: Logger race condition - loses lines if removeHandler called from another thread while logging type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47914/logger-race.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 12:44:59 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 07 Nov 2018 17:44:59 +0000 Subject: [issue35185] Logger race condition - loses lines if removeHandler called from another thread while logging In-Reply-To: <1541612637.38.0.788709270274.issue35185@psf.upfronthosting.co.za> Message-ID: <1541612699.0.0.788709270274.issue35185@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 13:35:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 18:35:02 +0000 Subject: [issue34726] Add support of checked hash-based pycs in zipimport In-Reply-To: <1537300190.96.0.956365154283.issue34726@psf.upfronthosting.co.za> Message-ID: <1541615702.23.0.788709270274.issue34726@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 by Serhiy Storchaka (Elvis Pranskevichus) in branch 'master': bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327) https://github.com/python/cpython/commit/a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 13:35:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 18:35:30 +0000 Subject: [issue34726] Add support of checked hash-based pycs in zipimport In-Reply-To: <1537300190.96.0.956365154283.issue34726@psf.upfronthosting.co.za> Message-ID: <1541615730.18.0.788709270274.issue34726@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:26:17 2018 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 19:26:17 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541618777.9.0.788709270274.issue32409@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset 881e273c795f2f5154b8afebfa299f0e830f3712 by Vinay Sajip (Miss Islington (bot)) in branch '3.7': bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) (GH-10377) https://github.com/python/cpython/commit/881e273c795f2f5154b8afebfa299f0e830f3712 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:28:45 2018 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 19:28:45 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1541618925.22.0.788709270274.issue35148@psf.upfronthosting.co.za> Vinay Sajip added the comment: Fixed, see bpo-32409 for commit information. ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:32:31 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 19:32:31 +0000 Subject: [issue32513] dataclasses: make it easier to use user-supplied special methods In-Reply-To: <1515344765.63.0.467229070634.issue32513@psf.upfronthosting.co.za> Message-ID: <1541619151.61.0.788709270274.issue32513@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- pull_requests: +9682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:32:53 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 19:32:53 +0000 Subject: [issue32153] mock.create_autospec fails if an attribute is a partial function In-Reply-To: <1511864595.09.0.213398074469.issue32153@psf.upfronthosting.co.za> Message-ID: <1541619173.33.0.788709270274.issue32153@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +9683 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:33:29 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 19:33:29 +0000 Subject: [issue32513] dataclasses: make it easier to use user-supplied special methods In-Reply-To: <1515344765.63.0.467229070634.issue32513@psf.upfronthosting.co.za> Message-ID: <1541619209.87.0.788709270274.issue32513@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- pull_requests: -9682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:36:17 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Nov 2018 19:36:17 +0000 Subject: [issue32153] mock.create_autospec fails if an attribute is a partial function In-Reply-To: <1511864595.09.0.213398074469.issue32153@psf.upfronthosting.co.za> Message-ID: <1541619377.39.0.788709270274.issue32153@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: @berker.peksag I have created a unit test PR and verified that the test fails in 3.6 and passes on master. # 3.6 branch cpython git:(25bd107399) ./python.exe Python 3.6.7+ (remotes/upstream/3.6:25bd107399, Nov 8 2018, 00:50:43) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D cpython git:(25bd107399) ./python.exe -m unittest -v unittest.test.testmock.testhelpers.SpecSignatureTest.test_autospec_getattr_partial_function test_autospec_getattr_partial_function (unittest.test.testmock.testhelpers.SpecSignatureTest) ... ERROR ====================================================================== ERROR: test_autospec_getattr_partial_function (unittest.test.testmock.testhelpers.SpecSignatureTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/test/testmock/testhelpers.py", line 884, in test_autospec_getattr_partial_function autospec = create_autospec(proxy) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 2182, in create_autospec _check_signature(spec, mock, is_type, instance) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 102, in _check_signature _copy_func_details(func, checksig) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 107, in _copy_func_details funcopy.__name__ = func.__name__ AttributeError: 'functools.partial' object has no attribute '__name__' ---------------------------------------------------------------------- Ran 1 test in 0.007s FAILED (errors=1) # Master cpython git:(bpo32153) ./python.exe Python 3.8.0a0 (heads/bpo32153:3e9cd8d982, Nov 8 2018, 00:53:46) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D cpython git:(bpo32153) ./python.exe -m unittest -v unittest.test.testmock.testhelpers.SpecSignatureTest.test_autospec_getattr_partial_function test_autospec_getattr_partial_function (unittest.test.testmock.testhelpers.SpecSignatureTest) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.005s OK ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 14:58:34 2018 From: report at bugs.python.org (Ben Hyde) Date: Wed, 07 Nov 2018 19:58:34 +0000 Subject: [issue32281] bdist_rpm v.s. the Macintosh In-Reply-To: <1513034809.77.0.213398074469.issue32281@psf.upfronthosting.co.za> Message-ID: <1541620714.29.0.788709270274.issue32281@psf.upfronthosting.co.za> Ben Hyde added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 15:04:49 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 20:04:49 +0000 Subject: [issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits In-Reply-To: <1541586210.62.0.788709270274.issue35182@psf.upfronthosting.co.za> Message-ID: <1541621089.36.0.788709270274.issue35182@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Sounds like the solution you'd want here is to just change each if check in _communicate, so instead of: if self.stdout: selector.register(self.stdout, selectors.EVENT_READ) if self.stderr: selector.register(self.stderr, selectors.EVENT_READ) it does: if self.stdout and not self.stdout.closed: selector.register(self.stdout, selectors.EVENT_READ) if self.stderr and not self.stderr.closed: selector.register(self.stderr, selectors.EVENT_READ) The `if self.stdin and input:` would also have to change. Right now it's buggy in a related, but far more complex way. Specifically if you call it with input the first time: 1. If some of the input is sent but not all, and the second time you call communicate you rely on the (undocumented, but necessary for consistency) input caching and don't pass input at all, it won't register the stdin handle for read (and in fact, will explicitly close the stdin handle), and the remaining cached data won't be sent. If you try to pass some other non-empty input, it just ignores it and sends whatever remains in the cache (and fails out as in the stdout/stderr case if the data in the cache was sent completely before the timeout). 2. If all of the input was sent on the first call, you *must* pass input=None, or you'll die trying to register self.stdin with the selector The fix for this would be to either: 1. Follow the pattern for self.stdout/stderr (adding "and not self.stdin.closed"), and explicitly document that repeated calls to communicate must pass the exact same input each time (and optionally validate this in the _save_input function, which as of right now just ignores the input if a cache already exists); if input is passed the first time, incompletely transmitted, and not passed the second time, the code will error as in the OP's case, but it will have violated the documented requirements (ideally the error would be a little more clear though) or 2. Change the code so populating the cache (if not already populated) is the first step, and replace all subsequent references to input with references to self._input (for setup tests, also checking if self._input_offset >= len(self._input), so it doesn't register for notifications on self.stdin if all the input has been sent), so it becomes legal to pass input=None on a second call and rely on the first call to communicate caching it. It would still ignore new input values on the subsequent calls, but at least it would behave in a sane way (not closing sys.stdin despite having unsent cached data, then producing a confusing error that is several steps removed from the actual problem) Either way, the caching behavior for input should be properly documented; we clearly specify that output is preserved after a timeout and retrying communicate ("If the process does not terminate after timeout seconds, a TimeoutExpired exception will be raised. Catching this exception and retrying communication will not lose any output."), but we don't say anything about input, and right now, the behavior is the somewhat odd and hard to express: "Retrying a call to communicate when the original call was passed non-None/non-empty input requires subsequent call(s) to pass non-None, non-empty input. The input on said subsequent calls is otherwise ignored; only the unsent remainder of the original input is sent. Also, it will just fail completely if you pass non-empty input and it turns out the original input was sent completely on the previous call, in which case you *must* call it with input=None." It might also be worth changing the selectors module to raise a more obvious exception when register is passed a closed file-like object, but given it only requires non-integer fileobjs to have a .fileno() method, adding a requirement for a "closed" attribute/property could break other code. ---------- nosy: +josh.r stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 15:20:51 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 20:20:51 +0000 Subject: [issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits In-Reply-To: <1541586210.62.0.788709270274.issue35182@psf.upfronthosting.co.za> Message-ID: <1541622051.04.0.788709270274.issue35182@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Hmm... Correction to my previous post. communicate itself has a test for: "if self._communication_started and input:" that raises an error if it passes, so the second call to communicate can only be passed None/empty input. And _communicate only explicitly closes self.stdin when input is falsy and _communication_started is False, so the required behavior right now is: 1. First call *may* pass input 2. Second call must not pass (non-empty) input under any circumstance So I think we're actually okay on the code for stdin, but it would be a good idea to document that input *must* be None on all but the first call, and that the input passed to the first call is cached such that as long as at least one call to communicate completes without a TimeoutError (and the stdin isn't explicitly closed), it will all be sent. Sorry for the noise; I should have rechecked communicate itself, not just _communicate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:05:15 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 21:05:15 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541624715.36.0.788709270274.issue34805@psf.upfronthosting.co.za> Josh Rosenberg added the comment: First off, the OP's original case seems like a use case for functools.singledispatch. Not really related to the problem, just thought I'd mention it. Secondly, are we sure we want to make such a guarantee? That restricts the underlying storage to ordered types (list/dict; possibly tuple at the cost of making modifications slightly more expensive), or an unordered type with additional ordering layered on it (like old-school OrderedDict). That does tie our hands in the future. For example, it seems like it would be a perfectly reasonable approach for the internal collection of subclasses to be implemented as a weakref.WeakSet (some future version of it implemented in C, rather than the current Python layer version) so as to reduce code duplication and improve handling when a subclass disappears. Right now, tp_subclasses is a dict keyed by the raw memory address of the subclass (understandable, but eww), with a value of a weakref to the subclass itself. There is tons of custom code involved in handling this (e.g. the dict only self-cleans because the dealloc for classes explicitly removes the subclass from the parent classes, but every use of the dict still has to assume weakrefs have gone dead anyway, because of reentrancy issues; these are solved problems in WeakSet which hides all the complexity from the user). Being able to use WeakSets would mean a huge amount of special purpose code in typeobject.c could go away, but guaranteeing ordering would make that more difficult (it would require providing an ordering guarantee for WeakSet, which, being built on set, would likely require ordering guarantees for sets in general, or changing WeakSet to be built on dicts). There is also (at least) one edge case that would need to be fixed (based on a brief skim of the code). type_set_bases (which handles assignment to __bases__ AFAICT, admittedly a niche use case) simplified its own implementation by making the process of changing __bases__ be to remove itself as a subclass of all of its original bases, then add itself as a subclass of the new bases. This is done even if there are overlaps in the bases, and even if the new bases are the same. Minimal repro: >>> class A: pass >>> class B(A): pass >>> class C(A): pass >>> A.__subclasses__() # Appear in definition order [__main__.B, __main__.C] >>> B.__bases__ = B.__bases__ # Should be no-op... >>> A.__subclasses__() # But oops, order changed [__main__.C, __main__.B] I'm not going to claim this is common or useful (I've done something like this exactly once, interactively, while making an OrderedCounter from OrderedDict and Counter back before dicts were ordered; I got the inheritance order wrong and reversed it after the fact), but making the guarantee would be more than just stating it; we'd either have to complicate the code to back it up, or qualify the guarantee with some weird, possibly CPython-specific details. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:25:23 2018 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Nov 2018 21:25:23 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541625923.92.0.788709270274.issue34805@psf.upfronthosting.co.za> Guido van Rossum added the comment: Thanks for the long post! Clearly there is more here than the eye can easily see. Nevertheless, I feel that, *in this case*, it's not likely that such a re-implementation will ever happen, so I think it is okay to constrain the future so we can guarantee (the ordering aspect of) the current behavior. The current behavior also *feels* natural, regardless of the validity of the OP's use case. The edge case of assignment to __bases__ is a good one to call out (in the docs and in the test) but I don't think the current behavior there is sufficiently dicey to change it or to exclude it from the guarantee. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:27:47 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 21:27:47 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541626067.26.0.788709270274.issue34805@psf.upfronthosting.co.za> Josh Rosenberg added the comment: I'm also a little skeptical of the OP's proposed use case for other reasons. In any circumstance other than "all classes are defined in the same module", you can't really make useful guarantees about subclass definition order, because: 1. If the converters are defined in multiple modules in a single package, the module with IntConverter could be imported first explicitly, and now BoolConverter will come second. 2. If all the provided converters occur in a single monolithic module, and some other package tries to make a converter for their own int subclass, well, IntConverter is already first in the list of subclasses, so the other package's converter will never be called (unless it's for the direct subclass of int, rather than a grandchild of int, but that's an implementation detail of the OP's project). Essentially, to write such a class hierarchy properly, you'd need to rejigger the ordering each time a class was registered such that any converter for a parent class was pushed until after the converter for all of its descendant classes (and if there is multiple inheritance involved, you're doomed). Even ignoring all that, their use case doesn't require explicit registration if they don't want it to. By making a simple metaclass for the root class, the metaclass's __new__ can perform registration on the descendant class's behalf, either with the definition time ordering of the current design, or with a more complicated rejiggering I described that would be necessary to ensure parent classes are considered after child classes (assuming no multiple inheritance). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:39:10 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 21:39:10 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541626750.09.0.788709270274.issue32409@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: This commit broke a lot of the Windows buildbots: https://buildbot.python.org/all/#/builders/32/builds/1707 https://buildbot.python.org/all/#/builders/113/builds/733 https://buildbot.python.org/all/#/builders/40/builds/1137 https://buildbot.python.org/all/#/builders/130/builds/420 https://buildbot.python.org/all/#/builders/3/builds/1634 Can someone work on a patch soon? If not we need to revert the commits in all the branches that are failed to build :( ---------- nosy: +pablogsal status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:41:38 2018 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Nov 2018 21:41:38 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1541626067.26.0.788709270274.issue34805@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Josh, I have to ask -- do you have plans to rewrite the __subclasses__ implementation? Because at this point I don't really feel like arguing over the OP's use case. It looks like you have a strong objection over the requested feature that's quite independent from the validity of any use cases, and I'm curious why. The argument "but then we couldn't change the implementation in some future version" feels pretty weak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:42:46 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 07 Nov 2018 21:42:46 +0000 Subject: [issue35015] availability directive breaks po files In-Reply-To: <1539852628.85.0.788709270274.issue35015@psf.upfronthosting.co.za> Message-ID: <1541626966.6.0.788709270274.issue35015@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset beed84ca5e0f2784d758478d4e7c81c9c1088c4e by Julien Palard in branch 'master': bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) https://github.com/python/cpython/commit/beed84ca5e0f2784d758478d4e7c81c9c1088c4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:42:55 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 21:42:55 +0000 Subject: [issue35015] availability directive breaks po files In-Reply-To: <1539852628.85.0.788709270274.issue35015@psf.upfronthosting.co.za> Message-ID: <1541626975.74.0.788709270274.issue35015@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9684 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:48:41 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 07 Nov 2018 21:48:41 +0000 Subject: [issue35015] availability directive breaks po files In-Reply-To: <1539852628.85.0.788709270274.issue35015@psf.upfronthosting.co.za> Message-ID: <1541627321.16.0.788709270274.issue35015@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:48:50 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 21:48:50 +0000 Subject: [issue35015] availability directive breaks po files In-Reply-To: <1539852628.85.0.788709270274.issue35015@psf.upfronthosting.co.za> Message-ID: <1541627330.67.0.788709270274.issue35015@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 363839caf9dac796783c74b682a70680a15fa8a7 by Miss Islington (bot) in branch '3.7': bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) https://github.com/python/cpython/commit/363839caf9dac796783c74b682a70680a15fa8a7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 16:56:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Nov 2018 21:56:13 +0000 Subject: [issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x In-Reply-To: <1527679178.26.0.682650639539.issue33694@psf.upfronthosting.co.za> Message-ID: <1541627773.77.0.788709270274.issue33694@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: -9681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:04:10 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 22:04:10 +0000 Subject: [issue34011] Default preference not given to venv DLL's In-Reply-To: <1530353263.14.0.56676864532.issue34011@psf.upfronthosting.co.za> Message-ID: <1541628250.83.0.788709270274.issue34011@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9685 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:05:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Nov 2018 22:05:16 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1541628316.54.0.788709270274.issue31354@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f6b9459996f5166300982d0427119eb326e74dac by Victor Stinner (stratakis) in branch '3.6': [3.6] bpo-31354: Let configure --with-lto work on all builds (GH-10261) https://github.com/python/cpython/commit/f6b9459996f5166300982d0427119eb326e74dac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:07:27 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 22:07:27 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541628447.14.0.788709270274.issue34805@psf.upfronthosting.co.za> Josh Rosenberg added the comment: I wrote the response to the OP's use case before I saw your response; it wasn't really intended as an additional critique of the proposed change or a counterargument to your post, just a note that the required behavior could be obtained on all versions of Python via metaclasses, including on 3.5. I have no specific plans to rewrite the typeobject.c, nor make a C implemented WeakSet. I'm just leery of adding language guarantees that limit future development when they: 1. Provide very little benefit (I doubt one package in 10,000 even uses __subclasses__, let alone relies on its ordering) 2. The benefit is achievable without herculean efforts with existing tools (metaclasses can provide the desired behavior with minimal effort at the trivial cost of an additional side-band dict on the root class) If the guarantee never limits a proposed change, then our best case scenario is we provided a guarantee that benefits almost no one (guaranteed upside minimal). But if it limits a proposed change, we might lose out on a significant improvement in performance, code maintainability, what have you (much larger potential downside). I'm just not seeing enough of a benefit to justify the potential cost. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:11:53 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 07 Nov 2018 22:11:53 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1541628713.36.0.788709270274.issue34805@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Keep in mind, had this guarantee been in place in 3.4, the improvement in 3.5 couldn't have been made, and issue17936 might have been closed and never addressed, even once dicts were ordered, simply because we never rechecked it. It makes the whole "potential downside" more obvious, because we would have paid that price not so long ago. Knowing that 3.5 improved by breaking this guarantee was part of what made me cautious here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:18:18 2018 From: report at bugs.python.org (Martin Bijl-Schwab) Date: Wed, 07 Nov 2018 22:18:18 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541629098.53.0.788709270274.issue32409@psf.upfronthosting.co.za> Martin Bijl-Schwab added the comment: I will have a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:22:22 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 22:22:22 +0000 Subject: [issue34011] Default preference not given to venv DLL's In-Reply-To: <1530353263.14.0.56676864532.issue34011@psf.upfronthosting.co.za> Message-ID: <1541629342.76.0.788709270274.issue34011@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9686 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:22:49 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 22:22:49 +0000 Subject: [issue34011] Default preference not given to venv DLL's In-Reply-To: <1530353263.14.0.56676864532.issue34011@psf.upfronthosting.co.za> Message-ID: <1541629369.2.0.788709270274.issue34011@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:41:53 2018 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Nov 2018 22:41:53 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1541628713.36.0.788709270274.issue34805@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: OK, I don't have time to keep arguing, and I doubt any other core devs care. We should probably just close it as Won't Fix, since it's not important enough to keep deliberating. Luna, I recommend that you pick another project. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 17:59:27 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 22:59:27 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541631567.31.0.788709270274.issue32409@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9688 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 18:18:52 2018 From: report at bugs.python.org (Runping Wang) Date: Wed, 07 Nov 2018 23:18:52 +0000 Subject: [issue31670] Associate .wasm with application/wasm In-Reply-To: <1507011746.68.0.213398074469.issue31670@psf.upfronthosting.co.za> Message-ID: <1541632732.25.0.788709270274.issue31670@psf.upfronthosting.co.za> Runping Wang added the comment: We're also depending on this MIME type for WebAssembly. It will be great if we can get this wasm MIME type in. ---------- nosy: +runpiw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 18:55:43 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Nov 2018 23:55:43 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541634943.28.0.788709270274.issue32409@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: New changeset 6843ffe4533e9f2cde036296fd932fef6f059687 by Pablo Galindo in branch 'master': Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) https://github.com/python/cpython/commit/6843ffe4533e9f2cde036296fd932fef6f059687 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 18:55:54 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Nov 2018 23:55:54 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541634954.65.0.788709270274.issue32409@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 19:14:05 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Nov 2018 00:14:05 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541636045.47.0.788709270274.issue32409@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3ba5e253de1a52e9692aa645c95072705f08b7bb by Miss Islington (bot) in branch '3.7': Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) https://github.com/python/cpython/commit/3ba5e253de1a52e9692aa645c95072705f08b7bb ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 19:38:49 2018 From: report at bugs.python.org (Gus Goulart) Date: Thu, 08 Nov 2018 00:38:49 +0000 Subject: [issue32485] Multiprocessing dict sharing between forked processes In-Reply-To: <1514972661.4.0.467229070634.issue32485@psf.upfronthosting.co.za> Message-ID: <1541637529.49.0.788709270274.issue32485@psf.upfronthosting.co.za> Gus Goulart added the comment: This is probably a bug that was fixed sometime in Python 3x. Testing on 3.7.1, Python gracefully errors out: ``` ? cpython git:(bpo-32485) ? python issue_32485.py Same manager, same mux Starting test_sameProcessSameThread Traceback (most recent call last): File "issue_32485.py", line 130, in test_sameProcessSameThread(inst1, inst2, nRuns) File "issue_32485.py", line 48, in test_sameProcessSameThread run(inst1, nRuns) File "issue_32485.py", line 30, in run inst.run() File "issue_32485.py", line 19, in run if (self.d.has_key(self.key)): File "", line 2, in has_key File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 811, in _callmethod raise convert_to_error(kind, result) multiprocessing.managers.RemoteError: --------------------------------------------------------------------------- Traceback (most recent call last): File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 251, in serve_client function = getattr(obj, methodname) AttributeError: 'dict' object has no attribute 'has_key' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 271, in serve_client fallback_func = self.fallback_mapping[methodname] KeyError: 'has_key' --------------------------------------------------------------------------- ``` ---------- nosy: +gus.goulart, taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 20:56:13 2018 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 08 Nov 2018 01:56:13 +0000 Subject: [issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm Message-ID: <1541642171.78.0.788709270274.issue35186@psf.upfronthosting.co.za> New submission from Paul Ganssle : It seems that in issue #1322, `platform.dist` was deprecated, and is slated for removal in Python 3.8, but it is currently used in distutils.command.upload.upload_file: https://github.com/python/cpython/blob/6843ffe4533e9f2cde036296fd932fef6f059687/Lib/distutils/command/upload.py#L126 As far as I can tell, this line is hit only when you run `python setup.py bdist_rpm upload`, as far as I can tell. Using the `upload` command is *itself* very deprecated, and is dangerously broken in many ways. See, for example, this setuptools issue: https://github.com/pypa/setuptools/issues/1381 So I see three possible options (two realistic): 1. Remove the whole "comment" field from the upload, both for bdist_rpm and bdist_dumb. I'm not sure if PyPI uses this for anything, but I highly doubt it. 2. Have both bdist_rpm and bdist_dumb send a comment based on `platform.platform(terse=1)` 3. Remove the upload command functionality entirely for Python 3.8 with no deprecation warning. Obviously #3 is the unrealistic one, but it's very tempting. That said, I think we should go with #1 and maybe open a separate issue to actually deprecate the `upload` command in distutils (though to be honest we'll probably monkey-patch it out of existence in setuptools within a year and everyone uses `setuptools` anyway, so maybe #3 is less unrealistic than it seems). ---------- components: Distutils messages: 329453 nosy: dstufft, eric.araujo, p-ganssle priority: normal severity: normal status: open title: distutils.command.upload uses deprecated platform.dist with bdist_rpm versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 7 22:42:51 2018 From: report at bugs.python.org (Franklin Yu) Date: Thu, 08 Nov 2018 03:42:51 +0000 Subject: [issue27602] Enable py launcher to launch repository Python. In-Reply-To: <1469306499.45.0.411476180863.issue27602@psf.upfronthosting.co.za> Message-ID: <1541648571.46.0.788709270274.issue27602@psf.upfronthosting.co.za> Franklin Yu added the comment: Any updates? I would like to switch between versions of PyPy. ---------- nosy: +Franklin Yu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:46:49 2018 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 08 Nov 2018 06:46:49 +0000 Subject: [issue25451] tkinter: PhotoImage transparency methods In-Reply-To: <1445417795.5.0.279905447074.issue25451@psf.upfronthosting.co.za> Message-ID: <1541659609.86.0.788709270274.issue25451@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +9690 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:47:50 2018 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 08 Nov 2018 06:47:50 +0000 Subject: [issue25451] tkinter: PhotoImage transparency methods In-Reply-To: <1445417795.5.0.279905447074.issue25451@psf.upfronthosting.co.za> Message-ID: <1541659670.6.0.788709270274.issue25451@psf.upfronthosting.co.za> Zackery Spytz added the comment: I've created a PR for this issue. ---------- nosy: +ZackerySpytz versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:48:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 06:48:15 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541659695.06.0.788709270274.issue34966@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a44d34e17908a49d584f86c4f8642a50707b7150 by Serhiy Storchaka in branch 'master': bpo-34966: Improve support of method aliases in pydoc. (GH-9823) https://github.com/python/cpython/commit/a44d34e17908a49d584f86c4f8642a50707b7150 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:48:27 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Nov 2018 06:48:27 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541659707.81.0.788709270274.issue34966@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:48:33 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Nov 2018 06:48:33 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541659713.97.0.788709270274.issue34966@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9692 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 01:54:29 2018 From: report at bugs.python.org (Holger Waldmann) Date: Thu, 08 Nov 2018 06:54:29 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1541660069.93.0.788709270274.issue24905@psf.upfronthosting.co.za> Holger Waldmann added the comment: I am looking forward for this to be included. My main use case is on restricted IoT devices, where I need to handle BLOBs of 2MB size. As this is larger than my available RAM, I store need to store them in the filesystem today. This is ugly because it is not part of the atomic commit of the database. I would very much appreciate if I could get a file-like API for BLOBs in sqlite. ---------- nosy: +waldhol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 02:07:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 07:07:24 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1541660844.74.0.788709270274.issue24905@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 02:08:09 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Nov 2018 07:08:09 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541660889.73.0.788709270274.issue34966@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9d3658147b56e24e96e174510b6ee91c8141e530 by Miss Islington (bot) in branch '3.7': bpo-34966: Improve support of method aliases in pydoc. (GH-9823) https://github.com/python/cpython/commit/9d3658147b56e24e96e174510b6ee91c8141e530 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 02:20:31 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Nov 2018 07:20:31 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541661631.42.0.788709270274.issue34966@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 11a33e171b89ea9267672b0664d739ca06e459ca by Miss Islington (bot) in branch '3.6': bpo-34966: Improve support of method aliases in pydoc. (GH-9823) https://github.com/python/cpython/commit/11a33e171b89ea9267672b0664d739ca06e459ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 02:24:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 07:24:13 +0000 Subject: [issue34966] Pydoc: better support of method aliases In-Reply-To: <1539359411.67.0.788709270274.issue34966@psf.upfronthosting.co.za> Message-ID: <1541661853.7.0.788709270274.issue34966@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 02:57:46 2018 From: report at bugs.python.org (xiyunlong) Date: Thu, 08 Nov 2018 07:57:46 +0000 Subject: [issue35187] a bug about np.arrange Message-ID: <1541663866.8.0.788709270274.issue35187@psf.upfronthosting.co.za> New submission from xiyunlong : when I use np.arange as follows: np.arange(1,2.2,0.2) I got the array as [1. , 1.2, 1.4, 1.6, 1.8, 2. , 2.2],we know, the maxvalue 2.2 of the array should not be included in the array. Is this a bug? ---------- components: Library (Lib) messages: 329460 nosy: xyl123 priority: normal severity: normal status: open title: a bug about np.arrange versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 03:04:52 2018 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 08 Nov 2018 08:04:52 +0000 Subject: [issue35187] a bug about np.arrange In-Reply-To: <1541663866.8.0.788709270274.issue35187@psf.upfronthosting.co.za> Message-ID: <1541664292.78.0.788709270274.issue35187@psf.upfronthosting.co.za> Mark Dickinson added the comment: np.arange is part of NumPy, not core Python; I'd suggest asking this question on the NumPy mailing lists, e.g. https://mail.python.org/pipermail/numpy-discussion/ But no, it's not a bug; it's a well-known gotcha. ---------- nosy: +mark.dickinson resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 03:06:47 2018 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 08 Nov 2018 08:06:47 +0000 Subject: [issue35187] a bug about np.arrange In-Reply-To: <1541663866.8.0.788709270274.issue35187@psf.upfronthosting.co.za> Message-ID: <1541664407.56.0.788709270274.issue35187@psf.upfronthosting.co.za> Mark Dickinson added the comment: It's also worth taking a look at the documentation: https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.arange.html See particularly the "Result" section, where it says: > Because of floating point overflow, this rule may result in the last > element of out being greater than stop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 03:23:11 2018 From: report at bugs.python.org (Kal Sze) Date: Thu, 08 Nov 2018 08:23:11 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1541665391.09.0.788709270274.issue34155@psf.upfronthosting.co.za> Kal Sze added the comment: Another failure case: >>> from email.utils import parseaddr >>> parseaddr('fo at o@bar.com') ('', 'fo at o') If I understand the RFC correctly, the correct results should be ('', '') because there are two '@' signs. The first '@' would need to be quoted for the address to be valid. ---------- nosy: +Kal Sze2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 03:48:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 08:48:59 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541666939.01.0.788709270274.issue32409@psf.upfronthosting.co.za> STINNER Victor added the comment: Pablo Galindo reverted the change because it broke Windows buildbots, and we have a policy to revert a change breaking buildbots if the regression cannot be fixed "quickly" event: https://pythondev.readthedocs.io/ci.html#revert-on-fail Is someone working on investigating the bug? Do you need help to reproduce the bug? Copy of the test_venv error: ====================================================================== ERROR: test_unicode_in_batch_file (test.test_venv.BasicTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_venv.py", line 302, in test_unicode_in_batch_file out, err = check_output( File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_venv.py", line 37, in check_output raise subprocess.CalledProcessError( TypeError: __init__() takes from 3 to 5 positional arguments but 6 were given https://buildbot.python.org/all/#/builders/32/builds/1707 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 04:51:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 09:51:49 +0000 Subject: [issue34987] A possible null pointer dereference in _pickle.c's save_reduce() In-Reply-To: <1539585850.77.0.788709270274.issue34987@psf.upfronthosting.co.za> Message-ID: <1541670709.35.0.788709270274.issue34987@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I was wrong. get_class() returns NULL when and only when an exception is set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:05:53 2018 From: report at bugs.python.org (xiyunlong) Date: Thu, 08 Nov 2018 12:05:53 +0000 Subject: [issue35188] something confused about numpy.arange Message-ID: <1541678753.34.0.788709270274.issue35188@psf.upfronthosting.co.za> New submission from xiyunlong : when I use:print(np.arange(1,2.2,0.2)) I got: 1.0 1.2 1.4 1.5999999999999999 1.7999999999999998 1.9999999999999998 2.1999999999999997 could any one tell me why it's not 1.0,1.2,1.4,1.6,1.8,2.0? Many thanks! ---------- components: Library (Lib) messages: 329466 nosy: xyl123 priority: normal severity: normal status: open title: something confused about numpy.arange versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:14:53 2018 From: report at bugs.python.org (xiyunlong) Date: Thu, 08 Nov 2018 12:14:53 +0000 Subject: [issue35188] something confused about numpy.arange In-Reply-To: <1541678753.34.0.788709270274.issue35188@psf.upfronthosting.co.za> Message-ID: <1541679293.22.0.788709270274.issue35188@psf.upfronthosting.co.za> Change by xiyunlong : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:21:51 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 08 Nov 2018 12:21:51 +0000 Subject: [issue35065] Reading received data from a closed TCP stream using `StreamReader.read` might hang forever In-Reply-To: <1540470746.12.0.788709270274.issue35065@psf.upfronthosting.co.za> Message-ID: <1541679711.77.0.788709270274.issue35065@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset fd512d76456b65c529a5bc58d8cfe73e4a10de7a by Andrew Svetlov (Vincent Michel) in branch 'master': bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212) https://github.com/python/cpython/commit/fd512d76456b65c529a5bc58d8cfe73e4a10de7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:22:13 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 08 Nov 2018 12:22:13 +0000 Subject: [issue35065] Reading received data from a closed TCP stream using `StreamReader.read` might hang forever In-Reply-To: <1540470746.12.0.788709270274.issue35065@psf.upfronthosting.co.za> Message-ID: <1541679733.66.0.788709270274.issue35065@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:24:26 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 08 Nov 2018 12:24:26 +0000 Subject: [issue34885] asyncio documention has lost its paragraph about cancellation In-Reply-To: <1538568479.97.0.545547206417.issue34885@psf.upfronthosting.co.za> Message-ID: <1541679866.63.0.788709270274.issue34885@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I think the issue can be closed ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:45:30 2018 From: report at bugs.python.org (Aapo Samuli Keskimolo) Date: Thu, 08 Nov 2018 12:45:30 +0000 Subject: [issue35189] EINTR is not being retried Message-ID: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> New submission from Aapo Samuli Keskimolo : According to https://www.python.org/dev/peps/pep-0475/ the EINTR interruption should be retried automatically, but somehow it does not work and the exception is raised: 2018-11-05 05:21:35,257 ERROR:storage(23491): Remote storage operation failed (request: '{ 'excludeSubModules': None, 'storageLocation': 'qt/qtdatavis3d/68faa5b00f73096eb096c6acdfce76b052ca20b9/LinuxUbuntu_18_04x86_64LinuxQEMUarm64GCCqtci-linux-Ubuntu-18.04-x86_64-a6 c9f7Release/ac4280d182ec320eaf0e68efaeeeb6be14b9689f/test_1542834179', 'type': 3}') Traceback (most recent call last): File "src/storage.py", line 507, in handle self.handle_upload_artifact(message) File "src/storage.py", line 437, in handle_upload_artifact log.info("upload of %s to %s", uploadType, message.storageLocation) File "/usr/lib/python3.6/logging/__init__.py", line 1306, in info self._log(INFO, msg, args, **kwargs) File "/usr/lib/python3.6/logging/__init__.py", line 1442, in _log self.handle(record) File "/usr/lib/python3.6/logging/__init__.py", line 1452, in handle self.callHandlers(record) File "/usr/lib/python3.6/logging/__init__.py", line 1514, in callHandlers hdlr.handle(record) File "/usr/lib/python3.6/logging/__init__.py", line 861, in handle self.acquire() File "/home/vmbuilder/qt-ci/src/application.py", line 151, in acquire fcntl.lockf(self._lock_fd, fcntl.LOCK_EX) InterruptedError: [Errno 4] Interrupted system call ---------- components: Library (Lib) messages: 329469 nosy: akeskimo priority: normal severity: normal status: open title: EINTR is not being retried type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:48:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 12:48:01 +0000 Subject: [issue35189] EINTR is not being retried In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541681281.03.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: You're right, it should, but the fcntl module hasn't been patched. Are you interested to work or on patch, or do you want to me to find someone to do it? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:51:33 2018 From: report at bugs.python.org (Aapo Samuli Keskimolo) Date: Thu, 08 Nov 2018 12:51:33 +0000 Subject: [issue35189] EINTR is not being retried In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541681493.64.0.788709270274.issue35189@psf.upfronthosting.co.za> Aapo Samuli Keskimolo added the comment: My colleague has made a prospective fix: https://github.com/nierob/cpython/commit/3b76b887b2b339664dc52c5f246bc7cb268ea616 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 07:53:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 12:53:42 +0000 Subject: [issue35189] EINTR is not being retried In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541681622.96.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: > https://github.com/nierob/cpython/commit/3b76b887b2b339664dc52c5f246bc7cb268ea616 Oh, nice! Please rebase this change on the master branch and reuse "int async_err = 0;" pattern from Modules/posixmodule.c. You must not raise a new exception if PyErr_CheckSignals() raised an exception, something like: return (!async_err) ? posix_error() : NULL; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:06:36 2018 From: report at bugs.python.org (Nierob) Date: Thu, 08 Nov 2018 14:06:36 +0000 Subject: [issue35189] EINTR is not being retried In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541685996.16.0.788709270274.issue35189@psf.upfronthosting.co.za> Nierob added the comment: PR waits for CLA ---------- keywords: +patch nosy: +nierob pull_requests: +9693 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:18:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 14:18:53 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1541686733.92.0.788709270274.issue6721@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset 3b699932e5ac3e76031bbb6d700fbea07492641d by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': > bpo-6721: Hold logging locks across fork() (GH-4071) (#9291) It seems like this change caused a regression in the Anaconda installer of Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1644936 But we are not sure at this point. I have to investigate to understand exactly what is happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:38:09 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 14:38:09 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541687889.66.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: EINTR is not being retried -> PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:38:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 14:38:16 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1541687896.92.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:41:26 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 08 Nov 2018 14:41:26 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface Message-ID: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> New submission from Miro Hron?ok : The collections.abc ? Abstract Base Classes for Containers documentation says: > This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping. https://docs.python.org/3/library/collections.abc.html However this is not true for Sequence. When I implement a class that provides a particular interface (defined in the Collections Abstract Base Classes table in that very page), I cannot check whether it implements a Sequence. See an example: from collections import abc class Box: def __init__(self, wrapped): self._w = wrapped def __len__(self): return len(self._w) def __iter__(self): yield from self._w def __getitem__(self, i): return self._w[i] def __reversed__(self): yield from reversed(self._w) def __contains__(self, i): return i in self._w def index(self, value, start=0, stop=None): return self._w.index(value, start, stop) def count(self, value): return self._w.count(value) b = Box([1, 2, 3]) for t in 'Sized', 'Iterable', 'Reversible', 'Container', 'Collection', 'Sequence': print(f'{t}: {isinstance(b, getattr(abc, t))}') My class is Reversible. My class is a Collection (as it is a Sized Iterable Container). It implements __getitem__, __len__, __contains__, __iter__, __reversed__, index, and count. Yet my class instance is not an instance of Sequence. I suppose this behavior might be intentional, as discussed in issue16728 - or it might as well not be. The main concern was that dict also provides these methods, but is not considered a Sequence, however dict does not provide index() or count(). Regardless whether this is right or wrong behavior, as documented this should be a Sequence. See also https://stackoverflow.com/questions/34927949/issubclass-of-abstract-base-class-sequence As I see it, either: collections.abc.Sequence needs a __subclasshook__ so it can be used as the documentation implies. Or: the documentation should not say that "abstract base classes (from abc module) can be used to test whether a class provides a particular interface" if it doesn't generally apply Or: the Sequence documentation should say: "this particular abstract base class cannot be used to test whether a class provides a particular interface because reasons" (yet I don't really get those reasons) ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 329475 nosy: docs at python, hroncok, vstinner priority: normal severity: normal status: open title: collections.abc.Sequence cannot be used to test whether a class provides a particular interface versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 09:43:00 2018 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 08 Nov 2018 14:43:00 +0000 Subject: [issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm In-Reply-To: <1541642171.78.0.788709270274.issue35186@psf.upfronthosting.co.za> Message-ID: <1541688180.72.0.788709270274.issue35186@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- keywords: +patch pull_requests: +9694 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:18:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 15:18:35 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541690315.68.0.788709270274.issue35190@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +gvanrossum, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:22:55 2018 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 08 Nov 2018 15:22:55 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541690575.59.0.788709270274.issue35190@psf.upfronthosting.co.za> Guido van Rossum added the comment: Yeah, the docs need to be clarified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:23:00 2018 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 08 Nov 2018 15:23:00 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541690580.26.0.788709270274.issue35190@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:33:54 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 08 Nov 2018 15:33:54 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541691234.47.0.788709270274.issue35190@psf.upfronthosting.co.za> Miro Hron?ok added the comment: I fail to understand what abc classes can be used to test whether a class provides a particular interface, and what abc classes cannot be used that way. What is the difference between those abc classes and why are all those abc classes listed together when they behave differently? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:38:43 2018 From: report at bugs.python.org (Zachary Ware) Date: Thu, 08 Nov 2018 15:38:43 +0000 Subject: [issue35188] something confused about numpy.arange In-Reply-To: <1541678753.34.0.788709270274.issue35188@psf.upfronthosting.co.za> Message-ID: <1541691523.77.0.788709270274.issue35188@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- resolution: -> third party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:43:43 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 08 Nov 2018 15:43:43 +0000 Subject: [issue35191] socket.setblocking(x) treats multiples of 2**32 as False Message-ID: <1541691823.13.0.788709270274.issue35191@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : UBSAN with -fsanitize=implicit-integer-truncation reported a suspicious case: testSetBlocking_overflow (test.test_socket.NonBlockingTCPTests) ... /scratch2/izbyshev/cpython/Modules/socketmodule.c:2688:33: runtime error: implicit conversion from type 'long' of value 4294967296 (64-bit, signed) to type 'int' changed the value to 0 (32-bit, signed) It turned out that sock_setblocking() converts its (logically boolean) argument to long, but then passes it to internal_setblocking() which accepts int (https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/socketmodule.c#L2688). This results in unexpected truncation on platforms with 64-bit long. testSetBlocking_overflow() which is supposed to check this doesn't work because it only checks socket timeout which is updated correctly. However, the actual state of socket descriptor is changed to the opposite value (non-blocking) in this case. ---------- components: Extension Modules messages: 329478 nosy: izbyshev, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: socket.setblocking(x) treats multiples of 2**32 as False type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:46:37 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 08 Nov 2018 15:46:37 +0000 Subject: [issue35191] socket.setblocking(x) treats multiples of 2**32 as False In-Reply-To: <1541691823.13.0.788709270274.issue35191@psf.upfronthosting.co.za> Message-ID: <1541691997.67.0.788709270274.issue35191@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9695 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 10:47:52 2018 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 08 Nov 2018 15:47:52 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541692072.29.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- pull_requests: +9696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 11:28:40 2018 From: report at bugs.python.org (Tal Einat) Date: Thu, 08 Nov 2018 16:28:40 +0000 Subject: [issue32485] Multiprocessing dict sharing between forked processes In-Reply-To: <1514972661.4.0.467229070634.issue32485@psf.upfronthosting.co.za> Message-ID: <1541694520.54.0.788709270274.issue32485@psf.upfronthosting.co.za> Tal Einat added the comment: Is this supposed to work at all? Does multiprocessing support sharing resources between processes forked outside of its own abstractions? Reading the docs[1], calling os.fork() directly doesn't seem to be the way that the multiprocessing module is supposed to be used. [1] https://docs.python.org/library/multiprocessing.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 11:34:46 2018 From: report at bugs.python.org (Yongnan Wu) Date: Thu, 08 Nov 2018 16:34:46 +0000 Subject: [issue34766] BaseProxy cache should be cleaned when Manager client is reconnected In-Reply-To: <1537900896.87.0.545547206417.issue34766@psf.upfronthosting.co.za> Message-ID: <1541694886.84.0.788709270274.issue34766@psf.upfronthosting.co.za> Yongnan Wu added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 11:38:08 2018 From: report at bugs.python.org (Steve Dower) Date: Thu, 08 Nov 2018 16:38:08 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1541695088.43.0.788709270274.issue32409@psf.upfronthosting.co.za> Steve Dower added the comment: That error is a bug in the test, but it only shows up on an error path anyway. Without removing the extra None we don't get to see the actual error output. I can't look into this over the next week or two, but a quick glance at the original PR looks like a lot of quotes are missing around executable paths, so maybe it was that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 11:42:33 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 08 Nov 2018 16:42:33 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1541695353.97.0.788709270274.issue31625@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- pull_requests: +9697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 11:44:03 2018 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 08 Nov 2018 16:44:03 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541695443.65.0.788709270274.issue35190@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 12:11:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 17:11:42 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541697102.49.0.788709270274.issue35190@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 12:27:53 2018 From: report at bugs.python.org (Gertjan van den Burg) Date: Thu, 08 Nov 2018 17:27:53 +0000 Subject: [issue30825] csv.Sniffer does not detect lineterminator In-Reply-To: <1498944224.71.0.636990812421.issue30825@psf.upfronthosting.co.za> Message-ID: <1541698073.52.0.788709270274.issue30825@psf.upfronthosting.co.za> Gertjan van den Burg added the comment: Note that the current CSV parser in _csv.c doesn't require the line terminator, it eats up \r and \n where necessary. See: https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/_csv.c#L752 This is why the line terminator isn't detected and doesn't need to be detected. Also, files that use the \r line terminator exist and are parsed correctly at the moment. See for example: https://raw.githubusercontent.com/hadley/data-fuel-economy/master/1998-2008/2008.csv ---------- nosy: +Gertjan van den Burg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 12:27:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 17:27:56 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1541698076.45.0.788709270274.issue31625@psf.upfronthosting.co.za> STINNER Victor added the comment: (I reopen the issue.) > Would it make sense to backport that to 3.6 as well? Currently this blocks https://bugs.python.org/issue28015 from being backported to 3.6 There is a risk of regression. Does bpo-28015 fix really depend on this change? Benjamin wrote: "As far as I'm aware, every modern *nix's ar supports an "s" flag", but I'm not sure if Python 3.6 is only used on "modern Unix". Some people use AIX and HP-UX: does ar support "s" on these OSes? ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 15:08:28 2018 From: report at bugs.python.org (Adam Dunlap) Date: Thu, 08 Nov 2018 20:08:28 +0000 Subject: [issue35192] pathlib mkdir throws FileExistsError when not supposed to Message-ID: <1541707708.76.0.788709270274.issue35192@psf.upfronthosting.co.za> New submission from Adam Dunlap : I have 2 processes (one C, one python) that are started at the same time and both need a certain directory tree to exist to continue, so both processes create the directory tree while ignoring errors about it already existing. In the python process, I'm using pathlib's mkdir function (https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir) with parents=True, exist_ok=True, but this is sometimes throwing a FileExistsError. I don't expect this because the documentation says "If exist_ok is true, FileExistsError exceptions will be ignored (same behavior as the POSIX mkdir -p command), but only if the last path component is not an existing non-directory file." The last component is never a non-directory file. I believe what is happening is that mkdir realizes that the parent doesn't exist, so it recursively tries to make the parent directory. However, when it recurses, it uses the default exists_ok value of False. Before the recursive call can make the parent directory, the other process makes the directory. This causes the inner call to throw a FileExistsError. I believe the correct thing to do is to always pass True for exists_ok in the recursive call. ---------- components: Library (Lib) messages: 329484 nosy: Adam Dunlap priority: normal severity: normal status: open title: pathlib mkdir throws FileExistsError when not supposed to type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 16:08:35 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 08 Nov 2018 21:08:35 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE Message-ID: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> New submission from Gregory P. Smith : An off by one error was introduced to peephole.c by the "off by one error fix" in https://bugs.python.org/issue28517. Clang's memory sanitizer detects it (msan). find_op is ultimately called with h == codelen so it accesses one byte out of bounds. I have a fix, PR coming. ---------- assignee: gregory.p.smith components: Interpreter Core messages: 329485 nosy: gregory.p.smith, serhiy.storchaka priority: normal severity: normal status: open title: Off by one error in peephole call to find_op on case RETURN_VALUE type: crash versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 16:09:05 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 08 Nov 2018 21:09:05 +0000 Subject: [issue28517] Dead code in wordcode In-Reply-To: <1477286199.46.0.366284805485.issue28517@psf.upfronthosting.co.za> Message-ID: <1541711345.64.0.788709270274.issue28517@psf.upfronthosting.co.za> Gregory P. Smith added the comment: the off by one error fix here introduced a new off by one error. PR coming, follow https://bugs.python.org/issue35193 for that. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 16:16:12 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 08 Nov 2018 21:16:12 +0000 Subject: [issue30825] csv.Sniffer does not detect lineterminator In-Reply-To: <1541698073.52.0.788709270274.issue30825@psf.upfronthosting.co.za> Message-ID: Skip Montanaro added the comment: A couple comments. 1. Terry Reedy wrote: > The csv expert listed in https://devguide.python.org/experts/ is marked as inactive That would be me. I am indeed inactive w.r.t. fixing broken stuff, and don't want to feel obligated to jump in with both feet when a CSV ticket is raised. Still, I keep half an eye on things. If people are actually interested in my opinion on such stuff, drop me a line. 2. Regarding the csv.Sniffer class... I've personally never found it useful, and would be happy to see it deprecated. I occasionally define a delimiter other than comma, and never specify the quotechar. (I've never seen anything other than quotation marks used anyway.) As others have indicated, the line terminator is kind of unnecessary with Python 3 (unless you need something really weird). If you actually need to specify a delimiter, I think giving a set of candidate delimiters would be sufficient. The first one encountered wins. Maybe I'm just getting old and cranky, but deprecation is the fork in the road I'd take, given the choice. Second choice would be to simplify the delimiter sniffing logic and get rid of anything to do with line terminators. Skip ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 16:16:54 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 08 Nov 2018 21:16:54 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541711814.25.0.788709270274.issue35193@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +9698 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 16:45:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Nov 2018 21:45:08 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1541713508.95.0.788709270274.issue12568@psf.upfronthosting.co.za> STINNER Victor added the comment: I close the issue as WONTFIX. ---------- resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 17:41:33 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 08 Nov 2018 22:41:33 +0000 Subject: [issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled In-Reply-To: <1492073709.93.0.33740565749.issue30064@psf.upfronthosting.co.za> Message-ID: <1541716893.81.0.788709270274.issue30064@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +9699 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 17:55:24 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 08 Nov 2018 22:55:24 +0000 Subject: [issue35194] A typo in a constant in cp932 codec Message-ID: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : UBSan with -fsanitize=implicit-integer-truncation found a suspicious one: /scratch2/izbyshev/cpython/Modules/cjkcodecs/_codecs_jp.c:43:17: runtime error: implicit conversion from type 'unsigned int' of value 4294966013 (32-bit, unsigned) to type 'unsigned char' changed the value to 253 (8-bit, unsigned) Indeed, the wrong constant was used (the correct one is used in corresponding decoder code at https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/cjkcodecs/_codecs_jp.c#L105). In this case the truncation was harmless because only the lowest byte of the wrong result was used, and it was correct. But it probably makes sense to fix it if only to reduce noise from UBSan. All Python versions are affected, but I've marked 3.8 only since I'm not sure what the policy for backporting such changes is. ---------- components: Extension Modules messages: 329489 nosy: izbyshev, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: A typo in a constant in cp932 codec type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 17:56:21 2018 From: report at bugs.python.org (Dragoljub) Date: Thu, 08 Nov 2018 22:56:21 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 Message-ID: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> New submission from Dragoljub : xref: https://github.com/pandas-dev/pandas/issues/23516 Example: import io import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(1000000, 10), columns=('COL{}'.format(i) for i in range(10))) csv = io.StringIO(df.to_csv(index=False)) df2 = pd.read_csv(csv) #3.5X slower on Python 3.7.1 pd.read_csv() reads data at 30MB/sec on Python 3.7.1 while at 100MB/sec on Python 3.6.7. This issue seems to be only present on Windows 10 Builds both x86 & x64. Possibly some IO changes in Python 3.7 could have contributed to this slowdown on Windows but not on Linux? ---------- components: IO messages: 329490 nosy: Dragoljub priority: normal severity: normal status: open title: Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 17:57:37 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 08 Nov 2018 22:57:37 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541717857.18.0.788709270274.issue35194@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9700 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 20:12:39 2018 From: report at bugs.python.org (Gus Goulart) Date: Fri, 09 Nov 2018 01:12:39 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1541725959.9.0.788709270274.issue33196@psf.upfronthosting.co.za> Gus Goulart added the comment: I couldn't reproduce the error on Debian 9 nor OSX, although I tried tweaking the test script a little bit to force the error. Arcadiy, did you tried reproducing the same issue in a different platform? Did someone report something similar in recent issues on gevent? ---------- nosy: +gus.goulart, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 20:13:18 2018 From: report at bugs.python.org (Gus Goulart) Date: Fri, 09 Nov 2018 01:13:18 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1541725998.42.0.788709270274.issue33196@psf.upfronthosting.co.za> Change by Gus Goulart : ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 20:55:12 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 01:55:12 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541728512.43.0.788709270274.issue35193@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 49fa4a9f1ef387e16596f271414c855339eadf09 by Gregory P. Smith in branch 'master': bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) https://github.com/python/cpython/commit/49fa4a9f1ef387e16596f271414c855339eadf09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 20:55:26 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 01:55:26 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541728526.05.0.788709270274.issue35193@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 21:13:20 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 02:13:20 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541729600.9.0.788709270274.issue35193@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8 by Miss Islington (bot) in branch '3.7': bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) https://github.com/python/cpython/commit/f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 21:30:23 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Nov 2018 02:30:23 +0000 Subject: [issue32513] dataclasses: make it easier to use user-supplied special methods In-Reply-To: <1515344765.63.0.467229070634.issue32513@psf.upfronthosting.co.za> Message-ID: <1541730623.62.0.788709270274.issue32513@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- pull_requests: +9702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 21:34:38 2018 From: report at bugs.python.org (Lisa Roach) Date: Fri, 09 Nov 2018 02:34:38 +0000 Subject: [issue24412] setUpClass equivalent for addCleanup In-Reply-To: <1433788299.35.0.440062273493.issue24412@psf.upfronthosting.co.za> Message-ID: <1541730878.02.0.788709270274.issue24412@psf.upfronthosting.co.za> Lisa Roach added the comment: New changeset 0f221d09cad46bee38d1b7a7822772df66c53028 by Lisa Roach in branch 'master': bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) https://github.com/python/cpython/commit/0f221d09cad46bee38d1b7a7822772df66c53028 ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 22:34:36 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Nov 2018 03:34:36 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541734476.41.0.788709270274.issue35195@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 8 22:46:00 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Nov 2018 03:46:00 +0000 Subject: [issue35192] pathlib mkdir throws FileExistsError when not supposed to In-Reply-To: <1541707708.76.0.788709270274.issue35192@psf.upfronthosting.co.za> Message-ID: <1541735160.1.0.788709270274.issue35192@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. There was a related issue : issue29694 . This was fixed in 3.7 and was backported with https://github.com/python/cpython/commit/d7abeb7024b9755c291c29bdc8c4494246e975ad (3.5.4 and above) . Can you please specify the full version of Python 3.5 you are using and if the linked issue is related ? If possible please attach a reproducer so that this can be tested on other versions. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 00:00:15 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 09 Nov 2018 05:00:15 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1541739615.89.0.788709270274.issue35105@psf.upfronthosting.co.za> Windson Yang added the comment: I try to create a PR for it. Should we add 'CPython implementation detail' at the document? Because this happens at cpython as well as pypy. BTW, where should we add the document? I have two choices. * https://docs.python.org/3/reference/datamodel.html#object.__setattr__ * https://docs.python.org/3/library/functions.html#setattr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 01:42:13 2018 From: report at bugs.python.org (Valentin Zhao) Date: Fri, 09 Nov 2018 06:42:13 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541254353.59.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: Valentin Zhao added the comment: I am better just waiting you guys fixing that because it is not urgent. On Sat, Nov 3, 2018 at 10:12 PM Jason R. Coombs wrote: > > Jason R. Coombs added the comment: > > Also, I would argue that this is an enhancement request and not a bug - > that the prior expectation was that the .pth file is encoded in whatever > encoding the system expects by default, and that adding support for a > standardized encoding for .pth files is a new feature. > > As another aside: Valentin, the technique you're using to manage packages > is likely to run into issues with certain packages - in particular any > packages that rely on their own `.pth` files to invoke behavior, such as > future_fstrings (https://pypi.org/project/future-fstrings/). I learned > about this issue in (https://github.com/jaraco/rwt/issues/29), which is > why the rwt project adds a `sitecustomize.py` to the target directory that > ensures .pth files are run. Just FYI. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 01:58:59 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 09 Nov 2018 06:58:59 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1541746739.22.0.788709270274.issue35131@psf.upfronthosting.co.za> Windson Yang added the comment: I tried to create a PR for it, However, I don't know how to handle the code at https://github.com/python/cpython/blob/d4c76d960b/Lib/site.py#L159 So how to check UnicodeDecodeError when we just open the file, I use readlines() but it may use too many memory than before (I'm not sure it's important in this case). try: f = open(fullname, "r") data = f.readlines() except UnicodeDecodeError: f = open(fullname, "r", encoding="utf-8") data = f.readlines() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:05:58 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 07:05:58 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541747158.27.0.788709270274.issue35193@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9703 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:10:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 07:10:28 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541747428.04.0.788709270274.issue35193@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for catching and fixing this error Gregory! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:12:10 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 07:12:10 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541747530.49.0.788709270274.issue35194@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7a69cf47a9bbc95f95fd67c982bff121b2a903cb by Miss Islington (bot) (Alexey Izbyshev) in branch 'master': bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) https://github.com/python/cpython/commit/7a69cf47a9bbc95f95fd67c982bff121b2a903cb ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:12:34 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 07:12:34 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541747554.53.0.788709270274.issue35194@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:12:41 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 07:12:41 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541747561.8.0.788709270274.issue35194@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:23:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 07:23:19 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541748199.53.0.788709270274.issue35194@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Maybe add asserts in OUTBYTE1() and similar macros to prevent similar errors in future? ---------- versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:30:41 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 07:30:41 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541748641.05.0.788709270274.issue35193@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 65e1a1fd311943866361fcb288c0df65dadbe092 by Gregory P. Smith in branch '3.6': bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) (GH-10422) https://github.com/python/cpython/commit/65e1a1fd311943866361fcb288c0df65dadbe092 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:33:13 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 07:33:13 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541748793.51.0.788709270274.issue35194@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 49ee41f1c3934aa095e32fa751cdf3ba641ae34b by Miss Islington (bot) in branch '3.6': bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) https://github.com/python/cpython/commit/49ee41f1c3934aa095e32fa751cdf3ba641ae34b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 02:35:09 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Nov 2018 07:35:09 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541748909.16.0.788709270274.issue35194@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 22234f1375d28803074405497ea61315fb37240d by Miss Islington (bot) in branch '3.7': bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) https://github.com/python/cpython/commit/22234f1375d28803074405497ea61315fb37240d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 03:07:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 08:07:29 +0000 Subject: [issue34699] allow path-like objects in program arguments in Windows In-Reply-To: <1537039216.54.0.956365154283.issue34699@psf.upfronthosting.co.za> Message-ID: <1541750849.35.0.788709270274.issue34699@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 03:45:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 08:45:28 +0000 Subject: [issue33173] GzipFile's .seekable() returns True even if underlying buffer is not seekable In-Reply-To: <1522254528.0.0.467229070634.issue33173@psf.upfronthosting.co.za> Message-ID: <1541753128.77.0.788709270274.issue33173@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I share Martin's opinion that this is a misfeature. User code can check seekable() and use seek() if it returns True or cache necessary data in memory if it returns False, because it is expected that seek() is more efficient. But in case of GzipFile it is not efficient, and can lead to decompression the whole content of the file and to much worse performance. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 03:55:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 08:55:32 +0000 Subject: [issue33173] GzipFile's .seekable() returns True even if underlying buffer is not seekable In-Reply-To: <1522254528.0.0.467229070634.issue33173@psf.upfronthosting.co.za> Message-ID: <1541753732.16.0.788709270274.issue33173@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: And I share Martin's concern about fast-forward with an unseekable underlying file. If this works in current code, we can't simply return break it. This may mean that we can't change the implementation of GzipFile.seekable() at all, even if it lies in some cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 05:00:53 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 10:00:53 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow Message-ID: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> New submission from Raymond Hettinger : The squeezed text is impairing IDLE's usability for teaching purposes. Typing help() on any built-in type such as str immediately results in a squeeze-button rather than displaying help. The same is true for showing lines from a file read or from a URL. I recommend showing the first 50 to 100 lines and then squeezing the remainder. Also, I think this may be the logic that is slowing down successive print calls in a loop. Try running: for i in range(500): print(i, sep=' ') or even: for i in range(500): print(i, i**2) The output has noticeably slow delays between successive print() calls. ---------- assignee: terry.reedy components: IDLE messages: 329507 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: IDLE text squeezer is too aggressive and is slow type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 05:21:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 10:21:57 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541758917.22.0.788709270274.issue35194@psf.upfronthosting.co.za> STINNER Victor added the comment: > Maybe add asserts in OUTBYTE1() and similar macros to prevent similar errors in future? I like the idea. Make sure that: 0 <= ch <= 255? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 05:53:00 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Nov 2018 10:53:00 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541760780.19.0.788709270274.issue35196@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 07:03:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 12:03:41 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541765021.75.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 130893debfd97c70e3a89d9ba49892f53e6b9d79 by Victor Stinner in branch 'master': bpo-35081: Internal headers require Py_BUILD_CORE (GH-10363) https://github.com/python/cpython/commit/130893debfd97c70e3a89d9ba49892f53e6b9d79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 07:23:18 2018 From: report at bugs.python.org (=?utf-8?q?Vladimir_Filipovi=C4=87?=) Date: Fri, 09 Nov 2018 12:23:18 +0000 Subject: [issue35034] Add closing and iteration to threading.Queue In-Reply-To: <1540078155.51.0.788709270274.issue35034@psf.upfronthosting.co.za> Message-ID: <1541766198.82.0.788709270274.issue35034@psf.upfronthosting.co.za> Vladimir Filipovi? added the comment: Hi Raymond! Thanks for the attention you've given this and for the words of encouragement. I'll try to make something like this for PyPI. I do feel I should critique your metaphor of Queues as email. (Please don't take this as a request to re-evaluate anything about this proposal or re-hash the "farewell messages are an inferior solution" from python-ideas. It's really only about that "basis for mental model" in general, which I think is doing you a disservice.) Email is principally bidirectional; with Python's Queues, only one side has the freedom to send any kind of coordination instructions via the same transport that's used for workload messages. Email is principally one-to-one. The *-to-many Queue case is specifically the one where propagation of farewell messages to all recipients is error-prone, with recipients suddenly needing to worry about the existence of other recipients. (And if you feel that's not valid because you view multi-recipient as part of the core idea of email, consider that such email is basically "broadcast", with every message reaching every recipient - even further removed from the idea of Queues than single-recipient email is.) The email metaphor tends to imply FIFO consumption, while Queues support other orderings. These other orderings further complicate the code for dealing with farewell messages. With email, participants generally have handles on each other, and treat the transport as very abstract. With Queues it's exactly the opposite: they have a handle on the transport mechanism and abstract away the other participants; the transport explicitly takes over some burden of coordination and dispatch; and thanks to that it's very easy for participants to enter or leave an ongoing "conversation" without having to introduce themselves to the others. (I'm realizing now that email is a pretty good metaphor for Erlang's IPC model though.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 07:27:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 12:27:25 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541766445.71.0.788709270274.issue33878@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think that the fact that `(a) = 42` is accepted is rather an implementation detail, and the consequence of limitations of the grammar parser. It accepts arbitrary expression at the left hand side of assignment. After transforming CST to AST unsuitable targets are rejected, but information about grouping parenthesis is lost at this stage. This can be fixed if check the left hand side node before converting to AST. ---------- nosy: +gvanrossum, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:02:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 13:02:48 +0000 Subject: [issue20596] Support for alternate wcstok syntax for Windows compilers In-Reply-To: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> Message-ID: <1541768568.36.0.788709270274.issue20596@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: wcstok_s is an optional part of C11 and can be available in other compilers. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf#%5B%7B%22num%22%3A1401%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C0%2C792%2C0%5D ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:31:58 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 09 Nov 2018 13:31:58 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541770318.92.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: > The squeezed text is impairing IDLE's usability for teaching purposes. I sincerely hoped it would achieve the opposite! I'm happy to do any work necessary to improve its usability in this context. The auto-squeezing can be "disabled" easily by setting the minimum # lines to a high number in the config dialog. > Typing help() on any built-in type such as str immediately results in a squeeze-button rather than displaying help. The same is true for showing lines from a file read or from a URL. A quick double-click will expand the "Squeezed text" label. Also, right-click -> "View" will open the output in a viewer window; for long "help(str)" output I find this better than having it in the midst of the normal output. > Also, I think this may be the logic that is slowing down successive print calls in a loop. Can you give more details? In comparison to what do you find it slow? I did a quick comparison between a recent 3.8.0a build and 3.7.0 (without Squeezer) on a Win10 machine, and both seemed to take the same time to run those loops (~3.5 seconds for the first loop, ~4.5 seconds for the second loop). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:39:51 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 13:39:51 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541770791.72.0.788709270274.issue35194@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- pull_requests: +9706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:44:40 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 13:44:40 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541771080.97.0.788709270274.issue35194@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: I've added 'assert' to macros. Since 'typeof' seems to be disallowed in Python, I've used 'unsigned int' as the type of an intermediate variable. Another alternative is 'assert(0 <= (c) && (c) <= 255)', but 'c' will be evaluated several times. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:50:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 13:50:06 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541771406.13.0.788709270274.issue35194@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Converting to unsigned int can unnecessary widen the value or truncate higher bits. On other side, testing "0 <= (c)" can emit a compiler warning if c is unsigned. Maybe test "Py_CHARMASK(c) == (c)"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 08:58:03 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 13:58:03 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541771883.51.0.788709270274.issue35194@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: > Maybe test "Py_CHARMASK(c) == (c)"? This is a good alternative if multiple evaluation of 'c' is acceptable. Though I'd prefer '(unsigned char)c == c' for this style of fixing because it is bit closer to what happens in '((*outbuf)[i]) = c'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:06:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 14:06:44 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' Message-ID: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> New submission from STINNER Victor : graminit.h is an header file associating Grammar entities to their values, example: #define stmt 269 Problem: defines symbols have no prefix and cause compilation issues on regular C code depending where graminit.h is included. Example with ast.c: static int validate_stmt(stmt_ty stmt) { ... } "#define stmt 269" causes a compilation issue, the preprocessor replaces the code with: static int validate_stmt(stmt_ty 269) { ... } ... which is invalid. Another example: return validate_expr(exp->v.IfExp.test, Load) && validate_expr(exp->v.IfExp.body, Load) && validate_expr(exp->v.IfExp.orelse, Load); The preprocessor replaces "exp->v.IfExp.test" with "exp->v.IfExp.305" which is invalid... The compile.h header file works around the issue by redefining 3 constants but using "Py_" prefix: /* These definitions must match corresponding definitions in graminit.h. There's code in compile.c that checks that they are the same. */ #define Py_single_input 256 #define Py_file_input 257 #define Py_eval_input 258 For comparison, graminit.h uses: #define single_input 256 #define file_input 257 #define eval_input 258 There are different solutions: * Do nothing: require to include graminit.h at the right place * Add a prefix to all symbols, ex: test => Py_test, grammar_test, etc. * Rename problematic names like 'test' and 'stmt' * Fix C code to avoid problematic name: 'test' is an an attribute name of a node struct... Note: "static const int single_input = 305;" cause a complation error on "case single_input": "case label does not reduce to an integer constant". IMHO adding a prefix would be a nice enhancement and a good compromise. It only impacts the four C files which include graminit.h: future.c, ast.c, parsetok.c and parsermodule.c. ---------- components: Interpreter Core messages: 329517 nosy: vstinner priority: normal severity: normal status: open title: graminit.h defines very generic names like 'stmt' or 'test' versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:07:58 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 14:07:58 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541772478.31.0.788709270274.issue35194@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- pull_requests: +9707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:08:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 14:08:58 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541772538.37.0.788709270274.issue35197@psf.upfronthosting.co.za> STINNER Victor added the comment: > Note: "static const int single_input = 305;" cause a complation error on "case single_input": "case label does not reduce to an integer constant". Ah! A friend gave me another solution, define an enum. Example: enum { single_input = 256, ... }; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:10:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 14:10:35 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541772635.69.0.788709270274.issue35197@psf.upfronthosting.co.za> STINNER Victor added the comment: Current workaround in ast.c: /* This is done here, so defines like "test" don't interfere with AST use above. */ #include "grammar.h" #include "parsetok.h" #include "graminit.h" This code is in the "middle" of ast.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:27:12 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 14:27:12 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541773632.92.0.788709270274.issue35194@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: I've checked than other macros in Modules/cjkcodecs/cjkcodecs.h don't avoid multiple argument evaluation (e.g. OUTCHAR2, _TRYMAP_ENC), so I've changed 'assert' to a variant of what Serhiy suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:35:21 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 14:35:21 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541774121.82.0.788709270274.issue35194@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: OUTCHAR2 is a wrong example. Other examples are NEXT_IN, NEXT_OUT. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 09:41:27 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Nov 2018 14:41:27 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541774487.95.0.788709270274.issue35197@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:20:45 2018 From: report at bugs.python.org (Ayappan) Date: Fri, 09 Nov 2018 15:20:45 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX Message-ID: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> New submission from Ayappan : I am trying to build pandas-0.23.4 using python3 in AIX. Everything goes fine till it encounters a cpp file. Below is the compile error output. building 'pandas._libs.window' extension gcc -fPIC -maix64 -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/opt/freeware/lib64/python3.6/site-packages/numpy/core/include -I/opt/freeware/include/python3.6m -c pandas/_libs/window.cpp -o build/temp.aix-7.2-3.6/pandas/_libs/window.o -Wno-unused-function In file included from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821, from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4, from pandas/_libs/window.cpp:587: /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] #warning "Using deprecated NumPy API, disable it by " \ ^~~~~~~ g++ gcc -maix64 -pthread -bI:/opt/freeware/lib/python3.6/config-3.6m/python.exp -L. -L/usr/include -L/opt/freeware/include -L/usr/lib/threads -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib64 -L/usr/lib -L. -L/usr/include -L/opt/freeware/include -L/usr/lib/threads -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib64 -L/usr/lib build/temp.aix-7.2-3.6/pandas/_libs/window.o -L/opt/freeware/lib64 -o build/lib.aix-7.2-3.6/pandas/_libs/window.so g++: error: gcc: No such file or directory g++: error: unrecognized command line option '-bI:/opt/freeware/lib/python3.6/config-3.6m/python.exp' error: command 'g++' failed with exit status 1 Seems like somewhere setting up the proper compile options for compiling cpp files is not proper. Any hint will be really useful. ---------- components: Build messages: 329522 nosy: Ayappan priority: normal severity: normal status: open title: Build issue while compiling cpp files in AIX type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:32:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:32:02 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode Message-ID: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> New submission from STINNER Victor : Currently, even when Python is compiled in debug mode, PyTuple_GET_ITEM() doesn't check that the first argument is a tuple objet and that the second argument is valid index. It can lead to a crash and Python doesn't help debugging. I propose to convert the macro to a function call and use regular assertions to abort Python if the C API is misused. I propose to use a function call rather than abusing the preprocessor syntax like (assert(...),expr) syntax used in unicodeobject.h, because I the preprocessor causes complex bugs (difficult to understand and to fix/work around) and because later I would like to experiment to be able to compile C extensions to always use function calls, but get a different implementation depending on the "Python runtime". I elaborated this idea on this website: * https://pythoncapi.readthedocs.io/runtimes.html#debug-build * https://pythoncapi.readthedocs.io/ I am working on an implementation. ---------- components: Interpreter Core messages: 329523 nosy: vstinner priority: normal severity: normal status: open title: Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:38:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:38:19 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541777899.07.0.788709270274.issue35199@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9708 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:39:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 15:39:42 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541777982.24.0.788709270274.issue35197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it would be better to exclude graminit.h from the set of distributed headers. It is internal generated file, it should not be used by any user code. Some constants are duplicated as a part of public API in compile.h. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:40:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:40:52 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541778052.84.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: Currently, PyTuple_GET_ITEM() can be used with &PyTuple_GET_ITEM(). If we convert PyTuple_GET_ITEM() to a function returning PyObject*, it's no longer possible. My PR 10434 prepares the code for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:43:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 15:43:02 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541778182.24.0.788709270274.issue35197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: graminit.h is included in few files, and not always its inclusion is necessary. Here is a patch that minimizes its inclusion. It is not ready for merging, it is just a demo. ---------- keywords: +patch Added file: https://bugs.python.org/file47916/include-graminit-h.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:48:27 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Nov 2018 15:48:27 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1541778507.11.0.788709270274.issue35059@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I am collecting information on how different compilers behave with the `static inline`. I am checking the following compilers: ARM GCC AVR GCC CLANG X86_64 CLANG RISC-V ELLCC GCC X86_64 ICC x86_64 MIPS GCC MSP GCC POWERPC GCC AIX Compiler (xlc) SunPro Compilers will report back when I have enough information on these. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:54:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:54:47 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541778887.02.0.788709270274.issue35197@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think it would be better to exclude graminit.h from the set of distributed headers. It is internal generated file, it should not be used by any user code. I'm fine with moving it to Include/internal/. Do you know if it's used outside CPython? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:56:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:56:52 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541779012.86.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d17a693fa08ce9f2d35acbb1f76e20bdae3e01da by Victor Stinner in branch 'master': bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434) https://github.com/python/cpython/commit/d17a693fa08ce9f2d35acbb1f76e20bdae3e01da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 10:58:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 15:58:12 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541779092.03.0.788709270274.issue35199@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:05:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 16:05:18 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541779518.95.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: Copy of my comment: https://github.com/python/cpython/pull/10435#issuecomment-437405620 This change breaks the backward compatibility when a C extension is compiled with Py_DEBUG. So I'm not sure that it should be merged into Python 3.8. Maybe we should add a new opt-in experimental option to enable it, instead of Py_DEBUG? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:25:51 2018 From: report at bugs.python.org (Julien Palard) Date: Fri, 09 Nov 2018 16:25:51 +0000 Subject: [issue35200] Range repr could be better Message-ID: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> New submission from Julien Palard : This morning I was teaching Python (again and again), and again I was thinking we could do better about the representation of ranges. Typically in the current repr of ranges we do not see that the end is excluded: >>> range(10) range(0, 10) However it has the (little?) benefit of respecting the "repr gives valid Python". I propose to change it to: >>> range(10) ---------- messages: 329531 nosy: mdk priority: normal severity: normal status: open title: Range repr could be better type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:28:55 2018 From: report at bugs.python.org (Julien Palard) Date: Fri, 09 Nov 2018 16:28:55 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541780935.56.0.788709270274.issue35200@psf.upfronthosting.co.za> Change by Julien Palard : ---------- keywords: +patch pull_requests: +9710 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:36:17 2018 From: report at bugs.python.org (Lasne) Date: Fri, 09 Nov 2018 16:36:17 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541781377.13.0.788709270274.issue35200@psf.upfronthosting.co.za> Lasne added the comment: Sounds like a great idea to me, hence I never really understood how range worked ---------- nosy: +seluj78 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:37:37 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Nov 2018 16:37:37 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541781457.25.0.788709270274.issue35197@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: >Do you know if it's used outside CPython? Although not a complete view, all of the mentions I can find in GitHub is in copies of CPython/forks/vendoring of Cpython: https://github.com/search?l=C&p=13&q=graminit.h&type=Code ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:42:53 2018 From: report at bugs.python.org (Kevin) Date: Fri, 09 Nov 2018 16:42:53 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1541781773.13.0.788709270274.issue31625@psf.upfronthosting.co.za> Kevin added the comment: AIX supports the -s flag: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.cmds1/ar.htm#ar__row-d3e27561 ---------- nosy: +kadler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:43:13 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 16:43:13 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541781793.01.0.788709270274.issue35200@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The current repr is awkward for teaching but does have the virtue of being able to round-trip. When that is possible, it is what the language usually chooses. FWIW, you can show ranges with print() and *-unpacking: >>> print(*range(1000, 2000, 100)) 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:47:38 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 16:47:38 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541782058.67.0.788709270274.issue35199@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I don't think this should be merged. A lot of code of uses PyTuple_GET_ITEM(). Also, the "problem" your solving doesn't seem to exist in practice. Further, I worry that a compiler may choose not to inline on occasion, leading to performance regressions in code that has already been finely tuned. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:54:51 2018 From: report at bugs.python.org (Daniel Israel) Date: Fri, 09 Nov 2018 16:54:51 +0000 Subject: [issue35201] Recursive '**' matches non-existent directories. Message-ID: <1541782491.74.0.788709270274.issue35201@psf.upfronthosting.co.za> New submission from Daniel Israel : In the following case, when there is no file or directory 'a', glob will still return it: >>> glob.glob("a/**", recursive=True) [ 'a/' ] Note that this is inconsistent with the '*' pattern: >>> glob.glob("a/*", recursive=True) [] ---------- components: Library (Lib) messages: 329537 nosy: daniel priority: normal severity: normal status: open title: Recursive '**' matches non-existent directories. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 11:57:57 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 16:57:57 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541782677.86.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > The auto-squeezing can be "disabled" easily by setting > the minimum # lines to a high number in the config dialog. When I teach Python, it is unreasonable to have to have every learner reconfigure IDLE away from usable defaults. The squeezing is somewhat jarring and is almost never what we want in live demos. It is rarely that I don't immediately have to unsqueeze the output. > Can you give more details? Try this and watch it crawl: >>> print(*range(500)) I don't know whether squeezing is the culprit, but something is causing 1970s print performance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 12:25:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 17:25:08 +0000 Subject: [issue35201] Recursive '**' matches non-existent directories. In-Reply-To: <1541782491.74.0.788709270274.issue35201@psf.upfronthosting.co.za> Message-ID: <1541784308.91.0.788709270274.issue35201@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is expected behavior, and it matches the behavior of Bash. $ mkdir empty $ shopt -s globstar failglob $ echo empty/* bash: no match: empty/* $ echo empty/** empty/ "**" matches zero or more path components. In this case case it matches zero. ---------- nosy: +serhiy.storchaka resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 12:27:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 17:27:31 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541784451.46.0.788709270274.issue35200@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Or just >>> *range(1000, 2000, 100), (1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 12:34:33 2018 From: report at bugs.python.org (Kevin) Date: Fri, 09 Nov 2018 17:34:33 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541784873.12.0.788709270274.issue35198@psf.upfronthosting.co.za> Change by Kevin : ---------- keywords: +patch pull_requests: +9711 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 12:39:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 17:39:39 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541785179.51.0.788709270274.issue35197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It can be used by the code that works directly with CST instead of AST: these constants are used as values of the n_type field of the node structure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 12:35:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 17:35:28 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541784928.4.0.788709270274.issue35200@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If possible, I prefer to get the repr in the form of Python expression rather of cryptic angled form. The former is often shorter, that is important if it is a part of the repr of more complex object. You can just copy, paste and edit it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 13:06:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Nov 2018 18:06:02 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541786762.27.0.788709270274.issue35196@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: * Squeezing doesn't triggered by outputting a lot of short lines. * If you write to stdout by small chunks, it adds a large overhead to every write() call. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 13:06:20 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 18:06:20 +0000 Subject: [issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE In-Reply-To: <1541711315.03.0.788709270274.issue35193@psf.upfronthosting.co.za> Message-ID: <1541786780.38.0.788709270274.issue35193@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I'm working on getting a memory-sanitizer buildbot setup. I'm so happy it made finding and debugging this relatively easy. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 13:29:24 2018 From: report at bugs.python.org (Dragoljub) Date: Fri, 09 Nov 2018 18:29:24 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541788164.18.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: After some more benchmarks I'm seeing this line of code called in Python 3.7 but not in Python 3.5: {built-in method _thread.allocate_lock} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 13:49:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Nov 2018 18:49:55 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541789395.8.0.788709270274.issue35196@psf.upfronthosting.co.za> Terry J. Reedy added the comment: [I wrote the following after Tal's first response, before reading Raymond's second post in response to Tal.] The October releases were deficient in only documenting Squeezer in the IDLE section of "What's New in Python X.Y" and a News entry (copied to Help => About IDLE => News). I don't intend to repeat mistake like this. As part of working through the backlog of IDLE doc issues, I have since added the following. """ Startup and code execution [existing section] ... User output in Shell [new subsection] ... Shell has a special facility for squeezing output lines down to a ?Squeezed text? label. This is done automatically for output over N lines (N = 50 by default). N can be changed in the PyShell section of the General page of the Settings dialog. Output with fewer lines can be squeezed by right clicking on the output. This can be useful [for] lines long enough to slow down scrolling. Squeezed output is expanded in place by double-clicking the label. It can also be sent to the clipboard or a separate view window by right-clicking the label. """ I just noticed the missing 'for'. I am thinking of rewriting the sentence as "This can be useful when lines are so long that they make scrolling slower." Adding to what Tal said: IDLE's calltips replace some uses of help() in standard interactive Python. For the rest, I think being able to move hundreds of lines out of the REPL and into a separate persistent window, which that can be moved at least partly aside from Shell, improves IDLE's usability for teaching. Such blobs of text make it hard to scroll back to see previous entries and responses. Overall, partial squeezing does not seem like a great idea to me. It only partially fixes the scrolling issue. It would complicate both the implementation and use of squeezing, especially for viewing the whole text outside of Shell. I looked at the first 100 lines of help(str) and 65 (after the first 15) list the generic dunder methods. I think showing all either in Shell or a text view is better. ---------- nosy: -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 13:59:12 2018 From: report at bugs.python.org (Erik Janssens) Date: Fri, 09 Nov 2018 18:59:12 +0000 Subject: [issue20596] Support for alternate wcstok syntax for Windows compilers In-Reply-To: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> Message-ID: <1541789952.49.0.788709270274.issue20596@psf.upfronthosting.co.za> Erik Janssens added the comment: @serhiy.storchaka Are you suggesting the discrimination should be based on compiler specific defines, or rather that it should go through configuration (a HAVE_WCSTOK_S pyconfig.h) ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:00:35 2018 From: report at bugs.python.org (Kevin) Date: Fri, 09 Nov 2018 19:00:35 +0000 Subject: [issue34373] test_time errors on AIX In-Reply-To: <1533917751.88.0.56676864532.issue34373@psf.upfronthosting.co.za> Message-ID: <1541790035.38.0.788709270274.issue34373@psf.upfronthosting.co.za> Change by Kevin : ---------- nosy: +kadler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:00:38 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Nov 2018 19:00:38 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541790038.97.0.788709270274.issue35198@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +David.Edelsohn, Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:09:12 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Nov 2018 19:09:12 +0000 Subject: [issue35202] Remove unused imports in standard library Message-ID: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> New submission from Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : Please find the modules where we need to remove. codecs.py:1105:5: F401 'encodings' imported but unused code.py:298:13: F401 'readline' imported but unused platform.py:118:1: F401 'warnings' imported but unused platform.py:509:9: F401 'java.lang' imported but unused pstats.py:562:9: F401 'readline' imported but unused shutil.py:13:1: F401 'io' imported but unused site.py:409:13: F401 'rlcompleter' imported but unused site.py:511:13: F401 'sitecustomize' imported but unused site.py:531:13: F401 'usercustomize' imported but unused trace.py:54:1: F401 're' imported but unused typing.py:21:1: F401 'abc' imported but unused I was just wondering that as a community, do we recommend this practice of cleaning up Or just we keep as is inorder to NOT to break accidental imports? ---------- messages: 329548 nosy: thatiparthy priority: normal severity: normal status: open title: Remove unused imports in standard library _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:10:32 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Nov 2018 19:10:32 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541790632.39.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- keywords: +patch pull_requests: +9712 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:15:22 2018 From: report at bugs.python.org (Niklas Sombert) Date: Fri, 09 Nov 2018 19:15:22 +0000 Subject: [issue34628] urllib.request.urlopen fails when userinfo is present in URL In-Reply-To: <1536683596.21.0.0269046726804.issue34628@psf.upfronthosting.co.za> Message-ID: <1541790922.62.0.788709270274.issue34628@psf.upfronthosting.co.za> Niklas Sombert added the comment: Another month has passed, just saying. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:27:37 2018 From: report at bugs.python.org (Dexter) Date: Fri, 09 Nov 2018 19:27:37 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present Message-ID: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> New submission from Dexter : When installing Python 3.7 from the Windows Installer in a restricted environment the installer appears to ignore the InstallLauncherAllUsers=0 and Include_launcher=0 flags if the launcher is already present from a previous install. I am on a machine where the system python is centrally controlled and cannot be modified by me. In previous versions I have installed personal copies using the InstallLauncherAllUsers=0 InstallAllUsers=0 as exemplified in the docs or just unticking in the UI. However in 3.7 the tick-box for the launcher is ticked but greyed out in the UI. I am unable to de-select it and, as I do not have permission to modify the system wide launcher, I cannot install Python 3.7. My suspicion is that the box is greyed out if someone has installed the site wide version to ensure the site wide version is in-line with the installer but: a) What if this is an older version and I do not want it replaced. b) What if a user like me can't upgrade that script and is happy to have a version that will not be understood by the launcher for other purposes. Assuming there is no current workaround. I propose that either we remove this restriction or at least allow an override. e.g. ForceExistingLauncherUpgrade=1 by default to preserve current behaviour and if 0 then allow the other launcher exclusions to apply. ---------- components: Windows messages: 329550 nosy: gr-dexterl, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:32:53 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Nov 2018 19:32:53 +0000 Subject: [issue32485] Multiprocessing dict sharing between forked processes In-Reply-To: <1514972661.4.0.467229070634.issue32485@psf.upfronthosting.co.za> Message-ID: <1541791973.17.0.788709270274.issue32485@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:50:05 2018 From: report at bugs.python.org (Jeffrey Armstrong) Date: Fri, 09 Nov 2018 19:50:05 +0000 Subject: [issue20596] Support for alternate wcstok syntax for Windows compilers In-Reply-To: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> Message-ID: <1541793005.78.0.788709270274.issue20596@psf.upfronthosting.co.za> Change by Jeffrey Armstrong : ---------- nosy: -Jeffrey.Armstrong _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 14:56:37 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Nov 2018 19:56:37 +0000 Subject: [issue32281] bdist_rpm v.s. the Macintosh In-Reply-To: <1513034809.77.0.213398074469.issue32281@psf.upfronthosting.co.za> Message-ID: <1541793397.29.0.788709270274.issue32281@psf.upfronthosting.co.za> Ned Deily added the comment: Rather than searching a few hard-coded paths, I would think this would be a good case for using distutils.spawn find_executable like test_bdist_rpm.py does :) If someone (@bhyde) were willing to create a PR with that change, this issue will have a much better chance of being resolved. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:00:30 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Nov 2018 20:00:30 +0000 Subject: [issue32281] bdist_rpm fails if no rpm command and rpmbuild is not in /usr/bin or /bin In-Reply-To: <1513034809.77.0.213398074469.issue32281@psf.upfronthosting.co.za> Message-ID: <1541793630.97.0.788709270274.issue32281@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +easy stage: -> needs patch title: bdist_rpm v.s. the Macintosh -> bdist_rpm fails if no rpm command and rpmbuild is not in /usr/bin or /bin versions: +Python 3.8 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:10:25 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Nov 2018 20:10:25 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541794225.87.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: -9712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:10:51 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Nov 2018 20:10:51 +0000 Subject: [issue32485] Multiprocessing dict sharing between forked processes In-Reply-To: <1514972661.4.0.467229070634.issue32485@psf.upfronthosting.co.za> Message-ID: <1541794251.8.0.788709270274.issue32485@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Gus, dict don't have a has_key() method in Python 3. multiprocessing objects are generally not fork-safe: multiprocessing has its own mechanisms to duplicate objects between processes, but you cannot assume that after calling fork() yourself, objects will still be usable in the child. I'm closing this issue as not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:11:28 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Nov 2018 20:11:28 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541794288.62.0.788709270274.issue35202@psf.upfronthosting.co.za> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: I have raised a partial PR here - https://github.com/python/cpython/pull/10438; if it is merged please take up the rest of the changes mentioned in the issue description. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:13:07 2018 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Nov 2018 20:13:07 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1541766445.71.0.788709270274.issue33878@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I would like to see this fixed. On Fri, Nov 9, 2018 at 4:27 AM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > I think that the fact that `(a) = 42` is accepted is rather an > implementation detail, and the consequence of limitations of the grammar > parser. It accepts arbitrary expression at the left hand side of > assignment. After transforming CST to AST unsuitable targets are rejected, > but information about grouping parenthesis is lost at this stage. > > This can be fixed if check the left hand side node before converting to > AST. > > ---------- > nosy: +gvanrossum, serhiy.storchaka > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:37:34 2018 From: report at bugs.python.org (Max Bowsher) Date: Fri, 09 Nov 2018 20:37:34 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present In-Reply-To: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> Message-ID: <1541795854.25.0.788709270274.issue35203@psf.upfronthosting.co.za> Change by Max Bowsher : ---------- nosy: +Max Bowsher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:42:06 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 09 Nov 2018 20:42:06 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541796126.84.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: > If you write to stdout by small chunks, it adds a large overhead to every write() call. While I agree that there is great room for optimization in Squeezer's interception of write(), it doesn't appear to have a noticeable effect in such cases, e.g. in the examples provided by Raymond in the first comment. In my testing, even removing the write() interception entirely doesn't have an effect I can notice. I'm happy to optimize it anyways, there is plenty of "low hanging fruit" there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:51:31 2018 From: report at bugs.python.org (Oscar Esteban) Date: Fri, 09 Nov 2018 20:51:31 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1541796691.45.0.788709270274.issue22393@psf.upfronthosting.co.za> Change by Oscar Esteban : ---------- pull_requests: +9713 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 15:56:51 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Nov 2018 20:56:51 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541797011.33.0.788709270274.issue35196@psf.upfronthosting.co.za> Terry J. Reedy added the comment: On my machine, 2.7.15 (without squeezing) and 3.7.1 (with squeezing) IDLE results (average seconds). from timeit import timeit timeit("print('nnn '*500)", number=10) # Exp1: .0357, .0355 timeit("for i in range(500): print(i)", number=4) # Exp2: 1.45, 1.70 timeit("print(*range(500))", number=4) # Exp3: about 5*, 4.85 * 'from __future__ import print_function' does not work with timeit either as setup or part of statement, so I timed on 2.7 with my phone stopwatch. I actually got 5.1 twice but subtract at least .1 for my reaction time delay at the end. Serhiy's first comment is about 500 very short lines (experiment 2) not being squeezed. This surprised me. Tal? Experiments 2 versus 1 illustrate Serhiy's 2nd comment. Experiements 3 (*range) versus 2 show that repeated writes to the same line are even slower. There is a known issue with tk Text and long lines, and 2000 chars is more than long. In fact, using range(100, 100+n) (to have a uniform 4 chars per number), the slowdown shows by n=200 (800 chars). My previous experiments have also shown that 'long' starts somewhere less than 1000. tk 8.7, in alpha or beta stage, reportedly has a re-written Text widget that improves this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 16:05:14 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 09 Nov 2018 21:05:14 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541797514.41.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: > Serhiy's first comment is about 500 very short lines (experiment 2) not being squeezed. This surprised me. Tal? Indeed, this is not currently supported. This is possible, it would just complicate the write() interceptor and require the new ability to update an existing "Squeezed text" label. Terry, just say the word and I'll get working on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 16:09:08 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 09 Nov 2018 21:09:08 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541797748.67.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: > On my machine, 2.7.15 (without squeezing) and 3.7.1 (with squeezing) IDLE results (average seconds). > > from timeit import timeit > timeit("print('nnn '*500)", number=10) # Exp1: .0357, .0355 > timeit("for i in range(500): print(i)", number=4) # Exp2: 1.45, 1.70 > timeit("print(*range(500))", number=4) # Exp3: about 5*, 4.85 Comparing 3.7.0 to current master, I'm seeing about a 4% slowdown on the second experiment. That's significant, but probably not what Raymond or Serhiy are worried about. Regardless, I've nearly got a PR with an optimization ready. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 16:35:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 21:35:54 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541799354.68.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Adding to what Tal said: IDLE's calltips replace some uses > of help() in standard interactive Python. For the rest, I > think being able to move hundreds of lines out of the > REPL and into a separate persistent window, which that can > be moved at least partly aside from Shell, improves IDLE's > usability for teaching. Such blobs of text make it > hard to scroll back to see previous entries and responses. I respectfully disagree. I've used IDLE for teaching over 200 days per year for the past seven years. It is becoming less and less usable and more and more buggy as it ventures beyond its original goals of being a simple, basic interactive development environment. We're still getting double and triple spacing after a syntax error and that survives a shell-restart. So, I have to close and start new session logs several times per day. The slow printing makes students think that Python is slow, so I switch to the command-line to show that the output can be almost instant. The tooltips sometimes show the print() function tooltip no matter what is being editted and it persists on the screen as your typing the whole expression. This is a significant visual distraction from the actual code. The squeezer causes frequent breaks in a train of thought because when I ask Python to display something, I then have to switch windows and click the unsqueeze. For years, I get random paste-clipboard effects in the middle of typing lines in the interactive shell session. My only defense is to type Cntl-Z to undo the splatter so that I can continue with my demos uninterrupted. I show people how to edit code in one window, press F5 to see and debug the results at the interactive prompt. Seeing both at the same time on side-by-side screens makes for an effective workflow. However, recently a student got into a new-tabbed mode and there didn't seem to be any way to turn it off. It became impossible to see code and output or error messages at the same time. This devastated the learner's experience. The redesign of the configuration fonts/tabs window was not an improvement. We need to get rid of the slider for indentation width (it attracts newcomers like a moth to flame). Instead, we need a slider for the font-size which is usually the very first thing people need to change. The giant window for font samples is cute and mostly useless. I don't know if it is possible, but it would be great to filter the font sets to only show monospaced fonts. Students setting to Arial degrade their Python experience without ever realizing why. People need to be able to edit quickly. On the Mac, Cntl-E does the right thing and goes to the end of a line, but Cntl-A goes to the beginning, even before the PS1 prompt. This a low quality experience (readline is smart-enough not to do that at the command-line). I can make a custom key set and remap Cntl-A to beginning-of-line but it is a PITA to have to get a whole classroom of people to do this every week. It should be the default. When started from a terminal session, IDLE emits some warnings such as " Warning: config.IdleConf.GetThemeDict - problem retrieving theme element 'context-background' from theme 'ttmmmmmmpp'" Note the odd theme name and doubled letters. Likewise, on the configure window for keys the custom key set name shows up as 'bbllttiinn'. I don't use this but the letters are oddly doubled there a well. Tab completion sometimes works and sometimes doesn't. When typing in text blocks (triple quoted strings) the tab key sometimes indents and sometimes starts inserting "IndexError" or some other random text". FWIW, I think the squeezer focused on the wrong problem. In general, I've never had a problem with too many *lines* of output. You can always Ctnl-C if printing a long file or somesuch. The real problem with IDLE was excessive wide output on a *single* line (i.e. look at the repr for a recently read dataset or long repr for a list). That tends to cripple IDLE because line wrap logic seems to be computationally expensive for scrolling text windows. The effect persists even after the offending text has scrolled off and is no longer visible. For feature requests, there's only a handful of things that I need to improve the experience: * Cntl-plus and Cntl-minus to change the font size. * A hotkey to clear the entire text window. * A way to make interactive prompt sessions auto-save periodically. * An easy way to turn-on and off line numbering with off as the default. I don't personally need this, but some learner will request it once each week. Some other ideas: * It would be nice if IDLE's shell session recognized when someone typed a line starting with "python" "pip" "cd" or "ls". It is common to have someone confused about bash command lines very python command lines. Two other recurring usability problems * Sometimes the search and replace dialog loses the focus and gets buried *under* editor panes. The visible pane seems completely inoperative because it is waiting on the non-pane pane to close its dialog. Ideally, active dialog windows can be forced to the top. However, if that isn't possible, at least make the window exitable by pressing ESC (which is one of things people try when their editor pane becomes unresponsive). * Likewise, when pressing F5 and a SyntaxError is encountered, a dialog window pops up that cannot be cleared with an ESC key. So users have to break their keyboard workflow and use a mouse to target a small button because turning their attention back to the screen location where the actual problem is. Hope you all find this suggestion list to be useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 16:53:47 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 21:53:47 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541800427.33.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: * In the File Save dialog, the suggested filename should be "untitled.py" rather than "Untitled.py". This would reflect our modern module naming conventions. Ideally, it should warn against unimportable names like "Intro Lesson -- Wednesday.py" * For Mac users, a fresh install of Python from python.org comes without certificates installed. Immediately, people will get an inscrutable error message when they try to use urlopen('http://www.python.org').read(). The recommended solution is to use the Finder to locate Python3.7 under Applications and then run the Install Certificates command. It would be great if we could do this directly from IDLE so that people don't have to leave the environment to get Python to be minimally functionally for internet access. * Another feature request that has been open for a long time is a window to interact with pip. We need very little, a "pip freeze" to show what is installed, and a "pip install -U" option to install or upgrade a package. It is not a good beginner experience to have to leave the IDLE environment and brave the BASH command-line or Windows command-line (with its attendant pathing issues) just to install requests or pyflakes. * There has also been a long standing open request to have a hot key to run linting or code formatting tools directly from IDLE. For beginners, it is too painful to have to try to coordinate between these command line tools and the IDLE editing environment. Some basic integration of the two seems like it would be a straight-forward task. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 17:33:27 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 22:33:27 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() Message-ID: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : address_in_range() in Objects/obmalloc.c may access memory that is mapped but is considered free by the underlying libc allocator. In #18596, address sanitizing was disabled for this function. But thread and memory sanitizers similarly trip on this function: WARNING: ThreadSanitizer: heap-use-after-free (pid=24361) Read of size 4 at 0x7b7c00000020 by main thread: #0 address_in_range /scratch2/izbyshev/cpython/Objects/obmalloc.c:1312:23 (python+0x59e912) ==3515==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x9713f8 in address_in_range /scratch2/izbyshev/cpython/Objects/obmalloc.c:1313:35 I suggest to disable them for this function as well. ---------- components: Interpreter Core messages: 329561 nosy: benjamin.peterson, izbyshev, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Disable thread and memory sanitizers for address_in_range() type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 17:36:46 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 22:36:46 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541803006.61.0.788709270274.issue35204@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- keywords: +patch pull_requests: +9714 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 17:40:46 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 09 Nov 2018 22:40:46 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541803246.16.0.788709270274.issue35204@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: I've submitted a PR which implements the change with additional cleanups. GCC introduced TSan together with ASan in 4.8[1], but didn't provide a macro to test for -fsanitize=thread option until 7[2,3]. [1] https://gcc.gnu.org/gcc-4.8/changes.html [2] https://gcc.gnu.org/onlinedocs/gcc-6.4.0/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros [3] https://gcc.gnu.org/onlinedocs/gcc-7.1.0/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 17:41:32 2018 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 09 Nov 2018 22:41:32 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541803292.19.0.788709270274.issue35202@psf.upfronthosting.co.za> Eric V. Smith added the comment: I think we can remove these in 3.8. My understanding of the policy (which I cannot find: the search terms are too generic) is that if a module defines __all__, and the symbol we want to remove isn't in it, then we can remove the symbol in the next feature release without requiring a deprecation period. If a module doesn't define __all__, then we need a deprecation period in order to remove a symbol, unless the symbol is a module, and then we can just remove it in the next feature release. ---------- nosy: +eric.smith versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 17:42:39 2018 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 09 Nov 2018 22:42:39 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541803359.62.0.788709270274.issue35202@psf.upfronthosting.co.za> Eric V. Smith added the comment: Let me restate that: I think we can remove these in 3.8 if they're not in the module's __all__. I haven't checked that, although it would surprise me if any of them were in __all__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:03:54 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 09 Nov 2018 23:03:54 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541804634.36.0.788709270274.issue35200@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Not everyone knows the '...' convention. At least according to Google's predictive search, if I type "what does three dots" I get common searches such as "what does three dots mean at the end of a sentence" and similar. How does your proposed repr look for the edge-cases where there are fewer than five included values? e.g. range(0). ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:12:54 2018 From: report at bugs.python.org (Jules Lasne) Date: Fri, 09 Nov 2018 23:12:54 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541805174.88.0.788709270274.issue35200@psf.upfronthosting.co.za> Jules Lasne added the comment: As you can see in his PR (https://github.com/python/cpython/pull/10436), he added multiple display types based on the size of the range. This is easily represented in the dumb_range_repr function: https://github.com/python/cpython/pull/10436/files#diff-95a46658bf7fed08423d060e8f9c1dc2R18 Or here is the C implementation: https://github.com/python/cpython/pull/10436/files#diff-5782f3fcbdfb176507359c3712c42655R597 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:15:49 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 23:15:49 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541805349.77.0.788709270274.issue35202@psf.upfronthosting.co.za> Raymond Hettinger added the comment: There's a few that should be discussed with the module maintainers first. A patch for IDLE should go through Terry Reedy. The "java.lang" in platform isn't a normal import and may have something to do with Jython. The "abc" in typing.py might be there for a reason, so ask Guido before zapping it. It's also possible that "encodings" might be in codecs for a reason as well, but I'm not sure who you should check with. I'm not sure about readline, rlcompleter, sitecustomize, and usercustomize. I think think those imports may be there for their side-effects. Just importing them may suffice to enable some behavior, so be careful with these. ---------- nosy: +gvanrossum, rhettinger, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:18:04 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 23:18:04 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541805484.32.0.788709270274.issue35200@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One other thought, since the current repr round-trips, it can be eval'd. So changing it might break some code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:35:57 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 09 Nov 2018 23:35:57 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541806557.76.0.788709270274.issue35200@psf.upfronthosting.co.za> Steven D'Aprano added the comment: With the proposed design, any two empty range objects have the same repr: repr(range(0)) == repr(range(2, 2)) == repr(range(1, 5, -1)) etc. Between this loss of information, and the loss of round-tripping through eval, I'm against this proposal. But I'd perhaps be in favour of it as the __str__ rather than __repr__, so that printing a range object displays in the proposed format. By the way, the ``dumb_range_repr`` function in the PR could be simplified: # untested def dumb_range_repr(r): if len(r) < 5: return f"" else: return f"" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:41:36 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Nov 2018 23:41:36 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541806896.6.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:48:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 23:48:50 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541807330.33.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't think this should be merged. A lot of code of uses PyTuple_GET_ITEM(). Also, the "problem" your solving doesn't seem to exist in practice. Sorry my comment on the PR, a friend contacted me because (...) he misused PyTuple_GET_ITEM() :-) > Further, I worry that a compiler may choose not to inline on occasion, leading to performance regressions in code that has already been finely tuned. Oh, maybe I didn't explain properly my change. I don't want to change the "default" API nor the "default" implementation. My change is enabled enabled if you compile Python in debug mode, if Py_DEBUG is defined. In fact, it's an early attempt to see how we can introduce a new C API in Python. It seems like abusing Py_DEBUG was a bad idea, so I close my PR and I will close this issue as well. I will start a discussion on python-dev later, when I will have a plan. See also the discussion on the PR: https://github.com/python/cpython/pull/10435#issuecomment-437530430 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 18:50:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Nov 2018 23:50:24 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1541807424.64.0.788709270274.issue35197@psf.upfronthosting.co.za> STINNER Victor added the comment: > It can be used by the code that works directly with CST instead of AST: (...) Sorry, I don't know this part of CPython. Is the CST exposed in any way outside CPython internals? If no, I see no reason to expose graminit.h in the public C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:10:36 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 00:10:36 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541808636.73.0.788709270274.issue35199@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks. I don't really know enough about compilers and required-vs-optional C99 semantics to know whether these changes are safe. These are very old APIs and are used throughout the entire Python ecosystem. It would pay to be somewhat cautious. The whole C-API project is predicated on giving a 2x speed-up in exchange for destabilizing changes. These cross-module inline function-for-macro swaps aren't aligned with that goal. At the very best, the swaps will be performance neutral. At worst, they will invisibly degrade a huge swath of code, someone of which is finely-tuned (people generally only use PyTuple_GET_ITEM() in places where they want better performance than the existing function based alternative) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:12:18 2018 From: report at bugs.python.org (Dragoljub) Date: Sat, 10 Nov 2018 00:12:18 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541808738.08.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: After some more digging it appears that we see the 3.5x slowdown manifest in Python 3.7.0a4 and is not present in Python 3.7.0a3. One guess is that https://docs.python.org/3.7/whatsnew/changelog.html#python-3-7-0-alpha-4 bpo-29240: Add a new UTF-8 mode: implementation of the PEP 540 may contribute to this slowdown on windows. Is there a way to ensure we disable any native to UTF conversion that may be happening in Python 3.7.a4? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:15:57 2018 From: report at bugs.python.org (wenjun.o) Date: Sat, 10 Nov 2018 00:15:57 +0000 Subject: [issue35205] os.path.realpath preserves the trailing backslash on Windows in python 3.6.7 and python 3.7.1 Message-ID: <1541808957.5.0.788709270274.issue35205@psf.upfronthosting.co.za> New submission from wenjun.o : The statement "os.path.realpath('C:\\Users\\')" returns different results between 3.6.6 and 3.6.7 (and between 3.7.0 and 3.7.1) on Windows. With python 3.6.6 and 3.7.0 I got 'C:\\Users'. With python 3.6.7 and 3.7.1 I got 'C:\\Users\\'. Note the extra trailing backslash with python 3.6.7 and 3.7.1. On Linux the behavior is consistent where the trailing slash in the input will be remove from the output: os.path.realpath('/home/') --> '/home'. I think we should keep the behavior of removing trailing backslash on Windows. Thanks. ---------- components: Library (Lib) messages: 329574 nosy: wouyang priority: normal severity: normal status: open title: os.path.realpath preserves the trailing backslash on Windows in python 3.6.7 and python 3.7.1 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:19:43 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 00:19:43 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541809183.54.0.788709270274.issue35195@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: >From the PEP 540 This mode is off by default, but is automatically activated when using the "POSIX" locale. Add the -X utf8 command line option and PYTHONUTF8 environment variable to control UTF-8 Mode. https://docs.python.org/3.7/using/cmdline.html#envvar-PYTHONUTF8 I think you can set it to 0 from the docs yo see if it has any effect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:20:10 2018 From: report at bugs.python.org (Adam Dunlap) Date: Sat, 10 Nov 2018 00:20:10 +0000 Subject: [issue35192] pathlib mkdir throws FileExistsError when not supposed to In-Reply-To: <1541707708.76.0.788709270274.issue35192@psf.upfronthosting.co.za> Message-ID: <1541809210.19.0.788709270274.issue35192@psf.upfronthosting.co.za> Adam Dunlap added the comment: Thank your for your response. I'm running python 3.5.2. The linked issue is indeed a duplicate of this one. To reproduce, you can run two instances of the attached script at the same time, i.e. python3 pymkdir.py & python3 pymkdir.py. It is a race condition so won't happen every time, but with the number of directories created it should happen pretty frequently (remove the directories between tests with rm -rf 1) I'm running Ubuntu 16.04.5 LTS. I don't know if you know anything about Ubuntu's release process, but it would be nice if the linked fix could be backported to work on that platform. ---------- Added file: https://bugs.python.org/file47917/pymkir.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:36:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 00:36:49 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541810209.67.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: Oops, I forgot to close the issue. This change was an early attempt (tagged as WIP/DO-NOT-MERGE) to expriment changing the implementation without touching the API. But I was wrong, it does change the API (&PyTuple_GET_ITEM(ob, i) causes a compilation error) and so I closed my PR. Instead, I opened a thread on python-dev to better explain the whole context and my intent: https://mail.python.org/pipermail/python-dev/2018-November/155702.html I invite everyone to discuss there instead :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:45:24 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 00:45:24 +0000 Subject: [issue35192] pathlib mkdir throws FileExistsError when not supposed to In-Reply-To: <1541707708.76.0.788709270274.issue35192@psf.upfronthosting.co.za> Message-ID: <1541810724.32.0.788709270274.issue35192@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > Thank your for your response. I'm running python 3.5.2. The linked issue is indeed a duplicate of this one. Thanks for the confirmation and script. > I'm running Ubuntu 16.04.5 LTS. I don't know if you know anything about Ubuntu's release process, but it would be nice if the linked fix could be backported to work on that platform. I have limited knowledge of Ubuntu release process and from what I can see from https://packages.ubuntu.com/xenial/python3.5 3.5.2 is the latest release for python 3.5 ans the backport is at 3.4 and above. Core python team doesn't maintain the releases for Ubuntu and it's upto the relevant maintainer to package this. You can try a release from https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:46:26 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 00:46:26 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541810786.89.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: * One other thing that would be useful is to have a way to configure the startup directory from within IDLE; otherwise, users generally need to load IDLE from the command-line in order to control the startup directory. * The TurtleDemo launches correctly but cannot find the example files. * It would be nice to have the Help menu have a link python-tutor and another to pypi. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 19:53:50 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 00:53:50 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541811230.3.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: * Another open feature request is to have tab completion on dict keys. * We've had f-strings for a while now -- they would benefit greatly from syntax highlighting. * FWIW, I disagree with the notion that it is okay to cripple help() since we have tooltips. When a person types help(x), they are explicitly saying the tooltips didn't suffice and that they want the full help. * Another note on the squeezer. It cases where help() is long or 50+ lines of a file a being displayed, the auto-squeeze is defying an explicit user request to show information. IIRC, squeezing doesn't appear in other tooling I use. Terminal sessions don't elide output just because it is long. Pandas and IPython will compress datasets by showing the first n lines, an ellipsis, and the last n lines. That is reasonable. Not showing any data at all is unreasonable. As currently implemented, it is a misfeature (IMO). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:06:54 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 01:06:54 +0000 Subject: [issue35205] os.path.realpath preserves the trailing backslash on Windows in python 3.6.7 and python 3.7.1 In-Reply-To: <1541808957.5.0.788709270274.issue35205@psf.upfronthosting.co.za> Message-ID: <1541812014.24.0.788709270274.issue35205@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: realpath aliases to abspath in Windows as I can see from the code and I think this is a regression fixed with https://github.com/python/cpython/pull/10082 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:15:33 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 01:15:33 +0000 Subject: [issue34949] ntpath.abspath no longer uses normpath In-Reply-To: <1539139274.74.0.788709270274.issue34949@psf.upfronthosting.co.za> Message-ID: <1541812533.09.0.788709270274.issue34949@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. I think this was a regression reported in https://bugs.python.org/issue31047#msg328322 and was fixed with https://github.com/python/cpython/pull/10082 . I think the regression was in 3.7.1 but the fix was made a little later that it was not part of the 3.7.1 release. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:28:45 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Nov 2018 01:28:45 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541813325.76.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:31:44 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 01:31:44 +0000 Subject: [issue35120] SSH tunnel support to ftp lib In-Reply-To: <1540964996.8.0.788709270274.issue35120@psf.upfronthosting.co.za> Message-ID: <1541813504.02.0.788709270274.issue35120@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:33:33 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 01:33:33 +0000 Subject: [issue34510] add HTTPConnection.settimeout() In-Reply-To: <1540662645.84.0.788709270274.issue34510@psf.upfronthosting.co.za> Message-ID: <1541813613.74.0.788709270274.issue34510@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:37:01 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 01:37:01 +0000 Subject: [issue34950] Parse trusted and signature information from X509 certificate Message-ID: <1541813821.25.0.788709270274.issue34950@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:37:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 01:37:33 +0000 Subject: [issue35206] Add new experimental _Py_CAPI2 API Message-ID: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> New submission from STINNER Victor : Add a new experimental "_Py_CAPI2" API: opt-in which doesn't leak implementation details and replace macros with function calls. Attached PR modified PyTuple_GET_ITEM() if _Py_CAPI2 is defined. With this API, PyTuple_GET_ITEM() macro becomes a function call and the implementation uses assertions to check if the first argument is a tuple and that the index is valid. It should help to investigate bugs when Python is compiled in debug mode. This issue implements the idea that I proposed on python-dev: https://mail.python.org/pipermail/python-dev/2018-November/155702.html ---------- components: Interpreter Core messages: 329583 nosy: vstinner priority: normal severity: normal status: open title: Add new experimental _Py_CAPI2 API versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:38:27 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 10 Nov 2018 01:38:27 +0000 Subject: [issue35201] Recursive '**' matches non-existent directories. In-Reply-To: <1541782491.74.0.788709270274.issue35201@psf.upfronthosting.co.za> Message-ID: <1541813907.78.0.788709270274.issue35201@psf.upfronthosting.co.za> Change by Windson Yang : ---------- versions: +Python 3.5, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:38:54 2018 From: report at bugs.python.org (Eryk Sun) Date: Sat, 10 Nov 2018 01:38:54 +0000 Subject: [issue35205] os.path.realpath preserves the trailing backslash on Windows in python 3.6.7 and python 3.7.1 In-Reply-To: <1541808957.5.0.788709270274.issue35205@psf.upfronthosting.co.za> Message-ID: <1541813934.88.0.788709270274.issue35205@psf.upfronthosting.co.za> Change by Eryk Sun : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:39:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 01:39:32 +0000 Subject: [issue35206] Add new experimental _Py_CAPI2 API In-Reply-To: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> Message-ID: <1541813972.38.0.788709270274.issue35206@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9717 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:42:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 01:42:29 +0000 Subject: [issue35206] Add new experimental _Py_CAPI2 API In-Reply-To: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> Message-ID: <1541814149.23.0.788709270274.issue35206@psf.upfronthosting.co.za> STINNER Victor added the comment: I previously tried a very similar patch but reusing Py_DEBUG define, rather than adding a new _Py_CAPI2 define: bpo-35199. I abandonned it because it was backward incompatible. This change is backward compatible: the new API is not compatible with the current API, but the change doesn't impact the default API which remains unchanged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:43:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 01:43:03 +0000 Subject: [issue35206] Add a new experimental _Py_CAPI2 API In-Reply-To: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> Message-ID: <1541814183.4.0.788709270274.issue35206@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Add new experimental _Py_CAPI2 API -> Add a new experimental _Py_CAPI2 API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 20:43:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 01:43:18 +0000 Subject: [issue35199] Convert PyTuple_GET_ITEM() macro to a function call with additional checks in debug mode In-Reply-To: <1541777522.86.0.788709270274.issue35199@psf.upfronthosting.co.za> Message-ID: <1541814198.49.0.788709270274.issue35199@psf.upfronthosting.co.za> STINNER Victor added the comment: I created bpo-35206 "Add a new experimental _Py_CAPI2 API". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:14:05 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 10 Nov 2018 02:14:05 +0000 Subject: [issue34628] urllib.request.urlopen fails when userinfo is present in URL In-Reply-To: <1536683596.21.0.0269046726804.issue34628@psf.upfronthosting.co.za> Message-ID: <1541816045.72.0.788709270274.issue34628@psf.upfronthosting.co.za> Windson Yang added the comment: First, we can add some check at https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/http/client.py#L871 and raise an error if the URL contains userinfo part. Second, we should catch some exception in urllib.request.urlopen, if we agree, I can create a PR later. ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:17:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Nov 2018 02:17:21 +0000 Subject: [issue35206] [WIP] Add a new experimental _Py_CAPI2 API In-Reply-To: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> Message-ID: <1541816241.35.0.788709270274.issue35206@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Add a new experimental _Py_CAPI2 API -> [WIP] Add a new experimental _Py_CAPI2 API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:20:08 2018 From: report at bugs.python.org (Dragoljub) Date: Sat, 10 Nov 2018 02:20:08 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541816408.86.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: I tried playing around with the UTF-8 mode settings but did not get a speed improvement. After reading through the PEP it appears that on Windoes: "To allow for better cross-platform binary portability and to adjust automatically to future changes in locale availability, these checks will be implemented at runtime on all platforms other than Windows, rather than attempting to determine which locales to try at compile time." So if i'm understanding this correctly the locale coercion would not be controllable from Windows after Python is compiled? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:29:31 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 02:29:31 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541816971.24.0.788709270274.issue35196@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Just adding the open issues given Raymond's message for reference. A lot of the IDLE issues have patches and since we moved to GitHub they were not updated. Thanks to Tal for converting some patches togit PRs. I would like to help with minor issues (changing Untitled to untitled) to get familiarity with the IDLE codebase and testing given limited bandwidth from the team of Terry, Tal and Cheyrl. > There has also been a long standing open request to have a hot key to run linting or code formatting tools directly from IDLE. For beginners, it is too painful to have to try to coordinate between these command line tools and the IDLE editing environment. Some basic integration of the two seems like it would be a straight-forward task. https://bugs.python.org/issue21880 > Cntl-plus and Cntl-minus to change the font size. https://bugs.python.org/issue17642 (Seems to work with Turtledemo) > An easy way to turn-on and off line numbering with off as the default. I don't personally need this, but some learner will request it once each week. https://bugs.python.org/issue17535 > A hotkey to clear the entire text window. https://bugs.python.org/issue6143 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:36:27 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 02:36:27 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541817387.23.0.788709270274.issue35195@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I have limited understanding of Windows and I don't have access to a Windows machine to check this out. I am adding Victor who implemented the PEP and might help here. There also seems to be PYTHONLEGACYWINDOWSFSENCODING for windows specific use case. Some more notes on the original issue https://bugs.python.org/issue29240#msg285278. https://bugs.python.org/issue29240#msg285325 > Handle PYTHONLEGACYWINDOWSFSENCODING: this env var now disables the UTF-8 mode and has the priority over -X utf8 and PYTHONUTF8 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 21:58:30 2018 From: report at bugs.python.org (Eryk Sun) Date: Sat, 10 Nov 2018 02:58:30 +0000 Subject: [issue34949] ntpath.abspath no longer uses normpath In-Reply-To: <1539139274.74.0.788709270274.issue34949@psf.upfronthosting.co.za> Message-ID: <1541818710.58.0.788709270274.issue34949@psf.upfronthosting.co.za> Change by Eryk Sun : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:13:18 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Nov 2018 04:13:18 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 Message-ID: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : As commented on Issue33878, the fact that expressions like (x) = 42 are accepted is, in reality, an implementation detail and they should be disallowed. ---------- assignee: pablogsal components: Interpreter Core messages: 329590 nosy: pablogsal priority: normal severity: normal status: open title: Disallow expressions like (a) = 42 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:15:13 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Nov 2018 04:15:13 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541823313.7.0.788709270274.issue35207@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +9718 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:15:13 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Nov 2018 04:15:13 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541823313.78.0.663665092547.issue33878@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:19:25 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Nov 2018 04:19:25 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541823565.37.0.788709270274.issue35207@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- nosy: +gvanrossum, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:20:13 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Nov 2018 04:20:13 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541823613.12.0.788709270274.issue35207@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I am not sure if this is the cleanest/simplest implementation...if you think there is a better way to do this I am happy to change the Pull Request :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 9 23:36:26 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Sat, 10 Nov 2018 04:36:26 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541824586.32.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 00:14:39 2018 From: report at bugs.python.org (Dragoljub) Date: Sat, 10 Nov 2018 05:14:39 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541826879.8.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: I tested this at runtime with sys._enablelegacywindowsfsencoding() Also this was new in 3.6 and Py 3.6 does not have the slowdown issue. New in version 3.6: See PEP 529 for more details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 00:30:26 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Nov 2018 05:30:26 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541827826.24.0.788709270274.issue35207@psf.upfronthosting.co.za> Guido van Rossum added the comment: I could have sworn Benjamin showed a fix for this during the core-dev sprint in Seattle... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 00:47:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 05:47:15 +0000 Subject: [issue35194] A typo in a constant in cp932 codec In-Reply-To: <1541717724.61.0.788709270274.issue35194@psf.upfronthosting.co.za> Message-ID: <1541828835.35.0.788709270274.issue35194@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 0d165262d949440e5aea6533b10e19e4cd5cf12d by Serhiy Storchaka (Alexey Izbyshev) in branch '2.7': [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433) https://github.com/python/cpython/commit/0d165262d949440e5aea6533b10e19e4cd5cf12d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 01:04:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 06:04:25 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541829865.75.0.788709270274.issue35207@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually, `(a) = 42` doesn't contradict the grammar. assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression) target_list ::= target ("," target)* [","] target ::= identifier | "(" [target_list] ")" | "[" [target_list] "]" | attributeref | subscription | slicing | "*" target So that if we decide to disallow such things, we should change the definition in the language reference. I thought the code should be similar to the code added in issue34641. But maybe there is a way to simplify both code. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 01:22:41 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Sat, 10 Nov 2018 06:22:41 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541830961.06.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 01:45:35 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Nov 2018 06:45:35 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541832335.57.0.788709270274.issue35202@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 43a74abb3a87092a7fd6c71042eafb977d70d8e0 by Terry Jan Reedy (Srinivas Thatiparthy (?????????? ?????????)) in branch 'master': bpo-35202: Remove unused imports in idlelib (GH-10438) https://github.com/python/cpython/commit/43a74abb3a87092a7fd6c71042eafb977d70d8e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 01:45:50 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Nov 2018 06:45:50 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541832350.14.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 01:46:00 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Nov 2018 06:46:00 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541832360.59.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 02:06:27 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Nov 2018 07:06:27 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541833587.52.0.788709270274.issue35202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2847ccae4687cb43334d87d86fb6c11cb14218f5 by Miss Islington (bot) in branch '3.7': bpo-35202: Remove unused imports in idlelib (GH-10438) https://github.com/python/cpython/commit/2847ccae4687cb43334d87d86fb6c11cb14218f5 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 02:08:08 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Nov 2018 07:08:08 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541833688.23.0.788709270274.issue35202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2903b0fd38a65e16ddafae7754ed5d605fea68ff by Miss Islington (bot) in branch '3.6': bpo-35202: Remove unused imports in idlelib (GH-10438) https://github.com/python/cpython/commit/2903b0fd38a65e16ddafae7754ed5d605fea68ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 02:18:21 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 07:18:21 +0000 Subject: [issue35208] IDLE: Squeezed lines count ignores window width Message-ID: <1541834301.3.0.788709270274.issue35208@psf.upfronthosting.co.za> New submission from Tal Einat : Squeezing a single long line with a newline, e.g. 'a'*200, results in "Squeezed text (1 lines)". Also, changing the width of the window (even to very small widths) doesn't affect the number of lines reported when squeezing (when squeezing *after* the width change). ---------- assignee: terry.reedy components: IDLE messages: 329600 nosy: taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE: Squeezed lines count ignores window width type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 02:34:41 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 07:34:41 +0000 Subject: [issue35208] IDLE: Squeezed lines count ignores window width In-Reply-To: <1541834301.3.0.788709270274.issue35208@psf.upfronthosting.co.za> Message-ID: <1541835281.01.0.788709270274.issue35208@psf.upfronthosting.co.za> Change by Tal Einat : ---------- keywords: +patch pull_requests: +9724 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 02:57:50 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 07:57:50 +0000 Subject: [issue35208] IDLE: Squeezed lines count ignores window width In-Reply-To: <1541834301.3.0.788709270274.issue35208@psf.upfronthosting.co.za> Message-ID: <1541836670.86.0.788709270274.issue35208@psf.upfronthosting.co.za> Tal Einat added the comment: See PR GH-10449 with a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 03:02:39 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Nov 2018 08:02:39 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541836959.54.0.788709270274.issue35202@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Srinivas, if you thing the issue is finished, please close it. Otherwise say something about what is left to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 03:10:40 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Sat, 10 Nov 2018 08:10:40 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541837440.25.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 03:20:08 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Sat, 10 Nov 2018 08:20:08 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1541838008.77.0.788709270274.issue35202@psf.upfronthosting.co.za> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: I have raised one more PR; I think i am done with this issue. People who are interested can take up from here. , For the record, following are some filters to search; Query to find unused imports ---------------------------------- find . -type f -name \*.py -print | xargs flake8 | grep F401 ---------------------------------- Search query ------------------------------------ grep -v warnings | grep -v "\.\*" | grep -v tkinter | grep -v sysconfig | grep -v readline | grep -v py3_test_grammar.py | grep -v java | grep -v rlcompleter | grep -v sitecustomize | grep -v __all__ | grep -v test_importlib | grep -v async | grep -v test_future | grep -v circular_import | grep -v dataclasses ------------------------------------ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 03:38:00 2018 From: report at bugs.python.org (James Crowther) Date: Sat, 10 Nov 2018 08:38:00 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1541839080.5.0.788709270274.issue35164@psf.upfronthosting.co.za> James Crowther added the comment: Hi guys, I am the OP for the stack overflow issue question that sparked this bug report. In response to Ned's question about configuration of the system: MacOS 10.14.1 Installed x-code and command line tools python versions used, varies, 3.5.3, 3.6 and 3.7.0 (sorry can't be more specific about 3.6 since I've used a lot. These python configurations have been both a bundled python env in blender, and also MacOS's native python 2.7. So far they've all had the same issue, that being; socket.gethostname() returns a value that seems to be set by the router/switch if scutil --set hostname somehostname has not been run. What Sorin mentioned on the stack overflow question that he didn't here (and I feel is important) is that ping and nslookup work with the expected hostname, i.e. the one the user can actually see by going to the system preferences and viewing it under the sharing section. Here it is called "Computer name", analogous to the same used on windows (which I might add has no such issues with hostnames being set to something other than the computer name unless a certain command is run). So the real issue for us, is how come ping and nslookup will work fine with the macOS "computer name" but the socket module uses something else, seemingly the hostname and computer name are not or loosely connected on macOS perhaps. Ideally what we need here is a way to ensure that the user can input the computer name of a target machine on another system and that system resolve the ip address for the target machine. We can't currently use socket.gethostname for this on mac since it seems to require that the scutil --set hostname command has been run. Otherwise the hostname that is returned doesn't work with socket.gethostbyname(hostname). Hope this helps, happy to clarify. J. ---------- nosy: +James Crowther _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 04:50:34 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 09:50:34 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1541843434.89.0.788709270274.issue10486@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 05:29:13 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 10:29:13 +0000 Subject: [issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly In-Reply-To: <1428931053.68.0.491418357539.issue23930@psf.upfronthosting.co.za> Message-ID: <1541845753.99.0.788709270274.issue23930@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 05:56:38 2018 From: report at bugs.python.org (remi bertholet) Date: Sat, 10 Nov 2018 10:56:38 +0000 Subject: [issue35209] Crash with tkinter text on osx Message-ID: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> New submission from remi bertholet : Hello, If I press the key "Alt-Shift-F" with script it crash all times. I reproduces the same crash with Python 2.7. To reproduce it, on terminal osx 10.13.6 (17G3025) : - run "python3 ScrollFrame.py" - Click one time on tk window (it show on foreground) - Press "Ctrl-Alt-F" (all other alt produce the same crash) - And you obtain the crash next : The crash on python 3.7 : 2018-11-10 11:50:30.702 Python[3095:292595] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString characterAtIndex:]: Range or index out of bounds' *** First throw call stack: ( 0 CoreFoundation 0x00007fff2b04123b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fff522d2c76 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2b0d2d5d +[NSException raise:format:] + 205 3 CoreFoundation 0x00007fff2afbd236 -[__NSCFString characterAtIndex:] + 102 4 Tk 0x00007fff37721343 TkpInitKeymapInfo + 731 5 Tk 0x00007fff377271a1 Tk_MacOSXSetupTkNotifier + 798 6 Tcl 0x00007fff37621a50 Tcl_DoOneEvent + 300 7 _tkinter.cpython-37m-darwin.so 0x000000010dd957ac _tkinter_tkapp_mainloop + 256 8 Python 0x000000010d3d4f42 _PyMethodDef_RawFastCallKeywords + 525 9 Python 0x000000010d3d981e _PyMethodDescr_FastCallKeywords + 82 10 Python 0x000000010d46b1a2 call_function + 615 11 Python 0x000000010d4622ec _PyEval_EvalFrameDefault + 2579 12 Python 0x000000010d46bad1 _PyEval_EvalCodeWithName + 1837 13 Python 0x000000010d3d4474 _PyFunction_FastCallKeywords + 225 14 Python 0x000000010d46b17a call_function + 575 15 Python 0x000000010d462305 _PyEval_EvalFrameDefault + 2604 16 Python 0x000000010d46bad1 _PyEval_EvalCodeWithName + 1837 17 Python 0x000000010d461851 PyEval_EvalCode + 42 18 Python 0x000000010d490a5f run_mod + 54 19 Python 0x000000010d48fa7a PyRun_FileExFlags + 164 20 Python 0x000000010d48f159 PyRun_SimpleFileExFlags + 283 21 Python 0x000000010d4a6842 pymain_main + 5114 22 Python 0x000000010d4a6fd4 _Py_UnixMain + 104 23 libdyld.dylib 0x00007fff52eec015 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6 The crash on python 2.7 : 2018-11-10 11:51:34.728 Python[3104:294757] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString characterAtIndex:]: Range or index out of bounds' *** First throw call stack: ( 0 CoreFoundation 0x00007fff2b04123b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fff522d2c76 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2b0d2d5d +[NSException raise:format:] + 205 3 CoreFoundation 0x00007fff2afbd236 -[__NSCFString characterAtIndex:] + 102 4 Tk 0x00007fff37721343 TkpInitKeymapInfo + 731 5 Tk 0x00007fff377271a1 Tk_MacOSXSetupTkNotifier + 798 6 Tcl 0x00007fff37621a50 Tcl_DoOneEvent + 300 7 _tkinter.so 0x00000001026cca77 Tkapp_MainLoop + 354 8 Python 0x000000010236a357 PyEval_EvalFrameEx + 19822 9 Python 0x00000001023653d2 PyEval_EvalCodeEx + 1562 10 Python 0x000000010236e4d7 fast_function + 290 11 Python 0x000000010236a25a PyEval_EvalFrameEx + 19569 12 Python 0x00000001023653d2 PyEval_EvalCodeEx + 1562 13 Python 0x0000000102364db2 PyEval_EvalCode + 32 14 Python 0x000000010238679b run_mod + 49 15 Python 0x0000000102386842 PyRun_FileExFlags + 130 16 Python 0x00000001023863c4 PyRun_SimpleFileExFlags + 706 17 Python 0x0000000102397f44 Py_Main + 3136 18 libdyld.dylib 0x00007fff52eec015 start + 1 19 ??? 0x0000000000000002 0x0 + 2 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6 ---------- components: Tkinter files: ScrollFrame.py messages: 329606 nosy: remi_bertholet priority: normal severity: normal status: open title: Crash with tkinter text on osx versions: Python 3.7 Added file: https://bugs.python.org/file47918/ScrollFrame.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 06:32:19 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 11:32:19 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541849539.28.0.788709270274.issue35209@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 07:50:07 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 10 Nov 2018 12:50:07 +0000 Subject: [issue33944] Deprecate and remove pth files In-Reply-To: <1529688140.44.0.56676864532.issue33944@psf.upfronthosting.co.za> Message-ID: <1541854207.44.0.788709270274.issue33944@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: @barry > Interdependent namespace packages. If they get loaded in the wrong order, they can mess up __path__ settings Actually, when writing the PR, I had a revelation how this could be implemented. Via an import hook that would work like a union FS! In its .pth file, each such package will import the hook's module (which will cause the hook to be installed on the first import) and "register" its namespaces and/or dependencies with it. The hook will then calculate the required load order and enforce it upon import of any of the registered namespaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 08:19:14 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Sat, 10 Nov 2018 13:19:14 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541855954.5.0.788709270274.issue35081@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: Victor, you moved declarations of some functions to other headers, but didn't include the new headers into files that implement the functions in some cases. For example, _PyGILState_Init was moved into Include/internal/pycore_lifecycle.h in a1c249c40517917d2e0971d55aea8d14a44b2cc8, but it's implemented in Python/pystate.c, which doesn't include the new header. This may lead to subtle problems because the compiler can't check that signatures of the declaration and the implementation match. I suggest to use -Wmissing-prototypes and -Wmissing-declarations to detect such situations: ../../cpython/Python/pystate.c: At top level: ../../cpython/Python/pystate.c:968:1: warning: no previous prototype for ?_PyGILState_Init? [-Wmissing-prototypes] _PyGILState_Init(PyInterpreterState *i, PyThreadState *t) ^~~~~~~~~~~~~~~~ ../../cpython/Python/pystate.c:988:1: warning: no previous prototype for ?_PyGILState_Fini? [-Wmissing-prototypes] _PyGILState_Fini(void) ^~~~~~~~~~~~~~~~ Sadly, there are many other similar issues in Python now, but you can at least compare the number of warnings before and after your changes. ---------- nosy: +izbyshev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:26:06 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 14:26:06 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541859966.95.0.788709270274.issue35209@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. I added Ned since it seemed similar to issue32481 but from Python 3.7 the Mac installers from python.org ship with in-built Tcl/Tk 8.6.8 as in which was the reported version https://www.python.org/download/mac/tcltk/#built-in-8-6-8 . I was able to reproduce the crash with attached file on 3.6 which was installed from Homebrew. I was not able to reproduce the crash on Python 3.7.1RC2 installed from python.org. I don't know if installing 3.7 from Homebrew might cause problems with my existing virtual environments to validate my assumption. 1. @remi_bertholet Is Python 3.7 installed with Homebrew? 2. Ned, does Python 3.7 that is installed from Homebrew ship with in-built Tcl/Tk similar to Mac installers from python.org? ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:34:52 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 10 Nov 2018 14:34:52 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541860492.79.0.788709270274.issue35190@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: The separation may look arbitrary, but the idea is quite simple. Only those classes with few methods support structural checks. Those classes have few independent abstract methods (or even just one method), while in classes with large APIs like `Sequence`, the methods are not logically independent, so you can't say a class is 100% a `Sequence` even if types/signatures of all methods are correct, because e.g. `__contains__()` and `index()` should behave in agreement with `__getitem__()`. We might explicitly document which ABCs support structural checks, and which require explicit subclassing. Also we might clarify what "abstract methods" and "mixin methods" mean in the table at the top. In the case of `Sequence` one can just implement two abstract methods and the other will behave in a "coordinated way". Then, simple purely abstract classes (called "One-trick ponies" in the source code) support structural checks. > The collections.abc ? Abstract Base Classes for Containers documentation says: >> This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping. Btw, Mapping also doesn't support structural checks, so the docs are quite outdated. ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:42:30 2018 From: report at bugs.python.org (remi bertholet) Date: Sat, 10 Nov 2018 14:42:30 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541859966.95.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: remi bertholet added the comment: Yes I use homebrew. I have done : brew update brew upgrade python 3.7.1 installed : Python 3.7.1 (default, Nov 6 2018, 18:45:35) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. but I still have the crash with this version : 2018-11-10 15:37:54.784 Python[35388:488345] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString characterAtIndex:]: Range or index out of bounds' *** First throw call stack: ( 0 CoreFoundation 0x00007fff2b04123b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fff522d2c76 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2b0d2d5d +[NSException raise:format:] + 205 3 CoreFoundation 0x00007fff2afbd236 -[__NSCFString characterAtIndex:] + 102 4 Tk 0x00007fff37721343 TkpInitKeymapInfo + 731 5 Tk 0x00007fff377271a1 Tk_MacOSXSetupTkNotifier + 798 6 Tcl 0x00007fff37621a50 Tcl_DoOneEvent + 300 7 _tkinter.cpython-37m-darwin.so 0x0000000106b877ab _tkinter_tkapp_mainloop + 256 8 Python 0x00000001061e3313 _PyMethodDef_RawFastCallKeywords + 496 9 Python 0x00000001061e7caa _PyMethodDescr_FastCallKeywords + 82 10 Python 0x0000000106278bd0 call_function + 801 11 Python 0x0000000106271758 _PyEval_EvalFrameDefault + 6991 12 Python 0x0000000106279432 _PyEval_EvalCodeWithName + 1835 13 Python 0x00000001061e2874 _PyFunction_FastCallKeywords + 225 14 Python 0x0000000106278ba0 call_function + 753 15 Python 0x0000000106271771 _PyEval_EvalFrameDefault + 7016 16 Python 0x0000000106279432 _PyEval_EvalCodeWithName + 1835 17 Python 0x000000010626fb81 PyEval_EvalCode + 42 18 Python 0x000000010629e6ed run_mod + 54 19 Python 0x000000010629d708 PyRun_FileExFlags + 164 20 Python 0x000000010629cdc2 PyRun_SimpleFileExFlags + 266 21 Python 0x00000001062b4adc pymain_main + 5665 22 Python 0x00000001062b50ff _Py_UnixMain + 75 23 libdyld.dylib 0x00007fff52eec015 start + 1 24 ??? 0x0000000000000002 0x0 + 2 ) libc++abi.dylib: terminating with uncaught exception of type NSException > Le 10 nov. 2018 ? 15:26, Karthikeyan Singaravelan a ?crit : > > > Karthikeyan Singaravelan added the comment: > > Thanks for the report. I added Ned since it seemed similar to issue32481 but from Python 3.7 the Mac installers from python.org ship with in-built Tcl/Tk 8.6.8 as in which was the reported version https://www.python.org/download/mac/tcltk/#built-in-8-6-8 . I was able to reproduce the crash with attached file on 3.6 which was installed from Homebrew. I was not able to reproduce the crash on Python 3.7.1RC2 installed from python.org. I don't know if installing 3.7 from Homebrew might cause problems with my existing virtual environments to validate my assumption. > > 1. @remi_bertholet Is Python 3.7 installed with Homebrew? > 2. Ned, does Python 3.7 that is installed from Homebrew ship with in-built Tcl/Tk similar to Mac installers from python.org? > > ---------- > nosy: +xtreak > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:46:27 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 14:46:27 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541861187.84.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: Hi, this broke my tests, just as earlier comments predicted. Can we get an optional argument to sort the keys? The json module lets us sort keys even though it's irrelevant to JSON. Being able to sort attributes would be a very useful addition to the prettyxml method. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:46:48 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 14:46:48 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541861208.23.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: (sorry, to sort the attributes.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:53:27 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 14:53:27 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541861607.48.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: To provide a little more context: coverage.py has tests that the XML reports it generates are correct. It does this by comparing the result to saved XML files. On Python versions up to 3.7, the file compares correctly. It has sorted attributes generated by minidom. Now on Python 3.8, the comparison fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:54:48 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 14:54:48 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541861688.71.0.788709270274.issue35209@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks, can you please try the mac installer from python.org to see if the crash is till present : https://www.python.org/downloads/release/python-371/ Please remove the original email content while replying from email unless the relevant parts need to be quoted. The content is added to the tracker making the reply hard to read. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 09:54:57 2018 From: report at bugs.python.org (Diego Rojas) Date: Sat, 10 Nov 2018 14:54:57 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541861697.39.0.788709270274.issue34160@psf.upfronthosting.co.za> Diego Rojas added the comment: Ned, exactly what test fails? I ran all the test suite in local and all was ok, even all passed in the CI build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:01:00 2018 From: report at bugs.python.org (remi bertholet) Date: Sat, 10 Nov 2018 15:01:00 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541861688.71.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <87EAA9C5-47B6-49B1-98EB-775A8DADD116@yahoo.fr> remi bertholet added the comment: with the python installer I do not have the problem... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:02:34 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 15:02:34 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541862154.86.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: Diego, they are my tests in the coverage.py test suite. I'm checking that my XML generating code is producing the right XML. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:04:56 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 15:04:56 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541862296.24.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: This is exactly the situation Stefan was talking about: "However, I still think that Serhiy is right: this change would break code, and in particular test code that compares XML output. Having to deal with two different "correct" serialisations in tests depending on the Python version is annoying at best." He says comparison should be done with true canonicalization (C14N). Does that exist in the standard library? With sorted keys, we had a form of good-enough canonicalization. Now we don't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:05:14 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 15:05:14 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541862314.57.0.788709270274.issue35209@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks a lot remi_bertholet. I think this is related to issue32481 . I will wait for Ned's confirmation on how Homebrew packages Python 3.7 with Tcl/Tk and if it's different from python.org Mac installers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:27:32 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sat, 10 Nov 2018 15:27:32 +0000 Subject: [issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly In-Reply-To: <1428931053.68.0.491418357539.issue23930@psf.upfronthosting.co.za> Message-ID: <1541863652.95.0.788709270274.issue23930@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: This is not a valid cookie string and I think neither Django nor Nginx would understand this cookie correctly. On the other hand, per RFC 6265 the comma is a forbidden character in a cookie value (https://tools.ietf.org/html/rfc6265#section-4.1.1): cookie-pair = cookie-name "=" cookie-value cookie-name = token cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; US-ASCII characters excluding CTLs, ; whitespace DQUOTE, comma, semicolon, ; and backslash so there is no official way to parse the given string (when a comma is present in the value, the cookie should be encoded as base 64). Since this is not a valid cookie string anyway, I think the solution proposed by Kyle is appropriate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:41:08 2018 From: report at bugs.python.org (Michael Felt) Date: Sat, 10 Nov 2018 15:41:08 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541864468.53.0.788709270274.issue35198@psf.upfronthosting.co.za> Michael Felt added the comment: There are, perhaps, other issues as well. After a build of "master" a) pip3 install pandas - failed to find/download and build numpy - after "manual" pip3 install numpy and got to " six, python-dateutil, pytz, pandas" Then: Running setup.py install for pandas ... error Complete output from command /opt/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-f5rvzoc0/pandas/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-kmi2p9sd/install-record.txt --single-version-externally-managed --compile: ... UPDATING build/lib.aix-6.1-3.8-pydebug/pandas/_version.py set build/lib.aix-6.1-3.8-pydebug/pandas/_version.py to '0.23.4' running build_ext building 'pandas._libs.algos' extension creating build/temp.aix-6.1-3.8-pydebug creating build/temp.aix-6.1-3.8-pydebug/pandas creating build/temp.aix-6.1-3.8-pydebug/pandas/_libs xlc_r -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/opt/lib/python3.8/site-packages/numpy/core/include -I/opt/include/python3.8dm -c pandas/_libs/algos.c -o build/temp.aix-6.1-3.8-pydebug/pandas/_libs/algos.o -Wno-unused-function xlc_r: 1501-210 (S) command option Wno-unused-function contains an incorrect subargument error: command 'xlc_r' failed with exit status 40 ---------------------------------------- Command "/opt/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-f5rvzoc0/pandas/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-kmi2p9sd/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-f5rvzoc0/pandas/ So, it looks like, using xlc - I may not have even gotten as far window.gcc due to issues in pandas (the incorrect flag -Wno-used-function - have to find where that came from!) ---------- Added file: https://bugs.python.org/file47919/pip3_build_pandas_0001.text _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 10:43:37 2018 From: report at bugs.python.org (Niklas Sombert) Date: Sat, 10 Nov 2018 15:43:37 +0000 Subject: [issue34628] urllib.request.urlopen fails when userinfo is present in URL In-Reply-To: <1536683596.21.0.0269046726804.issue34628@psf.upfronthosting.co.za> Message-ID: <1541864617.45.0.788709270274.issue34628@psf.upfronthosting.co.za> Niklas Sombert added the comment: This behaviour would be better than the current one, yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:05:07 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 16:05:07 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541865907.36.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I'm checking that my XML generating code is producing the right XML. ISTM that the coverage tests as currently written aren't good tests. Why not update the tests to check the generated XML is what the code asked it to generate? Otherwise, the tests are relying on a non-guaranteed implementation detail. Alternatively, use c14n.Canonicalize[1] which implements standard compliant cross-language canonicalization (as opposed to non-guaranteed ad-hoc comparison which just happens to work). [1] https://www.ibm.com/developerworks/xml/library/x-c14n/ Note with attribute order preservation, code now has the ability to produce exactly the XML it wants to produce. The explicit intention of the user is honored. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:17:23 2018 From: report at bugs.python.org (Michael Felt) Date: Sat, 10 Nov 2018 16:17:23 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541866643.34.0.788709270274.issue35198@psf.upfronthosting.co.za> Michael Felt added the comment: Getting farther - after "hacking" pandas setup.py to not force a gcc flag. Still not getting as far, I think, as the initial poster. ... /opt/include/python3.8dm -c pandas/_libs/parsers.c -o build/temp.aix-6.1-3.8-pydebug/pandas/_libs/parsers.o xlc_r -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/opt/lib/python3.8/site-packages/numpy/core/include -I/opt/include/python3.8dm -c pandas/_libs/src/parser/tokenizer.c -o build/temp.aix-6.1-3.8-pydebug/pandas/_libs/src/parser/tokenizer.o "/opt/include/python3.8dm/pyconfig.h", line 1538.9: 1506-236 (W) Macro name _POSIX_C_SOURCE has been redefined. "/opt/include/python3.8dm/pyconfig.h", line 1538.9: 1506-358 (I) "_POSIX_C_SOURCE" is defined on line 160 of /usr/include/standards.h. "/opt/include/python3.8dm/pyconfig.h", line 1553.9: 1506-236 (W) Macro name _XOPEN_SOURCE has been redefined. "/opt/include/python3.8dm/pyconfig.h", line 1553.9: 1506-358 (I) "_XOPEN_SOURCE" is defined on line 156 of /usr/include/standards.h. "/usr/include/unistd.h", line 171.17: 1506-343 (S) Redeclaration of lseek64 differs from previous declaration on line 169 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 171.17: 1506-050 (I) Return type "long long" in redeclaration is not compatible with the previous return type "long". "/usr/include/unistd.h", line 171.17: 1506-377 (I) The type "long long" of parameter 2 differs from the previous type "long". "/usr/include/sys/lockf.h", line 64.20: 1506-343 (S) Redeclaration of lockf64 differs from previous declaration on line 62 of "/usr/include/sys/lockf.h". "/usr/include/sys/lockf.h", line 64.20: 1506-377 (I) The type "long long" of parameter 3 differs from the previous type "long". "/usr/include/unistd.h", line 809.33: 1506-343 (S) Redeclaration of ftruncate64 differs from previous declaration on line 807 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 809.33: 1506-377 (I) The type "long long" of parameter 2 differs from the previous type "long". "/usr/include/unistd.h", line 845.33: 1506-343 (S) Redeclaration of truncate64 differs from previous declaration on line 843 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 845.33: 1506-377 (I) The type "long long" of parameter 2 differs from the previous type "long". "/usr/include/unistd.h", line 862.33: 1506-343 (S) Redeclaration of pread64 differs from previous declaration on line 859 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 862.33: 1506-377 (I) The type "long long" of parameter 4 differs from the previous type "long". "/usr/include/unistd.h", line 863.33: 1506-343 (S) Redeclaration of pwrite64 differs from previous declaration on line 860 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 863.33: 1506-377 (I) The type "long long" of parameter 4 differs from the previous type "long". "/usr/include/unistd.h", line 942.25: 1506-343 (S) Redeclaration of fclear64 differs from previous declaration on line 939 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 942.25: 1506-050 (I) Return type "long long" in redeclaration is not compatible with the previous return type "long". "/usr/include/unistd.h", line 942.25: 1506-377 (I) The type "long long" of parameter 2 differs from the previous type "long". "/usr/include/unistd.h", line 943.25: 1506-343 (S) Redeclaration of fsync_range64 differs from previous declaration on line 940 of "/usr/include/unistd.h". "/usr/include/unistd.h", line 943.25: 1506-377 (I) The type "long long" of parameter 3 differs from the previous type "long". "pandas/_libs/src/parser/tokenizer.c", line 265.40: 1506-280 (W) Function argument assignment between types "long long*" and "unsigned long*" is not allowed. "pandas/_libs/src/parser/tokenizer.c", line 292.30: 1506-280 (W) Function argument assignment between types "long long*" and "unsigned long*" is not allowed. "pandas/_libs/src/parser/tokenizer.c", line 323.28: 1506-280 (W) Function argument assignment between types "long long*" and "unsigned long*" is not allowed. error: command 'xlc_r' failed with exit status 1 root at x066:[/data/prj/python/pandas-0.23.4]set | grep OBJ root at x066:[/data/prj/python/pandas-0.23.4]python3 Python 3.8.0a0 (heads/master-dirty:b9498e2367, Nov 10 2018, 13:51:41) [C] on aix6 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize() Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not callable >>> sys.maxsize 2147483647 +++++ Will uninstall and build a 64-bit python3 and see if that helps. +++++ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:17:42 2018 From: report at bugs.python.org (Michael Felt) Date: Sat, 10 Nov 2018 16:17:42 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541866662.63.0.788709270274.issue35198@psf.upfronthosting.co.za> Change by Michael Felt : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:18:07 2018 From: report at bugs.python.org (Thomas Viehmann) Date: Sat, 10 Nov 2018 16:18:07 +0000 Subject: [issue33826] enable discovery of class source code in IPython interactively defined classes In-Reply-To: <1528697796.87.0.592728768989.issue33826@psf.upfronthosting.co.za> Message-ID: <1541866687.84.0.788709270274.issue33826@psf.upfronthosting.co.za> Change by Thomas Viehmann : ---------- resolution: duplicate -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:24:57 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 16:24:57 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541867097.09.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: I can see that there are ways that I can change my tests. I see that there are third-party libraries that can help me with this. But changing the behavior of the standard library, without a way to retain the old behavior, and asking people to adapt by changing their test suites, seems a bit cavalier. Why not add an option to keep the sorting that the standard library has always had? I'll even be OK with changing the default behavior to unsorted, just give me a way to explicitly keep the behavior its always had in the past. The discussion so far has 1) hypothesized that test suites would be broken, and 2) claimed that no one needs the output in sorted order. I can tell you that my test suite is broken, and that removing the sorted order is what broke it. The json module has the option to sort keys. toprettyxml already has options well outside the needs of XML semantics (indent and newl). Let's honor Python's tradition of standard library stability, and give me a way to keep the behavior I used to have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 11:29:23 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 16:29:23 +0000 Subject: [issue33826] enable discovery of class source code in IPython interactively defined classes In-Reply-To: <1528697796.87.0.592728768989.issue33826@psf.upfronthosting.co.za> Message-ID: <1541867363.6.0.788709270274.issue33826@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:12:52 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 17:12:52 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541869972.04.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I can see that there are ways that I can change my tests. > I see that there are third-party libraries that can help me with this. Please do that. That is good design and uses all the tools the way they are meant to be used. > But changing the behavior of the standard library, without a > way to retain the old behavior, and asking people to adapt > by changing their test suites, seems a bit cavalier. Several thoughts: * We are not cavalier. We generally work very hard to preserve guaranteed behaviors. For example, see all the work done on version numbering random seeding or pickle versions. That said, we cannot be handcuffed by over-reliance on implementation details; otherwise, we wound never be able to improve the library. The whole point of encapsulation and abstraction is to provide freedom to improve the internals and add capabilities without breaking the API contract. * It is reasonable for folks to change tests which were flawed from the outset (just like when hash randomization was introduced, it scrambled key order and broke any tests that relied on key order). FWIW, we remove or fix fragile or ill conceived tests in our own test suite all the time. * We could add an option to sort attributes but this just clutters the API and turns an old quirk into a permanent fixture. Instead, I recommend adding a documentation link to a standards compliant canonicalization tool. > Let's honor Python's tradition of standard library stability, > and give me a way to keep the behavior I used to have. The library IS stable with respect to documented guaranteed behaviors. With respect to everything else, our tradition is make improvements where we can. We don't backport these changes so that mirco-releases retain their quirks. But point releases are allowed and encouraged to make improvements (i.e. this is for 3.8 and later). In this case, there was never an API contract to sort attributes. In a way, this is no different than when we improve a repr (see match objects for example). That would break tests that incorrectly relied on an exact output match. When a test stops matching what a tool does, the one that is incorrect is the one that should be changed. If there is an API contract, the tool needs to change to match. However, if the test is fundamentally flawed, it should be one to change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:15:29 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 10 Nov 2018 17:15:29 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541870129.53.0.788709270274.issue35209@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the report and for the investigation. The Tk crash described in Issue32481 (and many other earlier issues) is due to a very old bug in Tk 8.5.x for macOS. While this bug has been fixed in more recent versions of 8.5.x and in 8.6.x, the version of Tk shipped by Apple with macOS has not been updated since Mac OS X 10.7 (!) and so apps that use it will see this crash. Which Tk a particular instance of Python tkinter will link with depends on how that Python was built. In general, there are ways to check which one is in use. The easiest is, when the app is running, go to the macOS menu bar, select the app name (the second menu row which, for standalone Python scripts will likely be labeled "Python"), then choose the first menu item under it, the "About " item. Unless the app itself has defined its own About menu (like IDLE.app does) that should bring up a Tk app window that says what version of Tk is running. (The IDLE.app About window also says what version of Tk is in use.) If the version is 8.5.9, the app is most likely using the buggy system Tk. It's also possible for the Python program to get the Tk version in-use at runtime; see tkVersionWarning in IDLE for an example: https://github.com/python/cpython/blob/v3.7.1/Lib/idlelib/macosx.py#L69 An even more definite confirmation is to examine the macOS crash report produced (either on screen or saved at ~/Library/Logs/DiagnosticReports and browsable with Console.app). Search the Binary Images section for the specific Tk file name in use. If the line found has Tk (8.5.9 - 8.5.9) and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk in it, you know that the culprit is the Apple-supplied Tk. If the file name is something else, like /Library/Frameworks/Tk.framework/Versions/8.5/Tk, then the system Tk is not to blame. There is more info here: https://www.python.org/download/mac/tcltk/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:23:52 2018 From: report at bugs.python.org (tzickel) Date: Sat, 10 Nov 2018 17:23:52 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read Message-ID: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> New submission from tzickel : There was a TODO in the code about this: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/_io/iobase.c#L909 ---------- components: IO messages: 329629 nosy: tzickel priority: normal severity: normal status: open title: Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:27:23 2018 From: report at bugs.python.org (tzickel) Date: Sat, 10 Nov 2018 17:27:23 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541870843.98.0.788709270274.issue35210@psf.upfronthosting.co.za> Change by tzickel : ---------- keywords: +patch pull_requests: +9726 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:30:15 2018 From: report at bugs.python.org (tzickel) Date: Sat, 10 Nov 2018 17:30:15 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541871015.55.0.788709270274.issue35210@psf.upfronthosting.co.za> Change by tzickel : ---------- nosy: +benjamin.peterson, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:36:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 17:36:38 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541871398.59.0.788709270274.issue35210@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What if readinto() save a reference to its argument? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:43:34 2018 From: report at bugs.python.org (tzickel) Date: Sat, 10 Nov 2018 17:43:34 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541871814.68.0.788709270274.issue35210@psf.upfronthosting.co.za> tzickel added the comment: How is that different from the situation today ? The bytearray passed to readinto() is deleted before the function ends. This revision simply changes 2 mallocs and a memcpy to 1 malloc and a potential realloc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 12:58:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 17:58:37 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541872717.88.0.788709270274.issue35210@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: When you remove the original reference, the second reference keeps the bytearray object live. When you remove or just resize the bytes object, the memoryview object becomes referring to freed memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:20:17 2018 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 10 Nov 2018 18:20:17 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541874017.7.0.788709270274.issue34160@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: > ISTM that the coverage tests as currently written aren't good tests. Hi, I'd like to remind everyone to be open, respectful, and considerate. There are ways to describe hos things that can be improved. There is no need to denigrate other people's work. ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:26:45 2018 From: report at bugs.python.org (Johan Dahlin) Date: Sat, 10 Nov 2018 18:26:45 +0000 Subject: [issue33608] [subinterpreters] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1541874405.53.0.788709270274.issue33608@psf.upfronthosting.co.za> Change by Johan Dahlin : ---------- nosy: +Johan Dahlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:30:08 2018 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 10 Nov 2018 18:30:08 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541874608.92.0.788709270274.issue34160@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: IMO adding optional keyword argument to make it compatible with previous version is reasonable request, and it seems early on several other core devs also agree with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:37:10 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 18:37:10 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541875030.66.0.788709270274.issue34160@psf.upfronthosting.co.za> Tal Einat added the comment: >> ISTM that the coverage tests as currently written aren't good tests. > Hi, I'd like to remind everyone to be open, respectful, and considerate. There are ways to describe hos things that can be improved. There is no need to denigrate other people's work. I find this to be an overreaction in this case. Sure, it could have been worded more positively, but the negativity was very mild; the tests weren't even being called "bad", not to mention overly negative wording e.g. "horrible". Further, you omitted the followup explanation of *what about the tests isn't good*: > Otherwise, the tests are relying on a non-guaranteed implementation detail. IMO we shouldn't require ourselves to be overly careful in our wording, such as avoiding any negative wording entirely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:46:40 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 10 Nov 2018 18:46:40 +0000 Subject: [issue28054] Diff for visually comparing actual with expected in mock.assert_called_with. In-Reply-To: <1473461073.51.0.19108692382.issue28054@psf.upfronthosting.co.za> Message-ID: <1541875600.05.0.788709270274.issue28054@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think this can be useful for keyword arguments as in the original suggestion. I tried an initial implementation as below to use difflib to get the difference like unittest if there are keyword args to be checked against the caller list since the absence of one or other generates a diff with empty {} which I find little distracting during my initial iterations. I would like to know if there is still sufficient interest in getting this to core only for keyword arguments given that there is pytest-mock with specialized error reporting handling more cases : https://github.com/pytest-dev/pytest-mock#improved-reporting-of-mock-call-assertion-errors $ ./python.exe -q >>> from unittest.mock import Mock >>> m = Mock() >>> >>> m(foo='bar', bar='baz') >>> >>> m.assert_called_with(bar='baz', foo='car') Traceback (most recent call last): File "", line 1, in File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 838, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: Expected call: mock(bar='baz', foo='car') Actual call: mock(bar='baz', foo='bar') - {'bar': 'baz', 'foo': 'car'} ? ^ + {'bar': 'baz', 'foo': 'bar'} ? ^ diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a9c82dcb5d..8603b4ac4c 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -749,6 +749,20 @@ class NonCallableMock(Base): call_args = self.call_args if len(call_args) == 3: call_args = call_args[1:] + + diffMsg = '' + if kwargs and self.call_args[1]: + import difflib + + seq1 = kwargs + seq2 = self.call_args[1] + diffMsg = '\n' + '\n'.join( + difflib.ndiff(pprint.pformat(seq1).splitlines(), + pprint.pformat(seq2).splitlines())) + + if diffMsg: + message += diffMsg + actual_string = self._format_mock_call_signature(*call_args) return message % (expected_string, actual_string) ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 13:51:35 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 10 Nov 2018 18:51:35 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541875895.92.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: Words like flawed from the outset, fundamentally flawed, fragile, and ill-conceived are being thrown around, which does not help the discussion. Can we focus on the question of whether it's reasonable to add sorted attributes as an option? This idea exactly parallels the sort_keys option in the json module. It precisely solves the problem I have. The code change is small. I'll even volunteer to make the pull request. I'm not suggesting that we get rid of the new feature of preserving the user's attributes order. I'm not even suggesting that the new feature needs to be the non-default option. I'd just like a way to sort attributes in XML output. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 14:22:10 2018 From: report at bugs.python.org (tzickel) Date: Sat, 10 Nov 2018 19:22:10 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541877730.25.0.788709270274.issue35210@psf.upfronthosting.co.za> tzickel added the comment: I think that if someone tries that this code will raise an exception at the resize part (since the reference will be higher than one), a check can be added and in this case fallback to the previous behaviour, If it's a required check, I can add it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 14:32:16 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 19:32:16 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541878336.06.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Being able to sort attributes would be a very useful addition > to the prettyxml method. +1 This seems reasonable to me. I misread it and thought it was much broader than prettyxml(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 14:39:52 2018 From: report at bugs.python.org (bob moth) Date: Sat, 10 Nov 2018 19:39:52 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) Message-ID: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> New submission from bob moth : Running life.py from the Free Python Games requires alt-Q twice, and the GUI keeps running after System.exit. Running life2.py, (which is my clone, and I will happily share it if you want a great stress tester that gobbles 100% of a CPU core for as long as you want,) doesn't respond to alt-Q and requires a force quit. ---------- components: Tkinter, macOS files: turtle shutdown problem.txt messages: 329640 nosy: bmoth, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Turtle Shutdown Problem(s) type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47920/turtle shutdown problem.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 14:49:01 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 10 Nov 2018 19:49:01 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541879341.67.0.788709270274.issue35211@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +gregorlingl, willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:02:15 2018 From: report at bugs.python.org (Dragoljub) Date: Sat, 10 Nov 2018 20:02:15 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1541880135.8.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: @cgohlke compared the statement df2 = pd.read_csv(csv) on Python 3.7.0a3 and a4 in the Visual Studio profiler. The culprit is the isdigit function called in the parsers extension module. On 3.7.0a3 the function is fast at ~8% of samples. On 3.7.0a4 the function is slow at ~64% samples because it calls the _isdigit_l function, which seems to update and restore the locale in the current thread every time... 3.7.0a3: Function Name Inclusive Samples Exclusive Samples Inclusive Samples % Exclusive Samples % Module Name + [parsers.cp37-win_amd64.pyd] 705 347 28.52% 14.04% parsers.cp37-win_amd64.pyd isdigit 207 207 8.37% 8.37% ucrtbase.dll - _errno 105 39 4.25% 1.58% ucrtbase.dll toupper 24 24 0.97% 0.97% ucrtbase.dll isspace 21 21 0.85% 0.85% ucrtbase.dll [python37.dll] 1 1 0.04% 0.04% python37.dll 3.7.0a4: Function Name Inclusive Samples Exclusive Samples Inclusive Samples % Exclusive Samples % Module Name + [parsers.cp37-win_amd64.pyd] 8,613 478 83.04% 4.61% parsers.cp37-win_amd64.pyd + isdigit 6,642 208 64.04% 2.01% ucrtbase.dll + _isdigit_l 6,434 245 62.03% 2.36% ucrtbase.dll + _LocaleUpdate::_LocaleUpdate 5,806 947 55.98% 9.13% ucrtbase.dll + __acrt_getptd 2,121 1,031 20.45% 9.94% ucrtbase.dll FlsGetValue 647 647 6.24% 6.24% KernelBase.dll - RtlSetLastWin32Error 296 235 2.85% 2.27% ntdll.dll _guard_dispatch_icall_nop 101 101 0.97% 0.97% ucrtbase.dll GetLastError 46 46 0.44% 0.44% KernelBase.dll + __acrt_update_multibyte_info 1,475 246 14.22% 2.37% ucrtbase.dll - __crt_state_management::get_current_state_index 1,229 513 11.85% 4.95% ucrtbase.dll + __acrt_update_locale_info 1,263 235 12.18% 2.27% ucrtbase.dll - __crt_state_management::get_current_state_index 1,028 429 9.91% 4.14% ucrtbase.dll _ischartype_l 383 383 3.69% 3.69% ucrtbase.dll ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:07:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 20:07:36 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541880456.02.0.788709270274.issue34160@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:13:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 20:13:38 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541880818.87.0.788709270274.issue34160@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Raymond's words convinced me, but if it is needed for preserving compatibility in tests, here is PR 10452 which adds support for the sort_attrs argument in XML serializing methods. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:42:00 2018 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Nov 2018 20:42:00 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1541882520.69.0.788709270274.issue21622@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9728 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:47:03 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 20:47:03 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541882823.03.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One other thought: We should add a note to the docs for all of the serialization formats saying that we specifically disclaim that they will always generate exactly the same output byte-for-byte. When Serhiy made some small optimizations to the encoding of pickles, it would have broken any test that checked byte-level equality rather than semantic level equality (checked by making sure the pickle/unpickle steps would round-trip without loss of information). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 15:56:35 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Nov 2018 20:56:35 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541829865.75.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Hm, I was thinking of https://github.com/python/cpython/pull/9212/, but that's about keyword arg (where the interpreter incorrectly allowed f((kw)=expr). But on thinking about it more I believe we should allow (a) = (b), so there is no code change required. Sorry for the false alarm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 16:33:11 2018 From: report at bugs.python.org (Pierre Quentel) Date: Sat, 10 Nov 2018 21:33:11 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1541885591.92.0.788709270274.issue10486@psf.upfronthosting.co.za> Change by Pierre Quentel : ---------- nosy: +quentel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 16:44:00 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 21:44:00 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541886240.81.0.788709270274.issue35196@psf.upfronthosting.co.za> Change by Tal Einat : ---------- keywords: +patch pull_requests: +9729 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 16:52:29 2018 From: report at bugs.python.org (Javier Castillo II) Date: Sat, 10 Nov 2018 21:52:29 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1541886749.32.0.788709270274.issue21622@psf.upfronthosting.co.za> Change by Javier Castillo II : ---------- pull_requests: +9730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 17:12:40 2018 From: report at bugs.python.org (Tal Einat) Date: Sat, 10 Nov 2018 22:12:40 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541887960.51.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: Raymond, thanks for bringing up all of these issues. This kind of input from people using IDLE extensively for teaching is extremely useful. I'll leave it to Terry to decide how to manage this list, but I promise to do my best (with my limited time) to resolve the worst of these. A few quick notes: > However, recently a student got into a new-tabbed mode and there didn't seem to be any way to turn it off. It became impossible to see code and output or error messages at the same time. This devastated the learner's experience. This sounds like macOS's new "Prefer tabs when opening documents" system preference, which breaks IDLE in various ways; see issue34864. It should be disabled when using IDLE. > FWIW, I think the squeezer focused on the wrong problem. In general, I've never had a problem with too many *lines* of output. [...] The real problem with IDLE was excessive wide output on a *single* line [...] That tends to cripple IDLE because line wrap logic seems to be computationally expensive for scrolling text windows. The effect persists even after the offending text has scrolled off and is no longer visible. This is exactly the main rationale for Squeezer; it takes wrapping into account when counting lines precisely for this reason. This may not be working properly in some cases due to issue35208, which I discovered only yesterday and for which a PR is now ready with a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 17:29:38 2018 From: report at bugs.python.org (Martin Panter) Date: Sat, 10 Nov 2018 22:29:38 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541888978.36.0.788709270274.issue35210@psf.upfronthosting.co.za> Martin Panter added the comment: Looks like this is about about making ?RawIOBase.read? delegate to ?readinto? with a ?bytes? object. If so, there?s more discussion in Issue 15903. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 17:41:19 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Nov 2018 22:41:19 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541889679.02.0.788709270274.issue35211@psf.upfronthosting.co.za> Eric V. Smith added the comment: Please create a small program that reproduces the problem. You should strip out everything that isn't needed. There's no way we can guess the problem without seeing the code. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 18:08:33 2018 From: report at bugs.python.org (bob moth) Date: Sat, 10 Nov 2018 23:08:33 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541889679.02.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <358F240B-7717-4888-AEE1-037119099F11@icloud.com> bob moth added the comment: send to you? . > On Nov 10, 2018, at 14:41, Eric V. Smith wrote: > > > Eric V. Smith added the comment: > > Please create a small program that reproduces the problem. You should strip out everything that isn't needed. There's no way we can guess the problem without seeing the code. > > ---------- > nosy: +eric.smith > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 18:23:45 2018 From: report at bugs.python.org (bob moth) Date: Sat, 10 Nov 2018 23:23:45 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <358F240B-7717-4888-AEE1-037119099F11@icloud.com> Message-ID: bob moth added the comment: Here is the source, just simply Turtles... https://github.com/grantjenks/free-python-games Attached life.py and life2.py I don't know what cause the problem. I suspect there is more of a problem than just alt-Q > On Nov 10, 2018, at 15:08, Bob Moth wrote: > > send to you? > > . > > >> On Nov 10, 2018, at 14:41, Eric V. Smith wrote: >> >> >> Eric V. Smith added the comment: >> >> Please create a small program that reproduces the problem. You should strip out everything that isn't needed. There's no way we can guess the problem without seeing the code. >> >> ---------- >> nosy: +eric.smith >> >> _______________________________________ >> Python tracker >> >> _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 18:34:26 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Nov 2018 23:34:26 +0000 Subject: [issue23220] IDLE: Document how Shell displays user code output In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1541892866.31.0.788709270274.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: In the patch for #33000, to cover MacOS behavior, I changed the comment about control chars from 'replaced' to 'replaced or deleted' Users can fill in the details by comparing IDLE on their system to a particular console or terminal. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 18:57:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 23:57:54 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541894274.45.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > This sounds like macOS's new "Prefer tabs when opening > documents" system preference, which breaks IDLE in various > ways; see issue34864. It should be disabled when using IDLE. Thanks for the link. I couldn't figure out what was happening with the student's computer and why it only happened to one person. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 18:58:53 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Nov 2018 23:58:53 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1541894333.38.0.788709270274.issue35196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: By the way, I really appreciate the work you all are putting into IDLE. It can definitely benefit from some love and attention. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 19:03:35 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Nov 2018 00:03:35 +0000 Subject: [issue28054] Diff for visually comparing actual with expected in mock.assert_called_with. In-Reply-To: <1473461073.51.0.19108692382.issue28054@psf.upfronthosting.co.za> Message-ID: <1541894615.16.0.788709270274.issue28054@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 for extending the unittest display niceties to mock. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 19:34:08 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Nov 2018 00:34:08 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541896448.56.0.788709270274.issue35104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #21359, reported by Ned in 4/2018, is about "Cmd-Shift-Z, has the same effect as the Undo accelerator, Cmd-Z" So there may be a general problem with Cmd-Shift == Cmd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 20:26:54 2018 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 11 Nov 2018 01:26:54 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1541899614.94.0.788709270274.issue19217@psf.upfronthosting.co.za> Emmanuel Arias added the comment: Hi! I see that this issue have a pr (https://github.com/python/cpython/pull/10034) opened 20 days ago. So, I want to continue work on this (my first pr). I use the vstinner's patch and I make two little change (attached patch): 1) first I add the "expected" and "got" mentioned by vstinner. 2) I quit the @@ -1 +1 @@ in case of the input are list or tuple, because IMO this does not give me lot of information (and could be confuse, because I can interpret that the lists differ on the first element) This is the output for the vstinner test case. What do you think? ---------- nosy: +eamanu Added file: https://bugs.python.org/file47921/issue_19217.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 20:27:38 2018 From: report at bugs.python.org (Emily Morehouse) Date: Sun, 11 Nov 2018 01:27:38 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541899658.64.0.788709270274.issue33878@psf.upfronthosting.co.za> Change by Emily Morehouse : ---------- nosy: +emilyemorehouse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 20:29:17 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Nov 2018 01:29:17 +0000 Subject: [issue21603] IDLE: Document SaveAs extension display on Mac In-Reply-To: <1401349272.89.0.982652468131.issue21603@psf.upfronthosting.co.za> Message-ID: <1541899757.08.0.788709270274.issue21603@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I should have mentioned before, but forgot, that Windows, by default, hides file name extensions in File Explorer. (The 'type' column supposedly makes them redundant.) If they are hidden, they are also hidden in the Save As name box, as described for MacOS. So I think this is worth a sentence in the doc. After 4 years, I want to close this with or without an edit (for this and/or #4832). The current SaveAs entry is Save the current window with a Save As dialog. The file saved becomes the new associated file for the window. (Ned has previously said leave this alone for both issues.) Proposal: Save the contents of the current window with a Save As dialog. (If your file manager is set to hide extensions, the current extension will be omitted in the file name box.) If the new filename has no '.', '.py' and '.txt' will be added for Python and text files. (On MacOS Aqua, '.py' is added for any type.) The file saved becomes the new associated file for the window. Opinions? ---------- nosy: +taleinat -Saimadhav.Heblikar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 20:29:38 2018 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 11 Nov 2018 01:29:38 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1541899778.38.0.788709270274.issue19217@psf.upfronthosting.co.za> Emmanuel Arias added the comment: I create this patch on 3.7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 21:29:42 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Nov 2018 02:29:42 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541903382.49.0.788709270274.issue34864@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +9731 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 22:31:31 2018 From: report at bugs.python.org (Ma Lin) Date: Sun, 11 Nov 2018 03:31:31 +0000 Subject: [issue35140] encoding problem: coding:gbk cause syntaxError Message-ID: <1541907091.03.0.788709270274.issue35140@psf.upfronthosting.co.za> Ma Lin added the comment: I debugged, this is a duplicate of issue 20844 and issue 27797. Eryk Sun analyzed this detailedly, it's a problem of Windows CRT. ---------- versions: +Python 3.5, Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:26:35 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Nov 2018 04:26:35 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541910395.72.0.788709270274.issue34864@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 50ff02b43145f33f8e28ffbfcc6a9d15c4749a64 by Terry Jan Reedy in branch 'master': bpo-34864: Document two IDLE on MacOS issues. (GH-10456) https://github.com/python/cpython/commit/50ff02b43145f33f8e28ffbfcc6a9d15c4749a64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:26:45 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 04:26:45 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541910405.46.0.788709270274.issue34864@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:26:54 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 04:26:54 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541910414.93.0.788709270274.issue34864@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:35:07 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 04:35:07 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541910907.91.0.788709270274.issue34864@psf.upfronthosting.co.za> Ned Deily added the comment: Terry, FYI, according to Apple, the correct current styling for the Mac Operating System is "macOS". We should be using that spelling in the documentation. https://en.wikipedia.org/wiki/MacOS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:46:15 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 04:46:15 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541911575.31.0.788709270274.issue34864@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b91c27d89de83ee664e3726e066eb2e424d84bdf by Miss Islington (bot) in branch '3.7': bpo-34864: Document two IDLE on MacOS issues. (GH-10456) https://github.com/python/cpython/commit/b91c27d89de83ee664e3726e066eb2e424d84bdf ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 10 23:49:13 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 04:49:13 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541911753.38.0.788709270274.issue34864@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a650493a4626c309b34a38919a41f5de32de3721 by Miss Islington (bot) in branch '3.6': bpo-34864: Document two IDLE on MacOS issues. (GH-10456) https://github.com/python/cpython/commit/a650493a4626c309b34a38919a41f5de32de3721 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 00:19:11 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 11 Nov 2018 05:19:11 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541913551.64.0.788709270274.issue35211@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Please quote only the relevant parts of the original email while replying from email since it duplicates the content and makes your reply hard to read. Also I think the bug tracker doesn't support attachments from email so please attach them here from the UI. Thanks ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 00:42:08 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Nov 2018 05:42:08 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541914928.87.0.788709270274.issue34864@psf.upfronthosting.co.za> Terry J. Reedy added the comment: OK, I will change doc references in the next doc patch, or maybe in a patch that also changes module macosx to macos. (I want to keep it all lowercase. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: behavior -> enhancement versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 01:01:06 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 06:01:06 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541916066.21.0.788709270274.issue34864@psf.upfronthosting.co.za> Ned Deily added the comment: I don?t think it?s worth changing the file name or other names, that just causes needless churn and the possibility for stranded files on an upgrade. I?d just update the docs and messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 01:02:35 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 06:02:35 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541916155.31.0.788709270274.issue35211@psf.upfronthosting.co.za> Change by bob moth : Added file: https://bugs.python.org/file47922/life.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 01:02:55 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 06:02:55 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541916175.09.0.788709270274.issue35211@psf.upfronthosting.co.za> Change by bob moth : Added file: https://bugs.python.org/file47923/life2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 01:17:01 2018 From: report at bugs.python.org (Tal Einat) Date: Sun, 11 Nov 2018 06:17:01 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1541916066.21.0.788709270274.issue34864@psf.upfronthosting.co.za> Message-ID: Tal Einat added the comment: Can we detect whether this system preference is enabled? If so, perhaps IDLE should display a prominent warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 01:53:20 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 11 Nov 2018 06:53:20 +0000 Subject: [issue35149] pip3 show causing Error for ConfigParaser In-Reply-To: <1541179646.4.0.788709270274.issue35149@psf.upfronthosting.co.za> Message-ID: <1541919200.26.0.788709270274.issue35149@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. The tracker is for issues related to CPython. I think this is an issue with pip and please file an issue at https://github.com/pypa/pip/issues. I can see some related issues as per your original report on googling specifically on Windows machines while processing non-ASCII characters in metadata. * https://github.com/dib-lab/khmer/issues/1565 * https://github.com/pypa/pip/issues/1291 * https://github.com/pypa/pip/issues?q=is%3Aissue+sort%3Aupdated-desc+unicode+is%3Aopen I propose closing this as third party. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 02:42:53 2018 From: report at bugs.python.org (tzickel) Date: Sun, 11 Nov 2018 07:42:53 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1541922173.87.0.788709270274.issue35210@psf.upfronthosting.co.za> tzickel added the comment: ahh, very interesting discussion. BTW, how is this code different than https://github.com/python/cpython/blame/50ff02b43145f33f8e28ffbfcc6a9d15c4749a64/Modules/_io/bufferedio.c which does the same thing exactly ? (i.e. the memoryview can leak there as well). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 02:47:10 2018 From: report at bugs.python.org (remi bertholet) Date: Sun, 11 Nov 2018 07:47:10 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541870129.53.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <0DBDF1FC-B131-4629-8A41-3BED20921428@yahoo.fr> remi bertholet added the comment: The problem is due to an old version of tk. I deleted the python3 from homebrew. With version 3.7.1 python.org, the crash is no longer, but the keyboard shortcuts tkinter on the menus (accelerator), seems to be capricious, they work once, then it does not work anymore. I did not have this problem before, is it a regression of version 3.7.1? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 03:31:01 2018 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 11 Nov 2018 08:31:01 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1541925061.98.0.788709270274.issue35207@psf.upfronthosting.co.za> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 03:45:45 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 11 Nov 2018 08:45:45 +0000 Subject: [issue35149] pip3 show causing Error for ConfigParaser In-Reply-To: <1541179646.4.0.788709270274.issue35149@psf.upfronthosting.co.za> Message-ID: <1541925945.27.0.788709270274.issue35149@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Sorry I overlooked the part where it says this works with command line but throws an error on batch script. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 03:55:32 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 11 Nov 2018 08:55:32 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541926532.52.0.788709270274.issue35200@psf.upfronthosting.co.za> Nick Coghlan added the comment: I agree with Steven and Raymond on this one: changing __repr__ on ranges in a way that breaks round-tripping through eval would be problematic, especially as I'd expect that to be an issue in doctests as well. However, I also like the idea of having easier access to a more list-like representation that shows the actual range endpoints, not just the inputs used to calculate them, and like Steven, I'm more comfortable with changing __str__ than I am with changing __repr__. That would give: >>> range(10) range(0, 10) >>> print(range(10)) ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 05:23:15 2018 From: report at bugs.python.org (Javier Castillo II) Date: Sun, 11 Nov 2018 10:23:15 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1541931795.81.0.788709270274.issue21622@psf.upfronthosting.co.za> Change by Javier Castillo II : ---------- pull_requests: +9734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 05:26:21 2018 From: report at bugs.python.org (Javier Castillo II) Date: Sun, 11 Nov 2018 10:26:21 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1541931981.76.0.788709270274.issue21622@psf.upfronthosting.co.za> Change by Javier Castillo II : ---------- pull_requests: +9735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 05:27:57 2018 From: report at bugs.python.org (Javier Castillo II) Date: Sun, 11 Nov 2018 10:27:57 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1541932077.37.0.788709270274.issue21622@psf.upfronthosting.co.za> Change by Javier Castillo II : ---------- pull_requests: +9736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 07:34:00 2018 From: report at bugs.python.org (Arminius) Date: Sun, 11 Nov 2018 12:34:00 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST Message-ID: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> New submission from Arminius : ast.parse() will give a wrong code position for an expression inside an f-string when the expression is using a format specifier. Compare the trees of f'{a}' and f'{a:b}' : >>> ast.parse("f'{a}'") Module( body=[ Expr( lineno=1, col_offset=0, value=JoinedStr( lineno=1, col_offset=0, values=[ FormattedValue( lineno=1, col_offset=0, value=Name(lineno=1, col_offset=3, id='a', ctx=Load()), conversion=-1, format_spec=None, ), ], ), ), ], ) >>> ast.parse("f'{a:b}'") Module( body=[ Expr( lineno=1, col_offset=0, value=JoinedStr( col_offset=0, lineno=1, col_offset=0, values=[ FormattedValue( lineno=1, col_offset=0, value=Name(lineno=1, col_offset=1, id='a', ctx=Load()), conversion=-1, format_spec=JoinedStr( lineno=1, col_offset=0, values=[Str(lineno=1, col_offset=0, s='b')], ), ), ], ), ), ], ) In both examples, the name "a" is at the same position in the source code, however the parsed ASTs yield two different offsets, Name(lineno=1, col_offset=3, id='a', ctx=Load()) and Name(lineno=1, col_offset=1, id='a', ctx=Load()) . Expected behavior: col_offset=3 for name "a" in both f-strings. (In my specific use case, this breaks a semantic highlighting plugin for vim.) ---------- components: Interpreter Core messages: 329672 nosy: arminius priority: normal severity: normal status: open title: Expressions with format specifiers in f-strings give wrong code position in AST type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 08:51:18 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 11 Nov 2018 13:51:18 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST In-Reply-To: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> Message-ID: <1541944278.12.0.788709270274.issue35212@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 08:54:10 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 11 Nov 2018 13:54:10 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST In-Reply-To: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> Message-ID: <1541944450.13.0.788709270274.issue35212@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 09:04:30 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 11 Nov 2018 14:04:30 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present In-Reply-To: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> Message-ID: <1541945070.15.0.788709270274.issue35203@psf.upfronthosting.co.za> Steve Dower added the comment: Does it actually try to upgrade the launcher? This is a case that was deliberately designed and tested before release, though it's possible that there's some mix of versions that is new. The box is checked to indicate that the launcher will be installed at the end of setup, but not necessarily that the installer is going to try and install the launcher. This is the usual convention for this scenario. If you're getting install failures, please attach the log file linked at the end of the install. We'll need that to diagnose the scenario. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 09:13:14 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 11 Nov 2018 14:13:14 +0000 Subject: [issue35140] encoding problem: coding:gbk cause syntaxError Message-ID: <1541945594.43.0.788709270274.issue35140@psf.upfronthosting.co.za> Steve Dower added the comment: Yes, seems like we should be opening the file in binary mode, though I haven't tried it. The CRT's interpretation of text mode really isn't compatible with Python's own interpretation of text mode, and chaining them makes even less sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 09:48:44 2018 From: report at bugs.python.org (Tal Einat) Date: Sun, 11 Nov 2018 14:48:44 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541947724.83.0.788709270274.issue34864@psf.upfronthosting.co.za> Change by Tal Einat : ---------- pull_requests: +9737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 10:15:40 2018 From: report at bugs.python.org (Tal Einat) Date: Sun, 11 Nov 2018 15:15:40 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541949340.56.0.788709270274.issue34864@psf.upfronthosting.co.za> Tal Einat added the comment: See PR GH-10464, which warns if "Prefer tabs when opening documents" is set to "Always". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 11:41:41 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 16:41:41 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541954501.13.0.788709270274.issue35211@psf.upfronthosting.co.za> bob moth added the comment: looking at the screen snapshot 'life.py alt-q once.jpg' -- the turtle code keeps running even though System.exit has been completed, and notice the traceback display in the shell caused by the alt-Q. a second press of alt-Q terminates the shell and the turtle code. ---------- Added file: https://bugs.python.org/file47924/lify.py alt-q once.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 11:50:24 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 16:50:24 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541955024.05.0.788709270274.issue35211@psf.upfronthosting.co.za> bob moth added the comment: I rewrote the life2.py using a class in order to eliminate global variable declarations, and some other things, such as bringing freegames.util#square() instream to be independent of freegames, carefully accounting for every pixel output, etc. Works a little better but alt-Q has no effect whatsoever and it is necessary to Force Quit (mac terminology) or to switch to the shell window and quit that first. Once this bug is fixed, wherever that might be, you might look into using mylife.py as an turtle example -- with whatever changes you like -- because it is interesting to use and it exercises the turtle and tkinter very strenuously. (just leave my name off it...) Thanks for your hard work. ---------- Added file: https://bugs.python.org/file47925/mylife.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:33:54 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 19:33:54 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541964834.6.0.788709270274.issue33699@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b086c8afdb8c862011e3e27d4c8f6833749f2c56 by Miss Islington (bot) (Andr?s Delfino) in branch 'master': bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) https://github.com/python/cpython/commit/b086c8afdb8c862011e3e27d4c8f6833749f2c56 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:34:03 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 19:34:03 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541964843.11.0.788709270274.issue33699@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:34:12 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 19:34:12 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541964852.22.0.788709270274.issue33699@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:43:15 2018 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 11 Nov 2018 19:43:15 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541965395.91.0.788709270274.issue33699@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Just need a manual backport to 2.7, which I'm not doing :) If no one is motivated enough to backport to 2.7, I'm fine with that. Otherwise this issue can be closed. ---------- nosy: +Mariatta resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:43:55 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 19:43:55 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541965435.24.0.788709270274.issue33699@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7d7ff672dfe93a50053166798cdc0fbc86ea63e3 by Miss Islington (bot) in branch '3.7': bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) https://github.com/python/cpython/commit/7d7ff672dfe93a50053166798cdc0fbc86ea63e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:44:34 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 19:44:34 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541965474.23.0.788709270274.issue33699@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3f6a0a292e12f737448a11660da0c880e8f972be by Miss Islington (bot) in branch '3.6': bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) https://github.com/python/cpython/commit/3f6a0a292e12f737448a11660da0c880e8f972be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:46:24 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 11 Nov 2018 19:46:24 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541965584.61.0.788709270274.issue33699@psf.upfronthosting.co.za> Andr?s Delfino added the comment: I'm doing the 2.7 backport right now :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 14:56:25 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 11 Nov 2018 19:56:25 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541966185.39.0.788709270274.issue33699@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +9740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 15:09:06 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 20:09:06 +0000 Subject: [issue33699] Don't describe try's else clause in a footnote In-Reply-To: <1527709182.68.0.682650639539.issue33699@psf.upfronthosting.co.za> Message-ID: <1541966946.14.0.788709270274.issue33699@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fb8eb2c2776efb34523e0a616c6f845a6b975e38 by Miss Islington (bot) (Andr?s Delfino) in branch '2.7': [2.7] bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252) (GH-10469) https://github.com/python/cpython/commit/fb8eb2c2776efb34523e0a616c6f845a6b975e38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 15:10:55 2018 From: report at bugs.python.org (Michael Felt) Date: Sun, 11 Nov 2018 20:10:55 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1541967055.21.0.788709270274.issue35198@psf.upfronthosting.co.za> Michael Felt added the comment: Still getting the same errors, even with 64-bit build, so still not close to testing the actual problem. FYI: last time I build pandas the version was 0.19.0 - then it was 'simple'. Anyway, short of a simple (test) python module that includes c++ code, I'll look at changing the pandas build files to force any c++ file to the front. More - (asap, but still when I have time) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 15:36:41 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 20:36:41 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541968601.16.0.788709270274.issue35211@psf.upfronthosting.co.za> Ned Deily added the comment: There seem to be at least two problems here. One, you say that running the unmodified life.py requires two Quit keyboard shortcuts (usually CMD-Q). From the shell output you give, that problem is most likely due to the use of -i with python: '/usr/local/bin/python3' -d -i '/Users/user2/Downloads/life.py' -i means that the interpreter should enter its interactive mode after the script exists. With tkinter-based graphics apps like turtle, you probably do not want to do that as it will inhibit the normal Tk shutdown of the app. https://docs.python.org/3/using/cmdline.html#cmdoption-i Without -i, the unmodified life.py terminates fine for me. Secondly, your modified life2.py does not terminate with a Quit even when running without -i. (Note that it *does* quit if you select Close from the applications's File menu or if you click on the red close button on the open window.) From a quick comparison of the unmodified Pygames life.py versus your modified life2.py version, it seems you have changed the order of operations in such a way that the sequence of turtle operations has changed and likely the underlying tkinter event loop is not being called properly thus either ignoring or suppressing the effect of the Quit keyboard shortcut. Suggest you revise your program to follow the sequence of turtle calls that the original does and be careful if you wish to introduce changes in that. If you do find what appears to be a bug in turtle or elsewhere in Python, feel free to re-open this with an example and an explanation. Good luck! ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 15:48:47 2018 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 11 Nov 2018 20:48:47 +0000 Subject: [issue35140] encoding problem: coding:gbk cause syntaxError Message-ID: <1541969327.07.0.788709270274.issue35140@psf.upfronthosting.co.za> Emmanuel Arias added the comment: I can not reproduce this issue on my Debian9. ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 15:58:44 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 20:58:44 +0000 Subject: [issue35104] IDLE: On macOS, Command-M minimizes & opens "Open Module..." In-Reply-To: <1540812606.17.0.788709270274.issue35104@psf.upfronthosting.co.za> Message-ID: <1541969924.92.0.788709270274.issue35104@psf.upfronthosting.co.za> Ned Deily added the comment: That's a good point. I see that Cmd-Shift-S which is defined as the shortcut for "Save As.." seems to have the same effect as Cmd-S "Save". Also, the Cmd-Opt-S shortcut for "Save Copy As.." seems to bring up the save dialog window twice, the second after the first closes. I guess somebody should go through and try to see exactly which Tk events IDLE is seeing in these cases similar to what Ronald was doing while investigating Issue11055 (referenced in Issue21359). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 16:02:33 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 21:02:33 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541968601.16.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: bob moth added the comment: hi - i do not use ?i?...just drag to launcher... and sequence of commands is a good tip but smells like some kind of bug to me if the commands follow written rules. thanks for looking - > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 16:36:24 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 21:36:24 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541972184.96.0.788709270274.issue35211@psf.upfronthosting.co.za> Ned Deily added the comment: Alas, the Launcher app can be problematic and doesn't get much love. If you open the Launcher app's Preferences, you'll probably see that the "Interactive mode after acript" option is ticked. Either unselect it or, if you feel comfortable using a Terminal window, just launch Python directly from a terminal shell: python3 ~/Downloads/life.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 17:01:16 2018 From: report at bugs.python.org (bob moth) Date: Sun, 11 Nov 2018 22:01:16 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: Message-ID: <40CA820C-F67E-4AB6-8F1C-630AB35288DF@icloud.com> bob moth added the comment: OK, thanks. The generated launcher shell command generated includes '-d -i' flags... so I tried running without those and voila, life.py terminates normally. Yay. :-) 2nd, I reviewed the order of commands and I saw that life2.py and mylife.py (the +1 version) did not have a 'done()' or 'mainloop()' as the last line of the program. I added those, to no effect. Does nothing I can see. The other turtle commands appear to me to be "ok", given that the algorithm is different. For example, clear() used to be done every loop -- to erase the turtle tracks -- but that is now done just at the start because only changed cells are updated, and new life/new dead are just updated. So, 50% solved. It is an interesting problem because *my* code seems to be working and *python* does not appear to be working right. Thanks for the help. I might try pygame for a gui instead...this is getting weird. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 17:11:15 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 11 Nov 2018 22:11:15 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541974275.0.0.788709270274.issue35211@psf.upfronthosting.co.za> Ned Deily added the comment: You may might try asking on the freegames issue tracker or, better, on a more general support forum like Stackoverflow or Python-list. Because of the volume of issues reported here (and we are all volunteers), we really can't spend a lot of time helping debug individual programs. Sorry! https://www.python.org/about/help/ https://stackoverflow.com https://mail.python.org/mailman/listinfo/python-list ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:14:53 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 11 Nov 2018 23:14:53 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541978093.95.0.788709270274.issue35204@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset fd3a91cbf93dd7bd97f01add9c90075d63cd7316 by Benjamin Peterson (Alexey Izbyshev) in branch 'master': closes bpo-35204: Disable thread and memory sanitizers for address_in_range(). (GH-10442) https://github.com/python/cpython/commit/fd3a91cbf93dd7bd97f01add9c90075d63cd7316 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:15:12 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:15:12 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541978112.44.0.788709270274.issue35204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:15:20 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:15:20 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541978120.75.0.788709270274.issue35204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:30:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 11 Nov 2018 23:30:30 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1541979030.91.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: > Python/pystate.c:968:1: warning: no previous prototype for ?_PyGILState_Init? [-Wmissing-prototypes] _PyGILState_Init(PyInterpreterState *i, PyThreadState *t) ^~~~~~~~~~~~~~~~ Oh, I never saw this warning before. It seems to not be included in -Wall. Would you mind to open a new issue to discuss it? I will try to fix the regressions that I introduced, but I'm interested by a more general discussion on this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:44:37 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:44:37 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541979877.36.0.788709270274.issue35204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1ec5781a097f4d4d988e0dd7f51ee203dc639df2 by Miss Islington (bot) in branch '3.7': closes bpo-35204: Disable thread and memory sanitizers for address_in_range(). (GH-10442) https://github.com/python/cpython/commit/1ec5781a097f4d4d988e0dd7f51ee203dc639df2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:48:01 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:48:01 +0000 Subject: [issue35204] Disable thread and memory sanitizers for address_in_range() In-Reply-To: <1541802807.41.0.788709270274.issue35204@psf.upfronthosting.co.za> Message-ID: <1541980081.82.0.788709270274.issue35204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset eff1c983eb0cc9bc011111e8eba07a42522cee57 by Miss Islington (bot) in branch '3.6': closes bpo-35204: Disable thread and memory sanitizers for address_in_range(). (GH-10442) https://github.com/python/cpython/commit/eff1c983eb0cc9bc011111e8eba07a42522cee57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:56:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 11 Nov 2018 23:56:22 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1541980582.6.0.788709270274.issue35177@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5f2df88b63e50d23914e97ec778861a52abdeaad by Victor Stinner in branch 'master': bpo-35177: Add dependencies between header files (GH-10361) https://github.com/python/cpython/commit/5f2df88b63e50d23914e97ec778861a52abdeaad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:59:42 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 11 Nov 2018 23:59:42 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541980782.08.0.788709270274.issue33878@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 082875dcd6d482558e5f1da97a1c801d60b3ed5b by Julien Palard in branch 'master': bpo-33878: Doc: Fix missing case by simplifying. (GH-7762) https://github.com/python/cpython/commit/082875dcd6d482558e5f1da97a1c801d60b3ed5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:59:50 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:59:50 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541980790.31.0.788709270274.issue33878@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 18:59:59 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Nov 2018 23:59:59 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541980799.06.0.788709270274.issue33878@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:07:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 00:07:13 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1541981233.64.0.788709270274.issue34160@psf.upfronthosting.co.za> STINNER Victor added the comment: I like the idea of having an opt-in option to get Python 3.7 behavior in Python 3.8, sort=True. It would be a new parameter in Python 3.8, right? It makes sense to me to ask explicitly to sort attributes, especially since Python decided to no longer sort by default :-) Maybe some people prefer sorting to get a more deterministic output for things like https://reproducible-builds.org/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:08:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 00:08:23 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1541981303.82.0.788709270274.issue35177@psf.upfronthosting.co.za> STINNER Victor added the comment: This change doesn't try to fix "all dependencies issues", but it fix a few of them :-) See bpo-35197 for another example of funny header issue. Please open a new issues if you see other header dependencies issues. I close this one since the initial bug has been fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:09:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 00:09:26 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue) In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1541981366.38.0.788709270274.issue35190@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: collections.abc.Sequence cannot be used to test whether a class provides a particular interface -> collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:18:01 2018 From: report at bugs.python.org (bob moth) Date: Mon, 12 Nov 2018 00:18:01 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541974275.0.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <5C1E9E60-348E-4833-9B8D-B2B921DF9C1D@icloud.com> bob moth added the comment: Thanks. I appreciate the time and effort. But I disagree with the characterization of this problem as 'Resolved'. Turtle is supposed to be simple enough for children yet no one can fix simple turtle code and stop an endless loop? What is the rush to close issues? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:24:33 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 00:24:33 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541982273.91.0.788709270274.issue33878@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset aa493b5c18463ab45c087564e287643606f004ca by Julien Palard (Miss Islington (bot)) in branch '3.7': bpo-33878: Doc: Fix missing case by simplifying. (GH-7762) https://github.com/python/cpython/commit/aa493b5c18463ab45c087564e287643606f004ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:24:44 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 00:24:44 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541982284.33.0.788709270274.issue33878@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset d0ebbf4895439233c8398dbdd0456d07132b2a6f by Julien Palard (Miss Islington (bot)) in branch '3.6': bpo-33878: Doc: Fix missing case by simplifying. (GH-7762) https://github.com/python/cpython/commit/d0ebbf4895439233c8398dbdd0456d07132b2a6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:27:30 2018 From: report at bugs.python.org (Daniel Israel) Date: Mon, 12 Nov 2018 00:27:30 +0000 Subject: [issue35201] Recursive '**' matches non-existent directories. In-Reply-To: <1541782491.74.0.788709270274.issue35201@psf.upfronthosting.co.za> Message-ID: <1541982450.09.0.788709270274.issue35201@psf.upfronthosting.co.za> Daniel Israel added the comment: In the Bash example, you created the directory empty/. This bug is specifically when the directory in question does not exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:28:44 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 00:28:44 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1541982524.55.0.788709270274.issue35200@psf.upfronthosting.co.za> Julien Palard added the comment: I understand we like round-tripping represnetations, I think we like them because in much cases it's immediatly and unambiguously understandable by a Python developer. It's the best representation as it's the one conveying the most information. But `range(0, 10)` convery very few information, one may forget the "begin included, end excluded" rule (or even if the 2nd one is the end of the length). I think the following is more usefull: >>> range(10) >>> range(10, 2) >>> range(2, 10) >>> range(2, 10, 2) >>> @steven: I dont think moving this to __str__ would help someone: I've never seen any student try `str(range(10))` in the repl, they all naturally try the bare `range(10)` and they're all presented with un-informative information. If someone is here to teach them to try with str, better try with list(range(10)) or *range(10). As for repr(range(0)) == repr(range(2, 2)) == repr(range(1, 5, -1)) I do not consider this a bug, they are all strictly equivalent as being the empty range (when speaking of a mathematical object, maybe not the in-memory struct). @raymond: I'm also not OK to teach `*repr(10)` during the first class. I personally go for `list(range(10))`, but I can only because I'm physically available when they ask why the information displayed is not what they expect. A lot of people are learning Python at home and they're probably just lost while being presented with the round-tripping representation. I don't really agree that changing the repr could break code doing `eval(repr(range(10)))`, is it really something people do? @nick: I agree changing the repr could break some doctests on function returning ranges, on the other hand I've never seen a function returning a range. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:36:21 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Nov 2018 00:36:21 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541982981.35.0.788709270274.issue35211@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, there isn't a particular rush to close issues as some of them stay open for years. And that's not good for anyone. "resolved" on the issue tracking does not necessarily mean a problem is resolved to everyone's satisfaction, it just means that it is no longer active in our backlog (which currently numbers over 6000). I don't claim to be a turtle expert but the bit of time I spent looking into this issue and my years of triaging Python issues lead me to conclude this is almost certainly a problem with your program and not with Python itself. We could leave it open but the chances that any other core developer would spend time looking further at it are slim. That's why I suggested asking on user forums where you are much more likely to get useful and more rapid feedback. And as I earlier suggested, if it *does* turn out to be a demonstrable problem with turtle or elsewhere in Python, you can easily reopen the issue and we can go from there. I hope that makes some sense! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:37:25 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 00:37:25 +0000 Subject: [issue33878] Doc: Assignment statement to tuple or list: case missing. In-Reply-To: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> Message-ID: <1541983045.68.0.788709270274.issue33878@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 19:39:56 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Nov 2018 00:39:56 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541983196.64.0.788709270274.issue35211@psf.upfronthosting.co.za> Ned Deily added the comment: And, by the way, if it turns out that the problem could have been avoided by better documentation, another option is to re-open the issue with suggested doc changes. Patches welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 20:20:40 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 12 Nov 2018 01:20:40 +0000 Subject: [issue35200] Range repr could be better In-Reply-To: <1541982524.55.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <20181112012030.GB4071@ando.pearwood.info> Steven D'Aprano added the comment: > I've never seen any student try `str(range(10))` in the repl I never suggested that students would try calling str() directly. That would be silly. They would use print(), as I'm sure many of them are already doing. After 20+ years of using Python, I still sometimes use print in the interactive interpreter when I don't need to. > they all naturally try the bare `range(10)` and they're all presented > with un-informative information. It isn't un-informative information. Its very informative, and useful, but perhaps not the information you are trying to teach your students *at that moment*. But they will have potentially decades of use of Python, long after they have learned that range() is half-open, and the long form is no longer necessary, and perhaps even an annoyance. (It certainly annoys *me*. The existing short form is usually better for my needs, and I think I'm more representative of the average Python coder over their career than beginners during their first few weeks.) > As for repr(range(0)) == repr(range(2, 2)) == repr(range(1, 5, -1)) I > do not consider this a bug I didn't say it was a bug. But it reduces the utility of the display, as you cannot tell the difference between any two empty range objects. And that can be important when trying to work out why your range object is unexpectedly empty. > I don't really agree that changing the repr could break code doing > `eval(repr(range(10)))`, That's not something up for debate. Whether you "really agree" or not, it is a fact that your proposed repr is not legal Python code and therefore it will break code doing eval() on it. > is it really something people do? It is a backwards-incompatible change of behaviour, therefore we must assume it will break someone's code and treat it as a major change. That's not to say that we can't change the repr, but we don't do it lightly. Personally, making a change for the sake of beginners during their first few weeks of learning the language, but inconveniences them for the remaining 95% of their career as a Python coder, does not sound like a good trade-off to me. That's why I suggest that print(range_obj) is a good compromise. Lots of beginners already do this, and for those who don't, print is a good diagnostic tool which they should be taught early. And yes, changing the __str__ is a backwards-incompatible change too, but the potential negative consequences are smaller and the work-arounds are easier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 23:18:30 2018 From: report at bugs.python.org (bob moth) Date: Mon, 12 Nov 2018 04:18:30 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541996310.13.0.788709270274.issue35211@psf.upfronthosting.co.za> bob moth added the comment: Apparently the draw() function must call itself via ontimer. That is not in the docs. But 56 variations later...I just copied Grant Jenks. Apparently he knows what's what. And done() must be the last line. If first omitted, only one draw loop executed, but it quits itself. With done(), it loops via ontimer().

def draw():
    myDrawCells()
    update()
    myComputeOneStep()
    ontimer(draw, LOOP_TIMER)
setup(BOARD_SIDE, BOARD_SIDE, None, None)
hideturtle()
tracer(False)
clear()
myInitialize()
draw()
done()
So now alt-Q works in life2DEBUG.py. attached. ---------- Added file: https://bugs.python.org/file47926/life2DEBUG.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 23:25:15 2018 From: report at bugs.python.org (bob moth) Date: Mon, 12 Nov 2018 04:25:15 +0000 Subject: [issue35211] Turtle Shutdown Problem(s) In-Reply-To: <1541878792.83.0.788709270274.issue35211@psf.upfronthosting.co.za> Message-ID: <1541996715.81.0.788709270274.issue35211@psf.upfronthosting.co.za> bob moth added the comment: Here is a debugged version of mylife, which cloned life2.py to use a class for turtle-ing. Note the difficulties at the end of the code -- ontimer(fun, delay) calls for a zero arg function, so draw() cannot be inside the class. Greatly annoying. But now we know. mylife3.py is a suitable example, I think. If cleaned up to standards. I noticed there is a curses life.py example, which is very interesting and fun, but mylife3.py is more fun...and it has 2 different board topologies! And it would make a very good test program. Note that it sets the random seed which establishes the Cell patterns, so a test ought to be repeatable, at least on a given machine. I plan to use mylife3.py instead of a space heater this winter :) ---------- Added file: https://bugs.python.org/file47927/mylife3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 23:36:46 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 04:36:46 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541997406.06.0.788709270274.issue34864@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I will leave macosx alone at least until after 3.6.8. But I plan to merge some modules and want to be able to rename others. #33906 changed windows.py to window.py for 3.7.1 (and 3.6.7). The 3.7.1 Windows installer deleted windows.py; the macOS installer did not. Tal, do you have a Linux 3.7.1 upgrade of 3.7.0? What is the downside of the old, dead version? I could, for the maintenance version, add back a file containing "# renamed xyz.py" or "# merged into abc.py". An possible example of the latter is merging autocomplete_w.py into autocomplete.py. (I strongly suspect that the split was for a Java-esque one-class per module rule.) Can modules be made system specific without great hassle? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 23:38:03 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Nov 2018 04:38:03 +0000 Subject: [issue35209] Crash with tkinter text on osx In-Reply-To: <1541847398.17.0.788709270274.issue35209@psf.upfronthosting.co.za> Message-ID: <1541997483.28.0.788709270274.issue35209@psf.upfronthosting.co.za> Ned Deily added the comment: Good to hear you have worked around the crash. Regarding keyboard accelerators, I'm not aware of any 3.7.1 regressions but there could be issues with the bundled version of Tk 8.6.8. If you want to pursue the issue, please supply a test case that demonstrates the misbehavior and reopen this issue. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 11 23:50:29 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Nov 2018 04:50:29 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541998229.52.0.788709270274.issue34864@psf.upfronthosting.co.za> Ned Deily added the comment: By default, macOS installers just install the files included in a package. For macOS Python installer packages, the problem arises if a particular file is deleted or renamed in a maintenance release and a user has already installed an earlier version of that release family. It's possible for a post-install script to be added to the macOS installer to deal with particular files but that doesn't happen automatically. On Linux and other OSes, it would depend how the third-party distributor's packaging system works; some would detect a changed or missing file name, some likely wouldn't. And there's always the possibility that third-party packages or users are using or modifying standard library files. It's just best to avoid the problem altogether unless there is some really compelling reason. Of course renames or deletes for the initial release of a feature branch (e.g. 3.8.0) generally aren't a problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 00:06:14 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 05:06:14 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. Message-ID: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> New submission from Terry J. Reedy : 'maxOS' is Apple's current name for the Mac operating system. See https://en.wikipedia.org/wiki/MacOS, Contents, Release History. The module name macosx.py is currently left as is. Within that, 'Mac OS X' is correct for 10.6 for 10.8. ---------- assignee: terry.reedy components: IDLE messages: 329713 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: use 'macOS' where appropriate. type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 00:07:28 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 05:07:28 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1541999248.61.0.788709270274.issue34864@psf.upfronthosting.co.za> Terry J. Reedy added the comment: See #35213 for 'macOS' changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 00:08:23 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 05:08:23 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1541999303.05.0.788709270274.issue35213@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This issue is a spinoff of #34864. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 00:23:58 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 05:23:58 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542000238.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +9745 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 00:49:51 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Nov 2018 05:49:51 +0000 Subject: [issue20198] xml.etree.ElementTree.ElementTree.write attribute sorting In-Reply-To: <1389231308.67.0.0933451284696.issue20198@psf.upfronthosting.co.za> Message-ID: <1542001791.18.0.788709270274.issue20198@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: dictionary's insertion order is preserved in 3.6 and above. Hence sorting by lexical order was removed in issue34160 and there is a discussion in the same issue to add an option to provide sorted output. As part of triaging I propose closing this issue since the changes were made in issue34160. $ ./python.exe Python 3.8.0a0 (heads/master:cd449806fa, Nov 12 2018, 09:51:24) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element, tostring >>> from collections import OrderedDict >>> e = Element("tag", OrderedDict([("a", "a"), ("c", "c"), ("b", "b")])) >>> tostring(e) b'' >>> e = Element("tag", dict([("a", "a"), ("c", "c"), ("b", "b")])) >>> tostring(e) b'' ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 01:02:28 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 06:02:28 +0000 Subject: [issue34864] In Idle, Mac tabs make editor status line disappear. In-Reply-To: <1538422572.97.0.545547206417.issue34864@psf.upfronthosting.co.za> Message-ID: <1542002548.71.0.788709270274.issue34864@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Changing only master could make backports difficult to impractical. (Pure module name changes would be an exception if gits keep track of them and reverses them for a backport.) If a module is touched, user changes to that module get wiped out when the module is replaced. Aside from that, most of idlelib was declared private and 'subject to change' to allow refactoring. The only problem I have heard about is that 3.6 broke IDLEX (as I expected). IDLEX which made changes far beyond the narrow extension protocol. Roger solved that by incorporating a private copy of 3.5 IDLE with whatever modifications he wants. This is exactly what Nick said people should do, in the 3.6 alpha discussion, if they wanted frozen IDLE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 01:39:24 2018 From: report at bugs.python.org (Tal Einat) Date: Mon, 12 Nov 2018 06:39:24 +0000 Subject: [issue35196] IDLE text squeezer is too aggressive and is slow In-Reply-To: <1541757652.98.0.788709270274.issue35196@psf.upfronthosting.co.za> Message-ID: <1542004764.23.0.788709270274.issue35196@psf.upfronthosting.co.za> Tal Einat added the comment: > By the way, I really appreciate the work you all are putting into IDLE. It can definitely benefit from some love and attention. Thanks for the kind words, Raymond! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 01:42:38 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Nov 2018 06:42:38 +0000 Subject: [issue35151] Python 2 xml.etree.ElementTree documentation tutorial uses undocumented arguments In-Reply-To: <1541204418.39.0.788709270274.issue35151@psf.upfronthosting.co.za> Message-ID: <1542004958.88.0.788709270274.issue35151@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 01:49:01 2018 From: report at bugs.python.org (Tal Einat) Date: Mon, 12 Nov 2018 06:49:01 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542005341.44.0.788709270274.issue33196@psf.upfronthosting.co.za> Tal Einat added the comment: On Win10 I've also failed to reproduce the reported issue with the supplied script. I tried with Python versions 3.6.3, 3.7.0, and a recent build of the master branch (to be 3.8). Can someone try to reproduce this on Fedora? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 01:55:45 2018 From: report at bugs.python.org (Tal Einat) Date: Mon, 12 Nov 2018 06:55:45 +0000 Subject: [issue21603] IDLE: Document SaveAs extension display on Mac In-Reply-To: <1401349272.89.0.982652468131.issue21603@psf.upfronthosting.co.za> Message-ID: <1542005745.79.0.788709270274.issue21603@psf.upfronthosting.co.za> Tal Einat added the comment: +1 for closing this either way, preferably with a note in the docs. I'd add the notes about extensions in one set of parenthesis at the end, but that's likely just a matter of taste. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 02:05:32 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Nov 2018 07:05:32 +0000 Subject: [issue31541] Mock called_with does not ensure self/cls argument is used In-Reply-To: <1505986548.45.0.223796234627.issue31541@psf.upfronthosting.co.za> Message-ID: <1542006332.19.0.788709270274.issue31541@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: mock can only verify if the function is called with the correct number of arguments as you have passed spec. It doesn't verify whether the function implementation is correct like calling Something.foobar() because it's not designed to verify the function implementation. It wouldn't raise an exception even when self.foo(1, 2) is called inside x.bar because runtime code is not executed and only the signature is checked with mock. I think this is an expected behavior and not a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 02:17:05 2018 From: report at bugs.python.org (Ayappan) Date: Mon, 12 Nov 2018 07:17:05 +0000 Subject: [issue35198] Build issue while compiling cpp files in AIX In-Reply-To: <1541776845.13.0.788709270274.issue35198@psf.upfronthosting.co.za> Message-ID: <1542007025.69.0.788709270274.issue35198@psf.upfronthosting.co.za> Ayappan added the comment: The PR 10437 worked !!!. Now i am able to compile pandas-0.23.4 Michael Felt, About the re-declaration issues you are facing, that is because of the "#define _LARGE_FILES 1" in pyconfig-ppc64.h file. For 64bit build we actually don't need it. For 32bit build, we need it and also we have to pass the flag "-D_LARGE_FILES" through the _sysconfigdata_m_aix6_.py , otherwise one will get this re-declaration error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 02:26:35 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 07:26:35 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled Message-ID: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> New submission from Gregory P. Smith : clang's memory sanitizer (-fsanitize=memory) turns up useful problems in code. I'm working on getting a CPython buildbot running it setup but would like our build to be cleaner to start with before I run that. These are the initial fixes required for most of CPython to pass in an msan build. We've been using these with our interpreters at Google. (PR coming) ---------- assignee: gregory.p.smith components: Build, Extension Modules, Interpreter Core, Tests messages: 329723 nosy: gregory.p.smith, twouters priority: normal severity: normal stage: patch review status: open title: Get the test suite passing with clang Memory Sanitizer enabled type: security versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 02:29:41 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 07:29:41 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542007781.28.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +9746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 03:25:58 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 08:25:58 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542011158.45.0.788709270274.issue35213@psf.upfronthosting.co.za> St?phane Wirtel added the comment: @terry, I suppose you wanted to say "macOs" and not "maxOs" ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 03:50:08 2018 From: report at bugs.python.org (paul) Date: Mon, 12 Nov 2018 08:50:08 +0000 Subject: [issue35215] Replacing CPython memory allocation Message-ID: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> New submission from paul : Hi all, I am trying to replace the version of malloc/free...etc with my own function suit. I am have issues with loading the initial library setup. I am looking for wisdom from the community as to why this may be the case. Facts: - i just grabbed the latest cpython repo - my memory suit seem to be working from independent testing on other code - i am working on linux - i went into obmalloc.c and replaced the malloc, free, realloc, calloc with my own functions. - i changed the mmap/unmap to use my malloc and free in obmalloc.c - my allocated produces aligned allocations. - i dump the exceptions text being generated to see what is happening: EXCEPTION:: module 'sys' has no attribute '__file__' EXCEPTION:: type object 'BuiltinImporter' has no attribute '_ORIGIN' EXCEPTION:: module 'sys' has no attribute '__cached__' EXCEPTION:: module 'sys' has no attribute '__path__' EXCEPTION:: module 'builtins' has no attribute '__file__' EXCEPTION:: type object 'BuiltinImporter' has no attribute '_ORIGIN' EXCEPTION:: module 'builtins' has no attribute '__cached__' EXCEPTION:: module 'builtins' has no attribute '__path__' EXCEPTION:: module '_frozen_importlib' has no attribute '__file__' EXCEPTION:: type object 'FrozenImporter' has no attribute '_ORIGIN' EXCEPTION:: module '_frozen_importlib' has no attribute '__cached__' EXCEPTION:: module '_frozen_importlib' has no attribute '__path__' EXCEPTION:: module '_imp' has no attribute '__file__' EXCEPTION:: type object 'BuiltinImporter' has no attribute '_ORIGIN' EXCEPTION:: module '_imp' has no attribute '__cached__' EXCEPTION:: module '_imp' has no attribute '__path__' EXCEPTION:: name '_bootstrap' is not defined EXCEPTION:: name '_bootstrap' is not defined EXCEPTION:: name '_bootstrap' is not defined EXCEPTION:: name '_bootstrap' is not defined Fatal Python error: initfsencoding: failed to get the Python codec of the filesystem encoding Traceback (most recent call last): File "/home/paul/fresh_cpython/debug/../Lib/encodings/__init__.py", line 31, in File "", line 989, in _find_and_load File "", line 973, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 773, in exec_module File "", line 909, in get_code File "", line 966, in get_data OSError: [Errno 14] Bad address Aborted ---------- components: Library (Lib) messages: 329725 nosy: paul.harvey at rakuten.com priority: normal severity: normal status: open title: Replacing CPython memory allocation type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 03:53:50 2018 From: report at bugs.python.org (paul) Date: Mon, 12 Nov 2018 08:53:50 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542012830.91.0.788709270274.issue35215@psf.upfronthosting.co.za> paul added the comment: I suspect that this _bootstrap library is not being loaded correctly, and i can only assume that this is somehow because of my memory suit, but i am not really sure where to start hunting, as there is a lot of code. My goal is just to replace malloc. If there is a better way or i am making some wrong assumption, please let me know. Best, Paul ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 05:02:19 2018 From: report at bugs.python.org (Dexter) Date: Mon, 12 Nov 2018 10:02:19 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present In-Reply-To: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> Message-ID: <1542016939.15.0.788709270274.issue35203@psf.upfronthosting.co.za> Dexter added the comment: Sadly due to the secure environment I'm unable to attach the log. The exact error is: "You must be an Administrator to remove this application. To remove this application you can log on as an Administrator, or contact your technical support group for assistance." This is when installing to an arbitrary folder under my control. This is exactly what happens with the 3.5 installer which I also need because of third party apps with hard coded pyenv versions. The difference is that I can simply un-tick the launcher for all users box to allow the install. Given that this is for a specific third party app I don't actually have any need of the launcher knowing about this version at all. If you can tell me what part of the installer log is of interest I may be able to send an anonymised snippet. The error code is: 0x80070643 - Fatal Error During Installation. The point in the log where I see an error is: Error 0x80070643: Failed to uninstall MSI package. Error 0x80070643: Failed to execute MSI package. Error 0x80070643: Failed to configure per-machine MSI package. Applied execute package: core_AllUsers, result: 0x80070643, restart: None Error 0x80070643: Failed to execute MSI package. This is just after: "Verified existing payload: pip_JustForMe" I'm not quite sure what you mean though. What is the difference between "the launcher will be installed at the end of setup" and "the installer is going to try and install the launcher" if you mean it's a separate process that'll still never work for a restricted environment like this. It's basically a problem that the "for all users (requires elevation)" tickbox is selected. The launcher but not for all users might work but the fact that I can't un-tick something that says it requires elevation when I can't have elevation is a full blocker no matter what. Also under advanced options for Python itself I can un-tick the for all users just not for the launcher. The specific fail point is not exactly an upgrade it claims it doesn't have permission to uninstall something. Given that the launcher is the only thing I can't un-tick and launcher only fails in the same way I'm assuming it's the all-users launcher. But yeah I'm in a situation where I will never have permission to uninstall nor upgrade nor modify that file in any way so having it force an upgrade means I can't install the newer Python versions. I had the same issue in 3.5 but there the InstallLauncherAllUsers=0 InstallAllUsers=0 flags were sufficient to allow an isolated install. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 07:19:11 2018 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Van_Rompay?=) Date: Mon, 12 Nov 2018 12:19:11 +0000 Subject: [issue35216] misleading error message from shutil.copy() Message-ID: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> New submission from C?dric Van Rompay : When calling `shutil.copy('file.txt', 'not_here/')`, if directory `not_here/` does not exist, the raised error is: IsADirectoryError: [Errno 21] Is a directory: 'not_here/' If the intent of the user was to copy a file in a directory but the user forgot to create the destination directory, this can be very misleading, as the error tends to indicate that the directory exists. It happened to me and I was thinking "yes it's a directory, then what? that's exactly what I want,copy to this directory!" when the problem was that I forgot to create the destination directory. I would suggest to catch the `IsADirectoryError` in shutil.copyfile() (at `open(dst, 'wb')`) and raise instead an error saying something like "destination is a directory AND this directory does not exists". ---------- components: Library (Lib) messages: 329728 nosy: cedricvanrompay priority: normal severity: normal status: open title: misleading error message from shutil.copy() type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 08:23:21 2018 From: report at bugs.python.org (=?utf-8?b?6Zu25qy454m5?=) Date: Mon, 12 Nov 2018 13:23:21 +0000 Subject: [issue35217] REPL history is broken when python is invoked with cmd /c Message-ID: <1542029001.03.0.788709270274.issue35217@psf.upfronthosting.co.za> New submission from ??? : Windows 7 x64 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] Steps to reproduce: 1. Create a script: ``` from subprocess import run run(["cmd.exe", "/c", "python"]) run(["python"]) run("python", shell=True) ``` 2. Run the script. Actual result: The script will invoke Python REPL 3 times. The first and the third REPL don't save the command history. Pressing up/down arrows would clear the entire line. Pressing F7 has no effect. The second REPL works fine. Expected result: Command history should work in all instances. ---------- components: Windows messages: 329729 nosy: paul.moore, steve.dower, tim.golden, zach.ware, ??? priority: normal severity: normal status: open title: REPL history is broken when python is invoked with cmd /c type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 08:25:16 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Nov 2018 13:25:16 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542029116.52.0.788709270274.issue35216@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Agreed this is confusing. Is this a Linux specific error? Trying this on Mac gives me a different error code and exception. # Mac $ ./python.exe Python 3.8.0a0 (heads/master:cd449806fa, Nov 12 2018, 09:51:24) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copy('/tmp/a.py', 'Lib12/') Traceback (most recent call last): File "", line 1, in File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/shutil.py", line 385, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/shutil.py", line 240, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: 'Lib12/' # Ubuntu ./python Python 3.8.0a0 (heads/master:dce345c51a, Nov 12 2018, 13:01:05) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copy('/tmp/a.py', 'Lib12/') Traceback (most recent call last): File "", line 1, in File "/home/karthi/cpython/Lib/shutil.py", line 386, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/home/karthi/cpython/Lib/shutil.py", line 241, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: IsADirectoryError: [Errno 21] Is a directory: 'Lib12/' ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 08:31:43 2018 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Nov 2018 13:31:43 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1542029503.31.0.788709270274.issue35207@psf.upfronthosting.co.za> Stefan Krah added the comment: I just want to add one more voice for allowing the status quo: C, OCaml, SML, Haskell allow the assignment, Ruby disallows it. The ML family must allow it, since "let (x) = 10" is pattern matching under the hood, and (10) = 10. In C (gcc, clang at least, I didn't check the standard) it may be convenience. Python's assignment unpacking is similar to pattern matching, so while the construct is surprising at first, I think it's the right thing to do. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 09:18:24 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 12 Nov 2018 14:18:24 +0000 Subject: [issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s In-Reply-To: <1527682955.69.0.682650639539.issue33695@psf.upfronthosting.co.za> Message-ID: <1542032304.39.0.788709270274.issue33695@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: New changeset 19c46a4c96553b2a8390bf8a0e138f2b23e28ed6 by Giampaolo Rodola in branch 'master': bpo-33695 shutil.copytree() + os.scandir() cache (#7874) https://github.com/python/cpython/commit/19c46a4c96553b2a8390bf8a0e138f2b23e28ed6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 09:19:18 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 12 Nov 2018 14:19:18 +0000 Subject: [issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s In-Reply-To: <1527682955.69.0.682650639539.issue33695@psf.upfronthosting.co.za> Message-ID: <1542032358.82.0.788709270274.issue33695@psf.upfronthosting.co.za> Change by Giampaolo Rodola' : ---------- assignee: -> giampaolo.rodola resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 09:38:21 2018 From: report at bugs.python.org (keeely) Date: Mon, 12 Nov 2018 14:38:21 +0000 Subject: [issue35218] Impossible to round-trip decompress -> compress zipfiles with Python 3 due to losing flag_bits Message-ID: <1542033501.3.0.788709270274.issue35218@psf.upfronthosting.co.za> New submission from keeely : Python 2.7 allows one to capture from one file a list of ZipInfo objects, and then recreate a new file using those ZipInfo objects. The same thing appears to be impossible with Python 3 without resorting to monkey-patches because of a line of code in the writestr() code path ignoring the passed in value of ZipInfo and overwritting it with zeros. See: https://github.com/python/cpython/blob/master/Lib/zipfile.py#L1567 See also a possible solution at: https://stackoverflow.com/questions/53254622/zipfile-header-language-encoding-bit-set-differently-between-python2-and-python3 ---------- components: Library (Lib) messages: 329733 nosy: keeely priority: normal severity: normal status: open title: Impossible to round-trip decompress -> compress zipfiles with Python 3 due to losing flag_bits type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 09:49:01 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 14:49:01 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542034141.79.0.788709270274.issue35216@psf.upfronthosting.co.za> St?phane Wirtel added the comment: You have the issue with the built-in 'open' function. ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 09:59:28 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 14:59:28 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542034768.23.0.788709270274.issue35216@psf.upfronthosting.co.za> St?phane Wirtel added the comment: This error is specific to the C-API and not to Python, here is an example. #include #include #include #include #include int main(int argc, char **argv, char **environ) { int fd; fd = open("/tmp/toto/", O_CREAT); printf("file descriptor: %d\n", fd); printf(strerror(errno)); close(fd); return 0; } ./a.out file descriptor: -1 Is a directory ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:19:40 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 15:19:40 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542035980.28.0.788709270274.issue35216@psf.upfronthosting.co.za> St?phane Wirtel added the comment: @vstinner & @serhiy What do you think about this issue? For the same POSIX syscall (open) we get 2 different values for the error, 2 on macOS and EISDIR with Linux. Is a bug in Python or with the compliance of the operating system and the POSIX norm? Thank you ---------- nosy: +serhiy.storchaka, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:24:15 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 15:24:15 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542036255.05.0.788709270274.issue35215@psf.upfronthosting.co.za> St?phane Wirtel added the comment: You have the issue with your functions, not with Python. Are you sure you do not have an issue with your code? ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:26:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 15:26:01 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542036361.22.0.788709270274.issue35215@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:31:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 15:31:47 +0000 Subject: [issue32264] move pygetopt.h into internal/ In-Reply-To: <1512857323.9.0.213398074469.issue32264@psf.upfronthosting.co.za> Message-ID: <1542036707.49.0.788709270274.issue32264@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:39:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 15:39:46 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1542037186.45.0.788709270274.issue35177@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, the Yield warning made its come back :-( Example: import.c c:\program files (x86)\windows kits\10\include\10.0.17134.0\um\winbase.h(102): warning C4005: 'Yield': macro redefinition [C:\projects\cpython\PCbuild\pythoncore.vcxproj] c:\projects\cpython\include\python-ast.h(549): note: see previous definition of 'Yield' ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 10:53:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 15:53:43 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542038023.2.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 621cebe81b1e6c8de10425955bf532d31ee4df42 by Victor Stinner in branch 'master': bpo-35081: Rename internal headers (GH-10275) https://github.com/python/cpython/commit/621cebe81b1e6c8de10425955bf532d31ee4df42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:09:37 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Nov 2018 16:09:37 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1542038977.87.0.788709270274.issue35207@psf.upfronthosting.co.za> Guido van Rossum added the comment: Let's close this already. It won't happen. Sorry for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:25:49 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 16:25:49 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542039949.19.0.788709270274.issue35213@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Whoops, 'macOS', as in the title and PR. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:33:25 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Nov 2018 16:33:25 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542040405.97.0.788709270274.issue35213@psf.upfronthosting.co.za> St?phane Wirtel added the comment: ;-) just a joke. I have reviewed your PR, but do you count with the occurences of "OS X", it's the abbreviation of "MacOS X"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:34:13 2018 From: report at bugs.python.org (Dragoljub) Date: Mon, 12 Nov 2018 16:34:13 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542040453.88.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: @Vstinner, Any way you can help test out a config setting to avoid the locale changes on Python 2.7.0a4+? It is currently causing the isdigit() low-level function to call the local-specific function on windows and update locals each call slowing down CSV Paring on Windows 3.5X How can we configure python to not be different than 3.6.7 when it come to locale behavior? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:41:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 16:41:44 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542040904.43.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9748 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:44:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 16:44:23 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542041063.85.0.788709270274.issue29564@psf.upfronthosting.co.za> STINNER Victor added the comment: Example: --- import warnings import tracemalloc #tracemalloc.start(5) # always log ResourceWarning messages warnings.simplefilter("always", ResourceWarning) def func(): f = open(__file__) # emit ResourceWarning f = None func() --- Output with Python 3.7: --- $ python3 script.py script.py:11: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'> f = None --- Output with my attached PR 10486: --- $ python3 script.py script.py:11: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'> f = None ResourceWarning: Enable tracemalloc to get the object allocation traceback --- Finally, if tracemalloc is enabled: --- $ ./python -X tracemalloc=5 script.py script.py:11: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'> f = None Object allocated at (most recent call last): File "script.py", lineno 12 func() File "script.py", lineno 9 f = open(__file__) --- ---------- resolution: not a bug -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 11:50:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Nov 2018 16:50:20 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542041420.44.0.788709270274.issue35195@psf.upfronthosting.co.za> STINNER Victor added the comment: Can someone please try to write an example which only uses the stdlib? > The culprit is the isdigit function called in the parsers extension module. What are these extensions? Where do them come from? > Any way you can help test out a config setting to avoid the locale changes on Python 3.7.0a4+? (I fixed 2.7 => 3.7) I don't understand which "locale changes" you are talking about. You can change the locale using locale.setlocale(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 12:00:25 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 12 Nov 2018 17:00:25 +0000 Subject: [issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled In-Reply-To: <1492073709.93.0.33740565749.issue30064@psf.upfronthosting.co.za> Message-ID: <1542042025.35.0.788709270274.issue30064@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset 74387926072abf338a4c1cec1bf0501fc65bbee5 by Andrew Svetlov in branch 'master': bpo-30064: Refactor sock_* asyncio API (#10419) https://github.com/python/cpython/commit/74387926072abf338a4c1cec1bf0501fc65bbee5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 12:02:04 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 12 Nov 2018 17:02:04 +0000 Subject: [issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled In-Reply-To: <1492073709.93.0.33740565749.issue30064@psf.upfronthosting.co.za> Message-ID: <1542042124.22.0.788709270274.issue30064@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 12:57:32 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 17:57:32 +0000 Subject: [issue35219] macOS 10.14 High Sierra crashes in multiprocessing Message-ID: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : As we're beginning to roll out macOS 10.14 High Sierra, we're seeing an increase in core files inside /cores. This can consume a ton of disk space if you have coredumps enabled. I don't have a short reproducer yet, but we believe this is related to changes in macOS behavior around fork(). Here are some clues: https://github.com/ansible/ansible/issues/32499#issuecomment-341578864 https://stackoverflow.com/questions/50168647/multiprocessing-causes-python-to-crash-and-gives-an-error-may-have-been-in-progr/52230415#52230415 http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html ---------- messages: 329747 nosy: barry priority: normal severity: normal status: open title: macOS 10.14 High Sierra crashes in multiprocessing versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 13:11:16 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 18:11:16 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542046276.0.0.788709270274.issue35213@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The history of names for 10.X, from the reference above (which also has nicknames, like 'Mavericks' and 'Mohave', which I believe we do not use). 10.0 to 10.7: Mac OS X (space or spaces sometime left out, as in macosx) 10.8 to 10.13: OS X (2012, ditto) 10.14 to (current) 10.16 (2016) AFAIK, the current Mac installers support either 10.6+ or 10.9+. The macosx references to 'Mac OS X 10.6' and 'OS X 10.7 and 10.8' are properly not changed. 'OS X' in pyshell.py is removed in PR 10464. The most recent item in NEWS.txt using 'OS X' is for #27310, June 2016, by Ned, who used 'OS X'. So no changes to NEWS.txt or NEWS2.txt. ** Ned ** Should 'OS X Aqua Tk' be changed to 'macOS Aqua Tk' or 'macOS (OS X) Aqua Tk'? In other words, is 'OS X' here a replaceable noun adjective or an integral part of a proper name? The PR did the 2nd replacement in config.py, since the comment is about the 'IDLE Classic OSX' keyset, but I deferred the change in mainmenu.py. Same issue with 'OS X Cocoa Tk 8.5' in editor.py. Editor.py also has "Some OS X systems have only one mouse button". It seems to me that 'Mac' would be a better replacement that 'macOS' as the mouse is part of the hardware system, not the OS software. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 13:16:02 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 12 Nov 2018 18:16:02 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542046562.63.0.788709270274.issue35213@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The 4th line above should include 'macOS'. 10.14 to current 10.16: macOS (2016) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 14:28:45 2018 From: report at bugs.python.org (Dmitry Shachnev) Date: Mon, 12 Nov 2018 19:28:45 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1542050925.41.0.788709270274.issue22543@psf.upfronthosting.co.za> Change by Dmitry Shachnev : ---------- nosy: +mitya57 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 15:07:26 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 20:07:26 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542053246.69.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 1584a0081500d35dc93ff88e5836df35faf3e3e2 by Gregory P. Smith in branch 'master': bpo-35214: Initial clang MemorySanitizer support (GH-10479) https://github.com/python/cpython/commit/1584a0081500d35dc93ff88e5836df35faf3e3e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 15:29:36 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 20:29:36 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542054576.03.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 15:45:18 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Mon, 12 Nov 2018 20:45:18 +0000 Subject: [issue35220] delete "how do I emulate os.kill" section in Windows FAQ Message-ID: <1542055518.86.0.788709270274.issue35220@psf.upfronthosting.co.za> New submission from Mathieu Dupuy : That section is a tip on how to kill process on Windows for Python prior to 2.7 and 3.2. 3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been needed for supported versions of Python for more than 5 years. Beside not being needed anymore for a long time, when I read it with the eyes of a Python profane, it makes Python looks bad, like a language from the pasts with warts you need to circumvent. Let's delete that. ---------- assignee: docs at python components: Documentation messages: 329751 nosy: deronnax, docs at python priority: normal pull_requests: 9750 severity: normal status: open title: delete "how do I emulate os.kill" section in Windows FAQ type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:23:34 2018 From: report at bugs.python.org (keeely) Date: Mon, 12 Nov 2018 21:23:34 +0000 Subject: [issue35218] decompressing and then re-compressing zipfiles with Python 3 zipfile loses flag_bits In-Reply-To: <1542033501.3.0.788709270274.issue35218@psf.upfronthosting.co.za> Message-ID: <1542057814.87.0.788709270274.issue35218@psf.upfronthosting.co.za> Change by keeely : ---------- title: Impossible to round-trip decompress -> compress zipfiles with Python 3 due to losing flag_bits -> decompressing and then re-compressing zipfiles with Python 3 zipfile loses flag_bits _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:27:00 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 21:27:00 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542058020.68.0.788709270274.issue35219@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- title: macOS 10.14 High Sierra crashes in multiprocessing -> macOS 10.14 Mojave crashes in multiprocessing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:27:14 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 21:27:14 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542058034.94.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: That should of course be 10.14 Mojave. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:34:22 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:34:22 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542058462.13.0.788709270274.issue35219@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Apparently setting the env variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES should fix some fork-related changes. Have you tried already doing this? Does it change the behaviour of the errors in any way? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:35:48 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:35:48 +0000 Subject: [issue35207] Disallow expressions like (a) = 42 In-Reply-To: <1541823198.59.0.788709270274.issue35207@psf.upfronthosting.co.za> Message-ID: <1542058548.69.0.788709270274.issue35207@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:36:07 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 21:36:07 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542058462.13.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <57CC83F3-6E4E-4010-AB8A-E527229742B4@python.org> Barry A. Warsaw added the comment: On Nov 12, 2018, at 13:34, Pablo Galindo Salgado wrote: > Apparently setting the env variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES should fix some fork-related changes. Have you tried already doing this? Does it change the behaviour of the errors in any way? Yes, sorry I got distracted before I could add a comment about this. I have indeed tested this and it does prevent the core files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:38:19 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:38:19 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542058699.18.0.788709270274.issue35215@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Hi @paul, have you already checked https://docs.python.org/3/c-api/memory.html#customize-memory-allocators? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:38:37 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:38:37 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542058717.56.0.788709270274.issue35215@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg329755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:38:45 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:38:45 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542058725.07.0.788709270274.issue35215@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Hi @paul, have you already checked https://docs.python.org/3/c-api/memory.html#customize-memory-allocators ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:42:47 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:42:47 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542058967.08.0.788709270274.issue35219@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Apparently, GitLab have a more permanent solution around this by enabling the Objective-C runtime before any forking happens: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16649/diffs ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:45:15 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Nov 2018 21:45:15 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542059115.53.0.788709270274.issue35219@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: This can a duplicate of https://bugs.python.org/issue33725 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:48:05 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 21:48:05 +0000 Subject: [issue33725] High Sierra hang when using multi-processing In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542059285.86.0.788709270274.issue33725@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:48:26 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 21:48:26 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542059306.89.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1 by Gregory P. Smith in branch '3.7': [3.7] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10492) https://github.com/python/cpython/commit/5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:50:02 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 21:50:02 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542059402.39.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'm not sure whether it's a duplicate or not, since in my case it doesn't hang, but instead core dumps. It's seems like the reasoning given in the Ruby bug is relevant to Python too, so maybe we should adopt the same workaround. For our internal projects, I'm probably just going to set the environment variable for now. I'd love to know what Ned and Ronald thing, thus cc'ing them. ---------- nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:51:08 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 21:51:08 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542059468.41.0.788709270274.issue35216@psf.upfronthosting.co.za> Julien Palard added the comment: Using `cp` on Debian Buster I'm having a better error message: $ touch foo $ cp foo bar/ cp: failed to access 'bar/': Not a directory >From copy.c (from Debian coreutils): /* Improve quality of diagnostic when a nonexistent dst_name ends in a slash and open fails with errno == EISDIR. */ if (dest_desc < 0 && dest_errno == EISDIR && *dst_name && dst_name[strlen (dst_name) - 1] == '/') dest_errno = ENOTDIR; ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:57:54 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 21:57:54 +0000 Subject: [issue35221] Enhance venv activate commands readability Message-ID: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> New submission from Julien Palard : I'd like to enhance the readability of the "venv activation commands" in library/venv.html, my students are often confused by it, sometimes they copy the angle brackets, sometime even the prompt. I don't think we can fix everything, but maybe enhance a bit, I ran a few tests. Before modification: https://screenshotscdn.firefoxusercontent.com/images/77cf6612-1934-4a3b-9376-87a012a76bc3.png First try with a :file:, not better: https://screenshotscdn.firefoxusercontent.com/images/db4e1191-a740-4828-b53a-ccc4a8d33dae.png Second try, simply double backquotes: https://screenshotscdn.firefoxusercontent.com/images/d6be92a1-e4af-40f5-9281-d9c09d8a0908.png Third try using bold but it hurt the eyes: https://screenshotscdn.firefoxusercontent.com/images/6fb1026f-064b-41dd-822b-3b258e37a85e.png 4th try using simply capslock, maybe better: https://screenshotscdn.firefoxusercontent.com/images/9e9c3f7b-639c-4f26-abcc-20948e15a65d.png 5th try using capslock and italics, I like it: https://screenshotscdn.firefoxusercontent.com/images/b5ae5582-1706-4ea9-a702-910daf2c69bc.png Someone on #python-fr proposed https://framapic.org/XnBQZcJVRlZw/F05D7I8nSKd0.png (rendered from markdown in github). I like it but it would require a specific role to render bold-italic in code block. ---------- assignee: mdk components: Documentation messages: 329762 nosy: mdk priority: normal severity: normal status: open title: Enhance venv activate commands readability _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:58:02 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 21:58:02 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542059882.43.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 16:58:44 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 12 Nov 2018 21:58:44 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542059924.84.0.788709270274.issue35221@psf.upfronthosting.co.za> Julien Palard added the comment: Forgot to mention, the bold and italics one were done using unicode mathematical characters, they are not properly rendered in PDFs so we can't use them as is: https://mdk.fr/pdf.png ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:03:36 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 12 Nov 2018 22:03:36 +0000 Subject: [issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly In-Reply-To: <1428931053.68.0.491418357539.issue23930@psf.upfronthosting.co.za> Message-ID: <1542060216.22.0.788709270274.issue23930@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- keywords: +patch pull_requests: +9752 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:04:54 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Nov 2018 22:04:54 +0000 Subject: [issue33944] Deprecate and remove pth files In-Reply-To: <1541854207.44.0.788709270274.issue33944@psf.upfronthosting.co.za> Message-ID: <86135560-EDFC-4026-BFEA-1186B1228F0B@python.org> Barry A. Warsaw added the comment: On Nov 10, 2018, at 04:50, Ivan Pozdeev wrote: > In its .pth file, each such package will import the hook's module (which will cause the hook to be installed on the first import) and "register" its namespaces and/or dependencies with it. The hook will then calculate the required load order and enforce it upon import of any of the registered namespaces. I?m a little concerned about this approach because it means random third party modules can affect the global environment for your application, without knowing it. Since the hook installation happens at import time, and just depending on a library that has such a .pth file will install it, the end application will not have control over its global state. It?s not possible to know whether this is a serious problem, but in the past, global state changes are problematic when applications do not have control over it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:09:52 2018 From: report at bugs.python.org (skreft) Date: Mon, 12 Nov 2018 22:09:52 +0000 Subject: [issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr Message-ID: <1542060592.48.0.788709270274.issue35222@psf.upfronthosting.co.za> New submission from skreft : The docs (https://docs.python.org/3/library/email.util.html#email.utils.formataddr) say that formataddr is the inverse of parseaddr, however non-ascii email addresses are treated differently in both methods. parseaddr will return non-ascci addresses, whereas formataddr will raise a UnicodeError. Below is an example: In [1]: import email.utils as u In [2]: u.parseaddr('skreft+?and?@sudoai.com') Out[2]: ('', 'skreft+?and?@sudoai.com') In [3]: u.formataddr(u.parseaddr('skreft+?and?@sudoai.com')) --------------------------------------------------------------------------- UnicodeEncodeError Traceback (most recent call last) in () ----> 1 u.formataddr(u.parseaddr('skreft+?and?@sudoai.com')) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py in formataddr(pair, charset) 89 name, address = pair 90 # The address MUST (per RFC) be ascii, so raise a UnicodeError if it isn't. ---> 91 address.encode('ascii') 92 if name: 93 try: UnicodeEncodeError: 'ascii' codec can't encode character '\xf1' in position 7: ordinal not in range(128) ---------- components: email messages: 329765 nosy: barry, r.david.murray, skreft priority: normal severity: normal status: open title: email.utils.formataddr is not exactly the reverse of email.utils.parseaddr versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:10:59 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 12 Nov 2018 22:10:59 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542060659.8.0.788709270274.issue10486@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: The reference given in https://github.com/python/cpython/blob/b36b0a3765bcacb4dcdbf12060e9e99711855da8/Lib/http/server.py#L1074 is not accessible anymore. I think we should replace it by https://tools.ietf.org/html/rfc3875#section-4.1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:24:04 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 12 Nov 2018 22:24:04 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542061444.5.0.788709270274.issue35221@psf.upfronthosting.co.za> Steven D'Aprano added the comment: https://docs.python.org/3/library/venv.html > my students are often confused by it, sometimes they copy the angle brackets, sometime even the prompt. Learning to recognise placeholders and the prompt is an essential part of learning to code, and a stage that everyone has to go through. Replacing plain text markup with styled formatting doesn't change that, but it does make it harder for the blind or visually impaired who are using screen-readers, or those who prefer to use a plain text interface with no support for bold/italic. How do your enhancements look in w3m, links or linx? The current design renders nicely in plain text on links. (I haven't checked the other two.) > I ran a few tests. What sort of tests? Usability tests? What results did you get? > Someone on #python-fr proposed https://framapic.org/XnBQZcJVRlZw/F05D7I8nSKd0.png Link doesn't work for me. I get a blank page. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:33:35 2018 From: report at bugs.python.org (Lisa Roach) Date: Mon, 12 Nov 2018 22:33:35 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542062015.96.0.788709270274.issue35221@psf.upfronthosting.co.za> Lisa Roach added the comment: Using plain angle brackets is common placeholder notation, and I think changing it to something different might be confusing to those who are familiar with the pattern. I have also seen plenty of people copying and pasting the wrong things because of this notation, but I agree with Steven that it is a part of the learning process that we all go through. Perhaps just adding the line ' must be replaced by the path of the directory containing the virtual environment' would suffice to clarify? ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 17:57:52 2018 From: report at bugs.python.org (Oscar Esteban) Date: Mon, 12 Nov 2018 22:57:52 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1542063472.24.0.788709270274.issue22393@psf.upfronthosting.co.za> Oscar Esteban added the comment: I tried to reuse as much as I could from the patch, but it didn't solve the issue at first. I have changed the responsibility of identifying and prescribing a solution when a worker got killed. In the proposed patch, the thread handling results (i.e. tasks queued by one worker as done) was responsible. In the PR, the responsibility is reassigned to the thread handling workers (since, basically, one or more workers suddenly die). The patch defined a new BROKEN state that was assigned to the results handler thread. I transferred this behavior to the worker handler thread. But, I'm guessing that the BROKEN state should be assigned to the Pool object instead, to be fully semantic. Although that would require passing the reference to the object around and complicate unnecessarily the implementation. Happy to reconsider though. I added three tests, one that was present with the patch, a variation of it adding some wait before killing the worker, and the one that Francis Bolduc posted here (https://bugs.python.org/issue22393#msg294968). Please let me know whether any conversation about this bug should take place in GitHub, with the PR instead of here. Thanks a lot for the guidance, Antoine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 18:10:38 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 12 Nov 2018 23:10:38 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542064238.9.0.788709270274.issue10486@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, REMOTE_USER are present REMOTE_IDENT is not but I'm not sure it's worth adding. I can send a PR to add REMOTE_HOST and remove the condition for QUERY_STRING. Otherwise, I don't think the other environment variables should be added, they are implementation dependant and not defined in RFC 3875. Should we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 18:25:18 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 12 Nov 2018 23:25:18 +0000 Subject: [issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr In-Reply-To: <1542060592.48.0.788709270274.issue35222@psf.upfronthosting.co.za> Message-ID: <1542065118.92.0.788709270274.issue35222@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: This is indeed an issue with formataddr, it expects the input to be ascii encoded as RFC 2822 requires. Email is much more complicated though and has been internationalized, a summary of this work is available at https://en.wikipedia.org/wiki/Email_address#Internationalization. I think the check in formataddr is not desirable anymore and should be remove. I'm not sure wether the resulting value should be encoded using email.header or not. ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 18:34:30 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Mon, 12 Nov 2018 23:34:30 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542065670.9.0.788709270274.issue25438@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: It's been more than 3 years, since this was opened, but I will ask nevertheless. Should a PR maybe made for this issue? ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 18:44:13 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Nov 2018 23:44:13 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542066253.65.0.788709270274.issue25438@psf.upfronthosting.co.za> Gregory P. Smith added the comment: it still seems relevant, having better docs is always good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 18:50:38 2018 From: report at bugs.python.org (R. David Murray) Date: Mon, 12 Nov 2018 23:50:38 +0000 Subject: [issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr In-Reply-To: <1542060592.48.0.788709270274.issue35222@psf.upfronthosting.co.za> Message-ID: <1542066638.81.0.788709270274.issue35222@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the report, but parseaddr and formataddr are defined *only* for ASCII. In the port to python3, parseaddr sort-of-maybe-sometimes does the naively expected thing with non-ascii, but that's just an accident. We could have added a check for non-ascii to parseaddr during the python3 port, but we didn't think of it, and it is too late now since adding it would break otherwise working code even though that code is technically broken. So, for the defined API of parseaddr/formataddr, there is no bug here. As for handling non-ascii in email per your link: >>> from email.message import EmailMessage >>> from email.policy import default >>> m = EmailMessage(policy=default.clone(utf8=True)) >>> m['From'] = 'skreft+?and?@sudoai.com >>> bytes(m) b'From: skreft+\xc3\xb1and\xc3\xba at sudoai.com\n\n' (NB: in testing the above I discovered there is actually a recent bug in the serialization when utf8 is *False*: it does RFC2047 encoding of the username, which it should not do...instead it should raise an error. Feel free to open a bug report for that...) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:06:16 2018 From: report at bugs.python.org (Roffild) Date: Tue, 13 Nov 2018 00:06:16 +0000 Subject: [issue35223] Pathlib incorrectly merges strings. Message-ID: <1542067576.58.0.788709270274.issue35223@psf.upfronthosting.co.za> New submission from Roffild : Code: import os print(os.path.join("C:/123\\345", "\\", "folder///filename.bin")) import pathlib print(pathlib.PureWindowsPath("C:/123\\345", "\\", "folder///filename.bin")) Result: C:\folder///filename.bin C:\folder\filename.bin Expected result for Windows: C:\123\345\folder\filename.bin The number of slashes should be controlled by the library. Replacing / on \ should also depend on the OS. ---------- components: IO, Library (Lib), Windows messages: 329776 nosy: Roffild, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Pathlib incorrectly merges strings. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:10:33 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 00:10:33 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542067833.62.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 3b5b1c0931cd32253bbf2f3bd74e90ff821e026e by Gregory P. Smith in branch '3.6': [3.6] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10493) https://github.com/python/cpython/commit/3b5b1c0931cd32253bbf2f3bd74e90ff821e026e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:26:47 2018 From: report at bugs.python.org (paul) Date: Tue, 13 Nov 2018 00:26:47 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542068807.34.0.788709270274.issue35215@psf.upfronthosting.co.za> paul added the comment: Hi guys, First, thanks for the prompt replies. @matrixise: If there is i can't find it, but i am happy to accept it as a possibility. Equally, maybe there is an assumption about memory in the cpython implementation somewhere that goes against my memory allocator -> this is obviously not cpythons fault. The point of this 'issue' is to ask the community to suggest how i can go about finding where the problem is. As i said, there is a lot of code :) @pablogsal: Yeah. I had a look in there. In cpython, i have made all allocations from obmalloc use my memory allocation functions, including the arenas. Perhaps a starting point would be if anyone has ideas about how to go about debugging this?? best, Paul ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:27:20 2018 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 13 Nov 2018 00:27:20 +0000 Subject: [issue35223] Pathlib incorrectly merges strings. In-Reply-To: <1542067576.58.0.788709270274.issue35223@psf.upfronthosting.co.za> Message-ID: <1542068840.86.0.788709270274.issue35223@psf.upfronthosting.co.za> Eric V. Smith added the comment: As far as which path components are returned, I think this is working as designed. The documentation for os.path.join says: """ If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., r'\foo') is encountered. """ pathlib's documentation for creating PurePath objects says: """ When several absolute paths are given, the last is taken as an anchor (mimicking os.path.join()?s behaviour) """ ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:30:11 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 00:30:11 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542069011.31.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I've done a fair bit of testing and it seems rather inconsistent as to whether either of these work when added right before an explicit call to `os.fork()`: os.environ['OBJC_DISABLE_INITIALIZE_FORK_SAFETY'] = 'YES' ctyles.cdll.LoadLibrary('/System/Library/Frameworks/Foundation.framework/Foundation') Neither of these seems to reliably prevent the __NSPlaceholderDate warning, nor prevent the core dumps. The best I've been able to do is to prevent them by setting the environment variable *before* the parent process starts (i.e. outside of the Python code of the process). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:52:17 2018 From: report at bugs.python.org (Emily Morehouse) Date: Tue, 13 Nov 2018 00:52:17 +0000 Subject: [issue35224] PEP 572: Assignment Expressions Message-ID: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> New submission from Emily Morehouse : This issue will serve to track development and PRs for the implementation of PEP 572: Assignment Expressions. ---------- assignee: emilyemorehouse components: Interpreter Core messages: 329781 nosy: emilyemorehouse, gvanrossum, tim.peters priority: normal severity: normal status: open title: PEP 572: Assignment Expressions type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:59:55 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 00:59:55 +0000 Subject: [issue32492] C Fast path for namedtuple's property/itemgetter pair In-Reply-To: <1515089143.43.0.467229070634.issue32492@psf.upfronthosting.co.za> Message-ID: <1542070795.14.0.788709270274.issue32492@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:59:59 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 00:59:59 +0000 Subject: [issue32492] C Fast path for namedtuple's property/itemgetter pair In-Reply-To: <1515089143.43.0.467229070634.issue32492@psf.upfronthosting.co.za> Message-ID: <1542070799.52.0.788709270274.issue32492@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9754, 9755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 19:59:59 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 00:59:59 +0000 Subject: [issue32492] C Fast path for namedtuple's property/itemgetter pair In-Reply-To: <1515089143.43.0.467229070634.issue32492@psf.upfronthosting.co.za> Message-ID: <1542070799.78.0.788709270274.issue32492@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9754, 9755, 9756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:01:23 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 01:01:23 +0000 Subject: [issue32492] C Fast path for namedtuple's property/itemgetter pair In-Reply-To: <1515089143.43.0.467229070634.issue32492@psf.upfronthosting.co.za> Message-ID: <1542070883.33.0.788709270274.issue32492@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: -9756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:01:28 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 01:01:28 +0000 Subject: [issue32492] C Fast path for namedtuple's property/itemgetter pair In-Reply-To: <1515089143.43.0.467229070634.issue32492@psf.upfronthosting.co.za> Message-ID: <1542070888.46.0.788709270274.issue32492@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: -9755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:05:51 2018 From: report at bugs.python.org (skreft) Date: Tue, 13 Nov 2018 01:05:51 +0000 Subject: [issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr In-Reply-To: <1542060592.48.0.788709270274.issue35222@psf.upfronthosting.co.za> Message-ID: <1542071151.22.0.788709270274.issue35222@psf.upfronthosting.co.za> skreft added the comment: @r.david.murray where do you see that those functions are only defined for ascii? There's nothing in the online docs stating that and furthermore `formataddr` has supported non-ascii names since version 3.3. RFC 2822 is however mentioned in the docstrings. The fact that `formataddr` is not really the inverse warrants at least a note or clarification in the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:06:28 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 01:06:28 +0000 Subject: [issue35031] test_asyncio test_start_tls_server_1 fails in AMD64 FreeBSD CURRENT buildbots In-Reply-To: <1540044407.71.0.788709270274.issue35031@psf.upfronthosting.co.za> Message-ID: <1542071188.39.0.788709270274.issue35031@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:06:32 2018 From: report at bugs.python.org (Roffild) Date: Tue, 13 Nov 2018 01:06:32 +0000 Subject: [issue35223] Pathlib incorrectly merges strings. In-Reply-To: <1542067576.58.0.788709270274.issue35223@psf.upfronthosting.co.za> Message-ID: <1542071192.8.0.788709270274.issue35223@psf.upfronthosting.co.za> Roffild added the comment: It is necessary to assemble a single path from several lines depending on the OS. It is logical to expect behavior in Java. https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html Converts a path string, or a sequence of strings that when joined form a path string, to a Path. If more does not specify any elements then the value of the first parameter is the path string to convert. If more specifies one or more elements then each non-empty string, including first, is considered to be a sequence of name elements (see Path) and is joined to form a path string. The details as to how the Strings are joined is provider specific but typically they will be joined using the name-separator as the separator. For example, if the name separator is "/" and getPath("/foo","bar","gus") is invoked, then the path string "/foo/bar/gus" is converted to a Path. A Path representing an empty path is returned if first is the empty string and more does not contain any non-empty strings. My temporary fix is something like this: print("\\".join(["C:/123\\345", "\\", "folder///filename.bin"]).replace("/", "\\").replace("\\\\", "\\").replace("\\\\", "\\")) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:08:10 2018 From: report at bugs.python.org (Emily Morehouse) Date: Tue, 13 Nov 2018 01:08:10 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1542071290.81.0.788709270274.issue35224@psf.upfronthosting.co.za> Change by Emily Morehouse : ---------- keywords: +patch pull_requests: +9758 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:08:12 2018 From: report at bugs.python.org (Emily Morehouse) Date: Tue, 13 Nov 2018 01:08:12 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1542071292.77.0.788709270274.issue35224@psf.upfronthosting.co.za> Change by Emily Morehouse : ---------- keywords: +patch, patch pull_requests: +9758, 9759 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:20:06 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 01:20:06 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542072006.24.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Based on my testing, the environment variable has to be set before the parent process starts. Neither os.environ nor os.putenv seem to do the trick. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:24:44 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 01:24:44 +0000 Subject: [issue35031] test_asyncio test_start_tls_server_1 fails in AMD64 FreeBSD CURRENT buildbots In-Reply-To: <1540044407.71.0.788709270274.issue35031@psf.upfronthosting.co.za> Message-ID: <1542072284.34.0.788709270274.issue35031@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3f9fe53c98978955fea4e36456c784694e6458a8 by Miss Islington (bot) in branch '3.7': bpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011) https://github.com/python/cpython/commit/3f9fe53c98978955fea4e36456c784694e6458a8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:26:31 2018 From: report at bugs.python.org (Christoph Gohlke) Date: Tue, 13 Nov 2018 01:26:31 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542072391.35.0.788709270274.issue35195@psf.upfronthosting.co.za> Christoph Gohlke added the comment: > Can someone please try to write an example which only uses the stdlib? The simplest is to compare performance of the `windll.LoadLibrary('API-MS-WIN-CRT-STRING-L1-1-0.DLL')` function on Python 3.7.0a3 and 3.7.0a4, but that will mostly measure Python/ctypes overhead. I will post a minimal C extension instead. > What are these extensions? Where do them come from? The `isdigit` function is from the UCRT. The `parsers` Cython/C extension is part of the pandas wheel on PyPI. The context for this issue is at https://github.com/pandas-dev/pandas/issues/23516 > I don't understand which "locale changes" you are talking about. You can change the locale using locale.setlocale(). The `UCRT.isdigit` function, when run on Python >=3.7.0a4, calls the `_isdigit_l` function, which calls `_LocaleUpdate::_LocaleUpdate` (see the VS profiler output). ---------- nosy: +cgohlke _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:32:02 2018 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 13 Nov 2018 01:32:02 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1542072722.86.0.788709270274.issue35224@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:33:34 2018 From: report at bugs.python.org (Christoph Gohlke) Date: Tue, 13 Nov 2018 01:33:34 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542072814.88.0.788709270274.issue35195@psf.upfronthosting.co.za> Change by Christoph Gohlke : Added file: https://bugs.python.org/file47928/test_isdigit.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:36:51 2018 From: report at bugs.python.org (Christoph Gohlke) Date: Tue, 13 Nov 2018 01:36:51 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073011.12.0.788709270274.issue35195@psf.upfronthosting.co.za> Change by Christoph Gohlke : Added file: https://bugs.python.org/file47929/setup.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:39:54 2018 From: report at bugs.python.org (Dragoljub) Date: Tue, 13 Nov 2018 01:39:54 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073194.11.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: Here is a simple pure python example: digits = ''.join([str(i) for i in range(10)]*10000000) %timeit digits.isdigit() # --> 2X+ slower on python 3.7.1 Basically in Pandas C-code parser we call the isdigit() function for each number that is to be parsed. so 12345.6789 calls isdigt() 9 times to determine if this is a digit character that can be converted to a float. The problem is in the latest version of Python with locale updates isdigit() takes a locale argument that seems to be passed over and over slowing down this check. Is it possible that we disable any local passing from Python down to lower-level C code, or simply set the default locale to 'C' to keep it from thrashing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:41:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 01:41:05 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542073265.11.0.788709270274.issue29564@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2c07c493d2eb45101312e3eb3a77f94d0c9cad1f by Victor Stinner in branch 'master': bpo-29564: warnings suggests to enable tracemalloc (GH-10486) https://github.com/python/cpython/commit/2c07c493d2eb45101312e3eb3a77f94d0c9cad1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:45:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 01:45:23 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073523.45.0.788709270274.issue35195@psf.upfronthosting.co.za> STINNER Victor added the comment: > digits = ''.join([str(i) for i in range(10)]*10000000) > %timeit digits.isdigit() # --> 2X+ slower on python 3.7.1 This code calls: * (Python) str.isdigit() * unicode_isdigit_impl() * _PyUnicode_IsDigit() * _PyUnicode_ToDigit() which uses Python internal Unicode database This code doesn't depend on locales at all. It's pure Unicode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:45:32 2018 From: report at bugs.python.org (Christoph Gohlke) Date: Tue, 13 Nov 2018 01:45:32 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073532.69.0.788709270274.issue35195@psf.upfronthosting.co.za> Christoph Gohlke added the comment: I attached a minimal C extension module that can be used to demonstrate the performance degradation from Python 3.7.0a3 to 3.7.0a4. Build the extension with `py setup.py build_ext --inplace`, then run the following code on Python 3.7.0a3 to 3.7.0a4: ``` import time from test_isdigit import test_isdigit start_time = time.time() test_isdigit() print(time.time() - start_time) ``` On my Windows 10 Pro WS system, the timings are: Python 3.7.0a3: ~0.0156 Python 3.7.0a4: ~0.3281 I would expect that other locale aware functions in the UCRT are also affected but I have not tested that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:47:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 01:47:22 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073642.43.0.788709270274.issue35195@psf.upfronthosting.co.za> STINNER Victor added the comment: test_isdigit.c: Can you try to call locale.setlocale(locale.LC_CTYPE, "") before running your benchmark on Python 3.7.0? This issue may be related to bpo-34485. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:50:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 01:50:16 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073816.92.0.788709270274.issue35195@psf.upfronthosting.co.za> STINNER Victor added the comment: > This issue may be related to bpo-34485. I'm thinking to: New changeset 177d921c8c03d30daa32994362023f777624b10d by Victor Stinner in branch 'master': bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988) https://github.com/python/cpython/commit/177d921c8c03d30daa32994362023f777624b10d Oh, I only made this change in the future Python 3.8 (master branch). So this change may be unrelated. Note: Right now, my Windows VM is broken, so I cannot investigate this performance issue which seems to be specific to the msvcrt (libc of Microsoft VisualStudio). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:53:12 2018 From: report at bugs.python.org (Christoph Gohlke) Date: Tue, 13 Nov 2018 01:53:12 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542073992.04.0.788709270274.issue35195@psf.upfronthosting.co.za> Christoph Gohlke added the comment: > test_isdigit.c: Can you try to call locale.setlocale(locale.LC_CTYPE, "") before running your benchmark on Python 3.7.0? Yes, that slows down Python 3.7.0a3 to the 3.7.0a4 level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 20:56:09 2018 From: report at bugs.python.org (Windson Yang) Date: Tue, 13 Nov 2018 01:56:09 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542074169.49.0.788709270274.issue25438@psf.upfronthosting.co.za> Windson Yang added the comment: I will work on it today :D ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 21:00:10 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 02:00:10 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542074410.17.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'm still testing this solution, but it looks like if you set the environment variable, and then double fork, the granchild won't crash. Roughly: os.putenv('OBJC_DISABLE_INITIALIZE_FORK_SAFETY', 'YES') pid = os.fork() if pid == 0: subpid = os.fork() if subpid == 0: # I'm in a safe grandchild ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 21:07:54 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 02:07:54 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542074874.27.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Nope, actually double fork doesn't work. It's misleading because in my testing, the first invocation of the process causes the core dump, but subsequent runs do not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 21:59:25 2018 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 13 Nov 2018 02:59:25 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542077965.52.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Alex Gaynor : ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:02:52 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:02:52 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542078172.52.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:04:30 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 13 Nov 2018 03:04:30 +0000 Subject: [issue35225] test_faulthandler fails under ubsan Message-ID: <1542078270.77.0.788709270274.issue35225@psf.upfronthosting.co.za> New submission from Benjamin Peterson : The UBsan buildbot is failing test_faulthandler. We should either spread some __attribute__((no_sanitize_undefined)) around or make the tests skip. ====================================================================== FAIL: test_enable_fd (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 274, in test_enable_fd self.check_fatal_error(""" File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 108, in check_error output, exitcode = self.get_output(code, filename=filename, fd=fd) File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 73, in get_output self.assertEqual(output, '') AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != '' Diff is 2693 characters long. Set self.maxDiff to None to see it. ====================================================================== FAIL: test_enable_file (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 258, in test_enable_file self.check_fatal_error(""" File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 108, in check_error output, exitcode = self.get_output(code, filename=filename, fd=fd) File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 68, in get_output self.assertEqual(output, '') AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != '' Diff is 2693 characters long. Set self.maxDiff to None to see it. ====================================================================== FAIL: test_sigfpe (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 176, in test_sigfpe self.check_fatal_error(""" File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 110, in check_error self.assertRegex(output, regex) AssertionError: Regex didn't match: '^Fatal Python error: Floating point exception\n\nCurrent thread 0x[0-9a-f]+ \\(most recent call first\\):\n File "", line 3 in ' not found in 'Modules/faulthandler.c:1059:11: runtime error: division by zero\nFatal Python error: Floating point exception\n\nCurrent thread 0x00007f14c5e81740 (most recent call first):\n File "", line 3 in \nUndefinedBehaviorSanitizer:DEADLYSIGNAL\n==5027==ERROR: UndefinedBehaviorSanitizer: FPE on unknown address 0x006d000013a3 (pc 0x7f14c5355f9f bp 0x000002f485a0 sp 0x000002f698e8 T5027)\n #0 0x7f14c5355f9e in gsignal (/lib/x86_64-linux-gnu/libpthread.so.0+0x10f9e)\n #1 0x7f14c53560bf (/lib/x86_64-linux-gnu/libpthread.so.0+0x110bf)\n #2 0x829906 in faulthandler_sigfpe /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/./Modules/faulthandler.c:1059:11\n #3 0x4707c3 in _PyMethodDef_RawFastCallKeywords /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call.c\n #4 0x46e5d1 in _PyCFunction_FastCallKeywords /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call.c:730:14\n #5 0x656805 in call_function /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:4570:9\n #6 0x64b0d6 in _PyEval_EvalFrameDefault /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3164:23\n #7 0x6596be in _PyEval_EvalCodeWithName /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3946:14\n #8 0x6384ee in PyEval_EvalCodeEx /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3975:12\n #9 0x6384ee in PyEval_EvalCode /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:508\n #10 0x6e816e in run_mod /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:1030:9\n #11 0x6e816e in PyRun_StringFlags /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:954\n #12 0x6e80bc in PyRun_SimpleStringFlags /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:450:9\n #13 0x44db44 in pymain_run_command /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:293:11\n #14 0x44db44 in pymain_run_python /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1600\n #15 0x44db44 in pymain_main /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1758\n #16 0x44f29b in _Py_UnixMain /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1795:12\n #17 0x7f14c4ba72e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)\n #18 0x425499 in _start (/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/python+0x425499)\n\nUndefinedBehaviorSanitizer can not provide additional info.\n==5027==ABORTING' ---------------------------------------------------------------------- ---------- components: Build messages: 329797 nosy: benjamin.peterson priority: normal severity: normal status: open title: test_faulthandler fails under ubsan versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:04:54 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 03:04:54 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542078294.83.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:08:53 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 13 Nov 2018 03:08:53 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542078533.97.0.788709270274.issue35214@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Can we prefix MEMORY_SANITIZER with _Py_? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:16:43 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:16:43 +0000 Subject: [issue35215] Replacing CPython memory allocation In-Reply-To: <1542012608.34.0.788709270274.issue35215@psf.upfronthosting.co.za> Message-ID: <1542079003.98.0.788709270274.issue35215@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: > The point of this 'issue' is to ask the community to suggest how i can go about finding where the problem is. As I said, there is a lot of code :) Sadly, this tracker is to track bugs related to CPython. Modifying the interpreter to change the memory allocation scheme (replacing the code in obmalloc.c) is not supported, so I have to close this issue :( You can try to ask the question on some of the mailing lists (like python-dev) to see is someone can help you with this. I would advice to also provide some minimal reproducer/example code, as is very difficult to recommend anything without knowing what exactly are you modifying. If you think there is something wrong/we can improve around this area, please, feel free to reopen this issue or open a new one :) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:20:35 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:20:35 +0000 Subject: [issue31541] Mock called_with does not ensure self/cls argument is used In-Reply-To: <1505986548.45.0.223796234627.issue31541@psf.upfronthosting.co.za> Message-ID: <1542079235.11.0.788709270274.issue31541@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I agree with Karthikeyan: This is is the expected behaviour. The moment you use a mock, any implementation details are lost unless you use wraps or similar to also transfer the call to the/a real object. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:21:01 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:21:01 +0000 Subject: [issue31541] Mock called_with does not ensure self/cls argument is used In-Reply-To: <1505986548.45.0.223796234627.issue31541@psf.upfronthosting.co.za> Message-ID: <1542079261.33.0.788709270274.issue31541@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Will ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:21:10 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:21:10 +0000 Subject: [issue31541] Mock called_with does not ensure self/cls argument is used In-Reply-To: <1505986548.45.0.223796234627.issue31541@psf.upfronthosting.co.za> Message-ID: <1542079270.27.0.788709270274.issue31541@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg329801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:24:47 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:24:47 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542079487.2.0.788709270274.issue35221@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:30:58 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 13 Nov 2018 03:30:58 +0000 Subject: [issue33944] Deprecate and remove pth files In-Reply-To: <86135560-EDFC-4026-BFEA-1186B1228F0B@python.org> Message-ID: <6d902178-f7d3-9f07-2aeb-9d05c456e43e@mail.ru> Ivan Pozdeev added the comment: > I?m a little concerned about this approach because it means random third party modules can affect the global environment for your application, without knowing it. Since the hook installation happens at import time, and just depending on a library that has such a .pth file will install it, the end application will not have control over its global state. But "affecting the global environment for your application" is exactly what is intended here. You want multiple packages to all load their code into the same namespaces (aka module objects), thus of course potentially affecting/overriding each other's functionality. That's what you get when you have plugins -- a badly-written/incompatible plugin can and will break your app. It doesn't have to "just depend on a library that has such a .pth file", it's up to the import hook's implementation. I just gave as example the simplest solution that requires zero effort on the main package maintainer's part. E.g. you can only allow adding a new submodule by default, or require the "parent" package to "allow" insertions into itself, or move registration into the parent's configuration file (so the user needs to enable the plugin manually), or provide some more granular code injection techniques like e.g. event handler lists that certain plugins' functions will be added into. All that matters here is that the hook is going to automagically assemble the resulting namespaces from parts upon import. Finally, Python applications don't have full control over their global state anyway. Any module can monkey-patch or override any other module via a variety of means. So, this risk is not something new or unexpected. ---------- nosy: +__Vano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:34:46 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:34:46 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542080086.59.0.788709270274.issue35214@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I cannot initialize the interpreter after compiling with --with-memory-sanitizer: ? CC=clang ./configure --with-memory-sanitizer && make -j ? ./python Python 3.8.0a0 (heads/master:1584a00815, Nov 13 2018, 03:29:18) [Clang 7.0.0 (tags/RELEASE_700/final)] on linux Type "help", "copyright", "credits" or "license" for more information. ==10989==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x5592f18005c3 (/home/pablogsal/cpython/python+0x9a55c3) #1 0x5592f175c176 (/home/pablogsal/cpython/python+0x901176) #2 0x5592f17592da (/home/pablogsal/cpython/python+0x8fe2da) #3 0x5592f1750f82 (/home/pablogsal/cpython/python+0x8f5f82) #4 0x5592f174a336 (/home/pablogsal/cpython/python+0x8ef336) #5 0x5592f174c906 (/home/pablogsal/cpython/python+0x8f1906) #6 0x5592f14ae214 (/home/pablogsal/cpython/python+0x653214) #7 0x5592f14a6915 (/home/pablogsal/cpython/python+0x64b915) #8 0x5592f14a293c (/home/pablogsal/cpython/python+0x64793c) #9 0x5592f0f5ad88 (/home/pablogsal/cpython/python+0xffd88) #10 0x5592f0f5ce73 (/home/pablogsal/cpython/python+0x101e73) #11 0x5592f0f4d908 (/home/pablogsal/cpython/python+0xf2908) #12 0x7fd1a7381222 (/usr/lib/libc.so.6+0x24222) #13 0x5592f0ed3cdd (/home/pablogsal/cpython/python+0x78cdd) Uninitialized value was created by a heap allocation #0 0x5592f0f02a0d (/home/pablogsal/cpython/python+0xa7a0d) #1 0x7fd1a73cd790 (/usr/lib/libc.so.6+0x70790) SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/pablogsal/github/cpython/python+0x9a55c3) Exiting ? clang --version clang version 7.0.0 (tags/RELEASE_700/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin ? /lib/libc.so.6 GNU C Library (GNU libc) stable release version 2.28. Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 8.2.1 20180831. libc ABIs: UNIQUE IFUNC ABSOLUTE For bug reporting instructions, please see: . I am missing something or is this expected (as there are more PRs to come)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:37:03 2018 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 13 Nov 2018 03:37:03 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542080223.38.0.788709270274.issue35214@psf.upfronthosting.co.za> Alex Gaynor added the comment: All libraries that are linked against, including libc, need to be compiled with MSAN. MSAN is not for the faint of heart. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:39:07 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 03:39:07 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542080347.42.0.788709270274.issue35214@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Thanks @alex! I will try again after linking against ASAN-compiled version of my libraries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:52:23 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 03:52:23 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542081143.03.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 12 22:52:45 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 03:52:45 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542081165.73.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 00:35:04 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 05:35:04 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542087304.28.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: yeah, i've been surprised how far i was able to get from an oss CPython tree and pre-built clang 7 binary installation. If you have headers installed for common libraries like libssl-dev and libreadline-dev you can't produce an interpreter that'll work as those both lead to quick crashes. also, in my experience optimized builds tend to be more problematic (too early to say if what i'm seeing are actual problems). also, make sure llvm-symbolize (no suffixes) is in your path for it to auto-symbolize the traces showing you where in the code it pointed out issues. when it points within shared libraries instead of the Python source tree - that's a hint that the library probably may need msan compilation. I'm plodding through things to see if I can get a _useful_ buildbot setup (i don't care of some extension modules can't be covered for now) out of all of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 00:43:52 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 05:43:52 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542087832.44.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 00:43:59 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Nov 2018 05:43:59 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1542087839.72.0.788709270274.issue35224@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 00:44:39 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 05:44:39 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542087879.45.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: > Can we prefix MEMORY_SANITIZER with _Py_? Yes, I wondered if I should do that. not that I expect anyone would ever define it to mean anything else, but that seems like the right thing to do. https://github.com/python/cpython/pull/10503 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 01:01:26 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 06:01:26 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542088886.77.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 3015fb8ce4d25603434b9b44bb7effb98a481532 by Gregory P. Smith in branch 'master': bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503) https://github.com/python/cpython/commit/3015fb8ce4d25603434b9b44bb7effb98a481532 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 01:01:33 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 06:01:33 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542088893.55.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 01:01:43 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 06:01:43 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542088903.03.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 01:20:26 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 06:20:26 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542090026.26.0.788709270274.issue35214@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f6602f92664b782125a1ec5009706f9300fe7e80 by Miss Islington (bot) in branch '3.7': bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503) https://github.com/python/cpython/commit/f6602f92664b782125a1ec5009706f9300fe7e80 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 01:27:09 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 06:27:09 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542090429.52.0.788709270274.issue35214@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 60cf26528b931215160a53fd61836dbe4f036009 by Miss Islington (bot) in branch '3.6': bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503) https://github.com/python/cpython/commit/60cf26528b931215160a53fd61836dbe4f036009 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 02:48:52 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Nov 2018 07:48:52 +0000 Subject: [issue33052] Sporadic segmentation fault in test_datetime In-Reply-To: <1520803979.78.0.467229070634.issue33052@psf.upfronthosting.co.za> Message-ID: <1542095332.27.0.788709270274.issue33052@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Related discussion with same segfault in Travis CI : issue33701 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:02:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:02:38 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542096158.07.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 0d12672b30b8c6c992bef7564581117ae83e11ad by Victor Stinner (Paul Ganssle) in branch 'master': bpo-35081: Remove Py_BUILD_CORE from datetime.h (GH-10416) https://github.com/python/cpython/commit/0d12672b30b8c6c992bef7564581117ae83e11ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:05:32 2018 From: report at bugs.python.org (Chris Withers) Date: Tue, 13 Nov 2018 08:05:32 +0000 Subject: [issue35226] mock.call equality surprisingly broken Message-ID: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> New submission from Chris Withers : $ python3 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from unittest.mock import call >>> call(x=1) == call(x=2) False Good so far? >>> call(x=1).foo == call(x=2).foo True Eep, I think a lot of people might find that quite surprising! ---------- assignee: michael.foord components: Tests messages: 329813 nosy: cjw296, michael.foord priority: normal severity: normal status: open title: mock.call equality surprisingly broken type: behavior versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:07:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:07:49 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542096469.19.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: Status: only pyport. and tupleobject.h use Py_BUILD_CORE, and only tupleobject.h uses "#ifdef Py_BUILD_CORE" (contains code specific to internals). $ grep Py_BUILD_CORE Include/*.h Include/pyport.h:# if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) Include/pyport.h:# else /* Py_BUILD_CORE */ Include/pyport.h:# endif /* Py_BUILD_CORE */ Include/pyport.h:#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) Include/pyport.h:#endif /* Py_BUILD_CORE */ Include/tupleobject.h:#ifdef Py_BUILD_CORE tupleobject.c: #ifdef Py_BUILD_CORE # define _PyTuple_ITEMS(op) ((((PyTupleObject *)(op))->ob_item)) #endif I added this macro in bpo-35199, to prepare the C code for a new C API hiding implementation details: see bpo-35206. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:11:29 2018 From: report at bugs.python.org (Glenn Linderman) Date: Tue, 13 Nov 2018 08:11:29 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542096689.15.0.788709270274.issue10486@psf.upfronthosting.co.za> Glenn Linderman added the comment: R?mi Lapeyre, glad to see your interest here, as this is an old and languishing bug. I would have hoped based on my input, that had there been anyone that was maintaining the Python web server code, that they might have done a more complete analysis than I did. I note the document you reference is from 2004 (and I referenced it too), and doesn't include mention of the HTTP_COOKIE header, yet that header is frequently used in practical web applications. Apache supports it (as noted). My point is that it is not clear that conforming to the RFC 3875 from 2004 is really sufficient to build a useful web server. While it is true that my references to Apache are to a particular implementation, it is a widespread implementation, which other implementations attempt to be compatible with, indicating that being reasonably compatible with Apache would seem to be a good thing for other web server implementations. A few more environment variables don't cost a lot, and seem to be useful. I don't know if some or all of the additional environment variables implemented by Apache are standardized by RFC or other standards, or whether they are common practice, or unique to Apache. Nor where such standards might be fonud, but I would hope a maintainer of the Python web server would be interested in sorting out such environment variables and making that determination, rather than relying on a 14 year old RFC as the definitive source, when web technologies have progressed significantly in the last 14 years. I would agree that variables that are unique to Apache might not want to be implemented, but on the other hand, with other implementations following Apache's lead, there may be few that are unique to Apache. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:11:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:11:42 +0000 Subject: [issue33052] Sporadic segmentation fault in test_datetime In-Reply-To: <1520803979.78.0.467229070634.issue33052@psf.upfronthosting.co.za> Message-ID: <1542096702.05.0.788709270274.issue33052@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:12:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:12:17 +0000 Subject: [issue33052] Sporadic segmentation fault in test_datetime.test_check_arg_types() In-Reply-To: <1520803979.78.0.467229070634.issue33052@psf.upfronthosting.co.za> Message-ID: <1542096737.07.0.788709270274.issue33052@psf.upfronthosting.co.za> STINNER Victor added the comment: > Just spotted this in a Travis-CI job: > https://travis-ci.org/python/cpython/jobs/351010039#L2002 0:00:07 load avg: 20.55 [ 24/415/1] test_datetime crashed (Exit code -11) Fatal Python error: Segmentation fault Current thread 0x000014fcbda86740 (most recent call first): File "/home/travis/build/python/cpython/Lib/test/datetimetester.py", line 4630 in test_check_arg_types File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 615 in run File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 663 in __call__ File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in run File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in run File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/travis/build/python/cpython/Lib/unittest/runner.py", line 176 in run File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 1865 in _run_suite File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 1955 in run_unittest File "/home/travis/build/python/cpython/Lib/test/test_datetime.py", line 54 in test_main File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", line 176 in runtest_inner File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", line 130 in runtest File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest_mp.py", line 67 in run_tests_slave File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 517 in _main File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 510 in main File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 585 in main File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 46 in _main File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 50 in File "/home/travis/build/python/cpython/Lib/runpy.py", line 85 in _run_code File "/home/travis/build/python/cpython/Lib/runpy.py", line 193 in _run_module_as_main ---------- title: Sporadic segmentation fault in test_datetime -> Sporadic segmentation fault in test_datetime.test_check_arg_types() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:14:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:14:33 +0000 Subject: [issue33052] Sporadic segmentation fault in test_datetime.test_check_arg_types() In-Reply-To: <1520803979.78.0.467229070634.issue33052@psf.upfronthosting.co.za> Message-ID: <1542096873.61.0.788709270274.issue33052@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, this issue is the same bug than bpo-33701. I also close this one since this crash has been seen in March, but I didn't see it recently. So I close the issue as "out of date". ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:27:56 2018 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Tue, 13 Nov 2018 08:27:56 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size Message-ID: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> New submission from Micha? G?rny : Currently, the tarfile module only supports adding files if their size is known prior to adding. However, I think it'd be helpful to be able to store large dynamically generated streams straight into the (uncompressed) .tar file without being able to precalculate the final size and without having to use a temporary file. I'm not really sure how the API should look like (i.e. whether it should be a new method or extension of addfile()) but the mechanism would be rather simple -- write TarInfo with size of 0, write data until end of stream, write padding appropriately to written data, seek back and update TarInfo. Of course, the use of this API would have to be restricted to cases when underlying file supports seeking back and random writes, i.e. not stream, not compressed. ---------- components: Library (Lib) messages: 329818 nosy: mgorny priority: normal severity: normal status: open title: [RFE] tarfile: support adding file objects without prior known size type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:42:54 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 08:42:54 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542098574.71.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 03:52:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 08:52:27 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542099147.61.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 04:05:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 09:05:00 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542099900.49.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, this issue is much harder than what I expected. Status: * Include/internal/ header files have been renamed to get a new "pycore_" prefix which avoids conflicts with Include/ header files. Example: "pycore_pystate.h" vs "pystate.h". * pyatomic.c has been moved to Include/internal/ and it is no longer included in Python.h. * Except of _PyTuple_ITEMS() and _PyObject_GC_TRACK(), all internal APIs have been moved to Include/internal/. Many new header files have been created, like pycore_lifecycle.h and pycore_pathconfig.h. TODO: * Move _PyObject_GC_TRACK() to Include/internal/ * msg329608 describes bugs like: pystate.c:968:1: warning: no previous prototype for ?_PyGILState_Init? [-Wmissing-prototypes] * bpo-35134 now manages moving unstable API to a new separated Include/ subdirectory * bpo-35059 converts macros to static inline functions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 04:53:22 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Nov 2018 09:53:22 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542102802.7.0.788709270274.issue35226@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think this is due to the fact that when an attribute of a call object is accessed a new call object is returned with the parent as self.parent [0] but the original information regarding the parent is lost during representation and no check for self.parent equality while the call objects are compared [1] ./python.exe Python 3.8.0a0 (heads/master:0dc1e45dfd, Nov 13 2018, 11:19:49) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from unittest.mock import call >>> call(x=2).foo call().foo >>> call(x=1).foo call().foo >>> # Comparison returns true since it's similar to call().foo == call().foo though parents are set >>> call(x=1).foo == call(x=2).foo True >>> call(x=1).foo.parent call(x=1) >>> call(x=2).foo.parent call(x=2) >>> call(x=2).foo(x=2).bar call().foo().bar >>> call(x=4).foo(x=3).bar call().foo().bar >>> # Comparison returns true since it's similar to call().foo().bar == call().foo().bar >>> call(x=2).foo(x=2).bar == call(x=4).foo(x=3).bar True >>> call(x=4).foo(x=3).bar.parent call().foo(x=3) Maybe we can add a check for parent to be equal if present? diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a9c82dcb5d..a7565d5f60 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2054,6 +2054,10 @@ class _Call(tuple): else: self_name, self_args, self_kwargs = self + if (getattr(self, 'parent', None) and getattr(other, 'parent', None) + and self.parent != other.parent): + return False + other_name = '' if len_other == 0: other_args, other_kwargs = (), {} With patch the checks return False and there is no test suite failure but I am not sure if I need to put this inside a while loop to check for nested parents and there maybe other cases that my code doesn't handle. ? cpython git:(master) ? ./python.exe -c 'from unittest.mock import call; print(call(x=2).foo.bar == call(x=1).foo.bar)' False ? cpython git:(master) ? ./python.exe -c 'from unittest.mock import call; print(call(x=2).foo == call(x=1).foo)' False [0] https://github.com/python/cpython/blob/0d12672b30b8c6c992bef7564581117ae83e11ad/Lib/unittest/mock.py#L2109 [1] https://github.com/python/cpython/blob/0d12672b30b8c6c992bef7564581117ae83e11ad/Lib/unittest/mock.py#L2043 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 04:59:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 09:59:01 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542103141.04.0.788709270274.issue35226@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +mariocj89 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 05:01:48 2018 From: report at bugs.python.org (Chris Withers) Date: Tue, 13 Nov 2018 10:01:48 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542103308.92.0.788709270274.issue35226@psf.upfronthosting.co.za> Chris Withers added the comment: I don't think the getattr(self, 'parent', None) is necessary, the attribute is always there and None == None ;-) I reckon this will work: if self.parent != other.parent): return True ...but obviously, we'd add some more tests to the suite to make sure this keeps working. If this is the way to go, lemme know and I'll work up a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 05:11:44 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 13 Nov 2018 10:11:44 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542103904.6.0.788709270274.issue10486@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: Hi Glenn, I'm not aware of a document that defines CGI better than the RFC and I don't know it enough to disgress from the published standard (even if it is not what isdone today as I don't know the current practices enough). Here is the variables defined by nginx 1.10.3 on Debian: fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; Someone that knows CGI better than me may know the way forward ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 05:15:10 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Nov 2018 10:15:10 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1542104110.16.0.788709270274.issue35224@psf.upfronthosting.co.za> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 05:26:26 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Nov 2018 10:26:26 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542104786.73.0.788709270274.issue35226@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Yes, for call objects it's always there but some of the tests use a tuple during self.assertEquals and hence during equality check other fails with the attribute error for parent like below. Also getattr(self, 'parent', None) != getattr(other, 'parent', None) will skip the attribute error but still fail for tuples in tests I guess with tuple.parent returned as None and checked against a valid parent. Hence the patch with both the checks of getattr and self.parent that passes the test suite. I will wait for input from maintainers if my approach is correct since I am little new to mock :) ====================================================================== ERROR: test_explicit_mock (unittest.test.testmock.testwith.TestMockOpen) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/test/testmock/testwith.py", line 177, in test_explicit_mock mock.assert_called_once_with('foo') File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 838, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 823, in assert_called_with if expected != actual: File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 2057, in __eq__ if self.parent != other.parent: AttributeError: 'tuple' object has no attribute 'parent' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 05:42:51 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Nov 2018 10:42:51 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1542105771.59.0.788709270274.issue30156@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:06:57 2018 From: report at bugs.python.org (Christian Ullrich) Date: Tue, 13 Nov 2018 11:06:57 +0000 Subject: [issue35228] Index search in CHM help crashes viewer Message-ID: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> New submission from Christian Ullrich : Typing into the index keyword field frequently crashes the CHM viewer with the first or second character. The Python CHMs are the only ones that I see this crash with; it started around 3.6 or so. >From event log: Faulting application name: hh.exe, version: 10.0.17134.1, time stamp: 0xa0eff942 Faulting module name: hhctrl.ocx, version: 10.0.17134.48, time stamp: 0x412ce02a Exception code: 0xc0000005 Fault offset: 0x00000000000387b2 Faulting process ID: 0x3558 Faulting application start time: 0x01d47b3f8db53eef Faulting application path: C:\Windows\hh.exe Faulting module path: C:\Windows\System32\hhctrl.ocx Report ID: 53f84d38-adb4-4c0b-bd45-9bce02406e6f Faulting package full name: Faulting package-relative application ID: This particular crash involved the file from 3.7.1: sha1(doc\python371.chm) = 1c0e2d861cadc759436bfac0a767c5bb633423f9 ---------- assignee: docs at python components: Documentation, Windows messages: 329824 nosy: chrullrich, docs at python, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Index search in CHM help crashes viewer type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:24:00 2018 From: report at bugs.python.org (keeely) Date: Tue, 13 Nov 2018 11:24:00 +0000 Subject: [issue35218] decompressing and then re-compressing zipfiles with Python 3 zipfile loses flag_bits In-Reply-To: <1542033501.3.0.788709270274.issue35218@psf.upfronthosting.co.za> Message-ID: <1542108240.38.0.788709270274.issue35218@psf.upfronthosting.co.za> Change by keeely : ---------- keywords: +patch Added file: https://bugs.python.org/file47930/zipfile_flags.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:27:55 2018 From: report at bugs.python.org (Mario Corchero) Date: Tue, 13 Nov 2018 11:27:55 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542108475.44.0.788709270274.issue35226@psf.upfronthosting.co.za> Mario Corchero added the comment: If this is to be done we should not change those tests, I am sure there is code validating calls relying on its "tupleness". Example: ``` >>> import unittest.mock >>> m = unittest.mock.Mock() >>> m(1) >>> m(2, a=1) >>> m.assert_has_calls([ ... ((1,), {}), ... ((2,), {'a':1}), ... ]) ``` This is documented here: https://github.com/python/cpython/blob/0d12672b30b8c6c992bef7564581117ae83e11ad/Lib/unittest/mock.py#L1993 On the addition in general, I cannot really comment on the "call(x=1).foo == call(x=2).foo" or how that is supposed to work, I've used those "nesting calls" minimally. I would try to get a hold of Michael Ford. As a note, I think nesting calls in unittest.mock.call is supposed to be used only via the https://docs.python.org/3/library/unittest.mock.html#unittest.mock.call.call_list method and for calls only. See: ``` >>> call(x=1).foo(z=1).call_list() == call(x=1).foo(z=1).call_list() True >>> call(x=2).foo(z=1).call_list() == call(x=1).foo(z=1).call_list() False ``` which "works as expected". Having support for: ```call(x=1).foo == call(x=2).foo``` is kind of trying to validate an attribute has been accessed, which is a different thing from what mock.calls seems to be doing at the moment. It could be added I guess, but I don't see how do can you use that in `mock.assert_has_calls` for example. What is the "real life" issue that you faced with this issue? Because creating and comparing calls yourself is not something that is usually done, I guess you compared it to a mock call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:29:14 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 11:29:14 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542108554.8.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:31:40 2018 From: report at bugs.python.org (Chris Withers) Date: Tue, 13 Nov 2018 11:31:40 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542108700.93.0.788709270274.issue35226@psf.upfronthosting.co.za> Chris Withers added the comment: I'm chatting with Michael already (on Facebook of all places), and I use this feature heavily and deeply, being one of the people who originally requested it. I'm both happy and capable of seeing this through, so no need for anyone else to dive in :-) Hopefully Michael will follow up when he gets a chance... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:33:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:33:56 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542108836.38.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:39:44 2018 From: report at bugs.python.org (Michael Foord) Date: Tue, 13 Nov 2018 11:39:44 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542109184.45.0.788709270274.issue35226@psf.upfronthosting.co.za> Michael Foord added the comment: Parents comparing upwards sounds like the right (and simple) fix. Not breaking the tuple tests would be good. I'm happy for Chris to produce the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:42:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:42:37 +0000 Subject: [issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542109357.44.0.788709270274.issue35195@psf.upfronthosting.co.za> STINNER Victor added the comment: > Yes, that slows down Python 3.7.0a3 to the 3.7.0a4 level. Ok, so something calls setlocale(LC_CTYPE, "") or setlocale(LC_ALL, "") in Python 3.7.0. I'm not interested to dig the Git history. It doesn't really matter at this point. Can you try to get the current LC_CTYPE locale on Python 3.6 or 3.7.0a3? Example: $ python3 -c 'import _locale; print(_locale.setlocale(_locale.LC_CTYPE, None))' fr_FR.utf8 Or using the locale module (it should give the same result): $ python3 -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' fr_FR.utf8 Can also also try on 3.7.0a4 and newer (ex: Python 3.7.1): locale.setlocale(locale.LC_ALL, "C"), to see it does workaround your performance issue? I don't recall if "C" or "POSIX" locales are supported on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:43:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:43:46 +0000 Subject: [issue35195] [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit() In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542109426.54.0.788709270274.issue35195@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10 -> [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:49:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:49:14 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 Message-ID: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> New submission from STINNER Victor : The _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros are documented: * https://docs.python.org/dev/c-api/gcsupport.html#c._PyObject_GC_TRACK * https://docs.python.org/dev/c-api/gcsupport.html#c._PyObject_GC_UNTRACK The documentation says "It should not be used for extension modules." These macros have been broken in Python 3.7 by Eric Snow's work on moving internal APIs to Include/internal/: _PyObject_GC_TRACK() access _PyRuntime.gc.generation0, whereas accessing _PyRuntime requires to include Include/internal/pycore_pystate.h (header previously called Include/internal/pystate.h in Python 3.7) which is not installed by "make install". My PR 10507 moved these macros to Include/internal/ to clarify that they must not be used outside CPython internals. I suggest to deprecate them in Python 3.6: just add a note in Python 3.6 and 3.7 documentation. ---------- messages: 329829 nosy: vstinner priority: normal severity: normal status: open title: Deprecate _PyObject_GC_TRACK() in Python 3.6 versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:52:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:52:21 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542109941.5.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076 by Victor Stinner in branch 'master': bpo-35081: Make some _PyGC macros internal (GH-10507) https://github.com/python/cpython/commit/1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:54:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:54:44 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542110084.9.0.788709270274.issue35229@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9771 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 06:55:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 11:55:43 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542110143.25.0.788709270274.issue35229@psf.upfronthosting.co.za> STINNER Victor added the comment: > These macros have been broken in Python 3.7 by Eric Snow's work on moving internal APIs to Include/internal/ (...) Oh, I forgot to mention that IMHO it's perfectly fine :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:06:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 12:06:14 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542110774.6.0.788709270274.issue35229@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 55b4771d5d18d5ff7c095aa1ab750fe0c8bb5e67 by Victor Stinner in branch '3.7': bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511) https://github.com/python/cpython/commit/55b4771d5d18d5ff7c095aa1ab750fe0c8bb5e67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:06:24 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 12:06:24 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542110784.51.0.788709270274.issue35229@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:08:45 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 13 Nov 2018 12:08:45 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA Message-ID: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> New submission from INADA Naoki : After 2aaf0c, _Py_REF_DEBUG_COMMA in Include/object.h is used only in dictobject.c. Let's remove it. ---------- messages: 329833 nosy: inada.naoki priority: normal severity: normal status: open title: Remove _Py_REF_DEBUG_COMMA _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:09:34 2018 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 13 Nov 2018 12:09:34 +0000 Subject: [issue34784] Heap-allocated StructSequences In-Reply-To: <1537773797.44.0.956365154283.issue34784@psf.upfronthosting.co.za> Message-ID: <1542110974.54.0.788709270274.issue34784@psf.upfronthosting.co.za> Petr Viktorin added the comment: New changeset 474eedfb3d1b6fecbd749f36bf4a987cf4a00b44 by Petr Viktorin (Eddie Elizondo) in branch 'master': bpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence (GH-9665) https://github.com/python/cpython/commit/474eedfb3d1b6fecbd749f36bf4a987cf4a00b44 ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:11:34 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 13 Nov 2018 12:11:34 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542111094.75.0.788709270274.issue35230@psf.upfronthosting.co.za> INADA Naoki added the comment: I meant 2aaf0c1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:13:29 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 13 Nov 2018 12:13:29 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542111209.12.0.788709270274.issue35230@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +9773 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 07:14:59 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 12:14:59 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542111299.6.0.788709270274.issue35229@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 60a6baef4005a32fb4cf45e15942ea18e59ecf19 by Miss Islington (bot) in branch '3.6': bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511) https://github.com/python/cpython/commit/60a6baef4005a32fb4cf45e15942ea18e59ecf19 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:06:07 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 13 Nov 2018 13:06:07 +0000 Subject: [issue17972] inspect module docs omits many functions In-Reply-To: <1368501068.91.0.677640111487.issue17972@psf.upfronthosting.co.za> Message-ID: <1542114367.41.0.788709270274.issue17972@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: I think this issue should be discussed once more. I am not sure it's worth defining __all__, but then we would have to include them in the docs. If you think __all__ should be defined instead, then I could go through the trouble of doing so. Could a core developer maybe offer their opinion here? ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:08:23 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 13 Nov 2018 13:08:23 +0000 Subject: [issue17972] inspect module docs omits many functions In-Reply-To: <1368501068.91.0.677640111487.issue17972@psf.upfronthosting.co.za> Message-ID: <1542114503.84.0.788709270274.issue17972@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: ...but then we would have to include them in the docs... should be *but then we would have to include all the public functions in the docs*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:13:34 2018 From: report at bugs.python.org (Gus Goulart) Date: Tue, 13 Nov 2018 13:13:34 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1542114814.82.0.788709270274.issue33930@psf.upfronthosting.co.za> Gus Goulart added the comment: ronaldoussoren, I have tested (Debian 9) substituting "_PyObject_GC_UNTRACK(m);" to "PyObject_GC_UnTrack(m);", and although the tests pass, I'm can still see the segfault error. diff --git a/Objects/methodobject.c b/Objects/methodobject.c index cfea8cf410..cb8e279c7d 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -84,7 +84,7 @@ PyCFunction_GetFlags(PyObject *op) static void meth_dealloc(PyCFunctionObject *m) { - _PyObject_GC_UNTRACK(m); + PyObject_GC_UnTrack(m); if (m->m_weakreflist != NULL) { PyObject_ClearWeakRefs((PyObject*) m); } ---------- nosy: +gus.goulart _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:14:57 2018 From: report at bugs.python.org (Gus Goulart) Date: Tue, 13 Nov 2018 13:14:57 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1542114897.07.0.788709270274.issue33930@psf.upfronthosting.co.za> Change by Gus Goulart : ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:29:55 2018 From: report at bugs.python.org (Sascha Silbe) Date: Tue, 13 Nov 2018 13:29:55 +0000 Subject: [issue34033] distutils is not reproducible In-Reply-To: <1530632785.81.0.56676864532.issue34033@psf.upfronthosting.co.za> Message-ID: <1542115795.0.0.788709270274.issue34033@psf.upfronthosting.co.za> Change by Sascha Silbe : ---------- nosy: +sascha_silbe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:30:43 2018 From: report at bugs.python.org (Sascha Silbe) Date: Tue, 13 Nov 2018 13:30:43 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1542115843.9.0.788709270274.issue29708@psf.upfronthosting.co.za> Change by Sascha Silbe : ---------- nosy: +sascha_silbe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:32:31 2018 From: report at bugs.python.org (Sascha Silbe) Date: Tue, 13 Nov 2018 13:32:31 +0000 Subject: [issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata In-Reply-To: <1511985115.6.0.213398074469.issue32170@psf.upfronthosting.co.za> Message-ID: <1542115951.56.0.788709270274.issue32170@psf.upfronthosting.co.za> Change by Sascha Silbe : ---------- nosy: +sascha_silbe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:56:20 2018 From: report at bugs.python.org (pmpp) Date: Tue, 13 Nov 2018 13:56:20 +0000 Subject: [issue35231] make install may not call ldconfig on posix Message-ID: <1542117380.5.0.788709270274.issue35231@psf.upfronthosting.co.za> New submission from pmpp : observed on ubuntu trusty x64 with release 3.7.1 at least when switching from "m" abi to "dm" abi sometimes libpython is not resolved in /usr/local/lib so maybe add "ldconfig" as a preventive mesure. ---------- components: Installation messages: 329840 nosy: pmpp priority: normal severity: normal status: open title: make install may not call ldconfig on posix type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 08:57:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 13:57:01 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542117421.03.0.788709270274.issue35230@psf.upfronthosting.co.za> STINNER Victor added the comment: This change is related to bpo-35059. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:01:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:01:22 +0000 Subject: [issue35229] Deprecate _PyObject_GC_TRACK() in Python 3.6 In-Reply-To: <1542109754.28.0.788709270274.issue35229@psf.upfronthosting.co.za> Message-ID: <1542117682.16.0.788709270274.issue35229@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:02:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:02:20 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542117740.48.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-35230: "Remove _Py_REF_DEBUG_COMMA". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:02:40 2018 From: report at bugs.python.org (pmpp) Date: Tue, 13 Nov 2018 14:02:40 +0000 Subject: [issue35231] make install may not call ldconfig on GNU/Linux In-Reply-To: <1542117380.5.0.788709270274.issue35231@psf.upfronthosting.co.za> Message-ID: <1542117760.35.0.788709270274.issue35231@psf.upfronthosting.co.za> Change by pmpp : ---------- title: make install may not call ldconfig on posix -> make install may not call ldconfig on GNU/Linux _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:10:26 2018 From: report at bugs.python.org (pmpp) Date: Tue, 13 Nov 2018 14:10:26 +0000 Subject: [issue35231] make install may not call ldconfig on GNU/Linux when using --enable-shared In-Reply-To: <1542117380.5.0.788709270274.issue35231@psf.upfronthosting.co.za> Message-ID: <1542118226.13.0.788709270274.issue35231@psf.upfronthosting.co.za> Change by pmpp : ---------- title: make install may not call ldconfig on GNU/Linux -> make install may not call ldconfig on GNU/Linux when using --enable-shared _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:15:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:15:03 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542118503.34.0.788709270274.issue29564@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f966e5397ed8f5c42c185223fc9b4d750a678d02 by Victor Stinner in branch 'master': bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) https://github.com/python/cpython/commit/f966e5397ed8f5c42c185223fc9b4d750a678d02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:15:25 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 14:15:25 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542118525.25.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:16:46 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 14:16:46 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542118606.03.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:19:40 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 13 Nov 2018 14:19:40 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542118779.99.0.788709270274.issue31354@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: This change exports -flto in cflags. You can check it with python3-config --cflags after this commit. Which means that every c extension which will use those cflags will also utilize -flto which wasn't happening before, thus I'd say it's a regression. ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:21:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:21:53 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542118913.42.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:22:01 2018 From: report at bugs.python.org (Gus Goulart) Date: Tue, 13 Nov 2018 14:22:01 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542118921.31.0.788709270274.issue33196@psf.upfronthosting.co.za> Gus Goulart added the comment: I've tested on Fedora 29 server and also failed to reproduce the error. ---------- Added file: https://bugs.python.org/file47931/testing_on_fedora.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:23:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:23:50 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542119030.6.0.788709270274.issue29564@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:30:38 2018 From: report at bugs.python.org (Gus Goulart) Date: Tue, 13 Nov 2018 14:30:38 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1542119438.08.0.788709270274.issue33930@psf.upfronthosting.co.za> Gus Goulart added the comment: Sorry, I forgot to include the trashcan API. I'll double check and update the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:30:46 2018 From: report at bugs.python.org (Antony Lee) Date: Tue, 13 Nov 2018 14:30:46 +0000 Subject: [issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability Message-ID: <1542119446.33.0.788709270274.issue35232@psf.upfronthosting.co.za> New submission from Antony Lee : Currently, dataclasses created by make_dataclass are not picklable, because their __module__ is set to "types". It seems that this would be easily fixed by letting make_dataclass gain a `module` and a `qualname` kwarg, similarly to the Enum functional form (https://docs.python.org/3/library/enum.html#functional-api). ---------- components: Library (Lib) messages: 329847 nosy: Antony.Lee priority: normal severity: normal status: open title: Add `module`/`qualname` arguments to make_dataclass for picklability versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 09:51:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 14:51:01 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542120661.33.0.788709270274.issue29564@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d57a3e5d03efdda6247c27bd682872edf399d88b by Victor Stinner in branch '3.7': bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) (GH-10517) https://github.com/python/cpython/commit/d57a3e5d03efdda6247c27bd682872edf399d88b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 10:11:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 15:11:01 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers Message-ID: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> New submission from STINNER Victor : _PyMainInterpreterConfig_Copy() doesn't copy the install_signal_handlers attribute and so config->install_signal_handlers is always -1. Bug spotted by Francis Hart: https://github.com/python/cpython/pull/10516 Attached PR fix the issue. ---------- components: Interpreter Core messages: 329849 nosy: vstinner priority: normal severity: normal status: open title: _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 10:11:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 15:11:46 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542121906.37.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9778 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 10:13:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 15:13:20 +0000 Subject: [issue29564] ResourceWarning: suggest to enable tracemalloc in the message In-Reply-To: <1487128296.48.0.945171350707.issue29564@psf.upfronthosting.co.za> Message-ID: <1542122000.56.0.788709270274.issue29564@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ae8878176d6dc1878d1e792ac4308ca1920b103b by Victor Stinner in branch '3.6': bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) (GH-10518) https://github.com/python/cpython/commit/ae8878176d6dc1878d1e792ac4308ca1920b103b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 10:29:05 2018 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 13 Nov 2018 15:29:05 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542122945.13.0.788709270274.issue10486@psf.upfronthosting.co.za> Pierre Quentel added the comment: The QUERY_STRING value is always set by the code at lines 1135-1137 of http.server: for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'): env.setdefault(k, "") The RFC for CGI has not evolved since 2004, probably because the technology is stable, and also because other, more efficient protocols have been defined to avoid the "CGI overhead" (FastCGI for instance). I think that http.server should only implement the "meta-variables" defined in RFC 3875: - AUTH_TYPE CONTENT_LENGTH CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE. Some of these must always be set (eg QUERY_STRING, REQUEST_METHOD, SERVER_NAME...) but for other ones, there are conditions (for instance for CONTENT_LENGTH: "The server MUST set this meta-variable if and only if the request is accompanied by a message-body entity") - "protocol-specific meta variables" : for HTTP, variables determined by the HTTP request headers such as HTTP_COOKIE (cf section 4.1.18. Protocol-Specific Meta-Variables) Other meta variables are probably beyond the scope of a module in the standard library. In short, in my opinion the issue can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 11:06:02 2018 From: report at bugs.python.org (Michael Casadevall) Date: Tue, 13 Nov 2018 16:06:02 +0000 Subject: [issue35234] ssl module falls over with internationalized domain names Message-ID: <1542125162.5.0.788709270274.issue35234@psf.upfronthosting.co.za> New submission from Michael Casadevall : Test case attached. In Python 3.6, ssl tries to validate the hostname on its own, but fails to convert the SSL certificates hostname from IDNA back to UTF-8 and mismatches. Python 3.7 and master are unaffected since this got fixed by accident when validation was changed to depend on OpenSSL alone and not do it in python though the underlying match_hostname function is still bugged. ---------- assignee: christian.heimes components: SSL files: ssl_test.py messages: 329852 nosy: christian.heimes, mcasadevall priority: normal severity: normal status: open title: ssl module falls over with internationalized domain names type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47932/ssl_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 11:24:39 2018 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Nov 2018 16:24:39 +0000 Subject: [issue35234] ssl module falls over with internationalized domain names In-Reply-To: <1542125162.5.0.788709270274.issue35234@psf.upfronthosting.co.za> Message-ID: <1542126279.76.0.788709270274.issue35234@psf.upfronthosting.co.za> Christian Heimes added the comment: This is a duplicate of #28414. I decided to not fix Python 3.6 because I had to break an existing API to fix the problem. And no, it didn't get fixed by accident. Nathaniel and I poured a lot of time and effort into untangling this mess. The fix is unrelated to the new verification code. ---------- resolution: -> duplicate stage: -> resolved status: open -> pending superseder: -> SSL match_hostname fails for internationalized domain names _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 12:31:32 2018 From: report at bugs.python.org (Dragoljub) Date: Tue, 13 Nov 2018 17:31:32 +0000 Subject: [issue35195] [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit() In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542130292.91.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: On Python 3.7.1 and Windows 10: I attempted locale.setlocale(locale.LC_ALL, "POSIX") --> Errors Out --------------------------------------------------------------------------- Error Traceback (most recent call last) in ----> 1 locale.setlocale(locale.LC_ALL, "POSIX") D:\Python37\lib\locale.py in setlocale(category, locale) 602 # convert to string 603 locale = normalize(_build_localename(locale)) --> 604 return _setlocale(category, locale) 605 606 def resetlocale(category=LC_ALL): Error: unsupported locale setting I was able to set the loacle to "C" but that does not improve the parsing performance. locale.setlocale(locale.LC_ALL, "C") --> returns 'C' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 12:42:08 2018 From: report at bugs.python.org (Dragoljub) Date: Tue, 13 Nov 2018 17:42:08 +0000 Subject: [issue35195] [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit() In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542130928.37.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: This is the default LC_CTYPE locale type I see on Windows10 and Python 3.7.1 vs 3.5.2: Same: 'C' '3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]' import _locale _locale.setlocale(_locale.LC_CTYPE, None) 'C' '3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]' import _locale _locale.setlocale(_locale.LC_CTYPE, None) 'C' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 12:43:07 2018 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Nov 2018 17:43:07 +0000 Subject: [issue35216] misleading error message from shutil.copy() In-Reply-To: <1542025151.44.0.788709270274.issue35216@psf.upfronthosting.co.za> Message-ID: <1542130987.0.0.788709270274.issue35216@psf.upfronthosting.co.za> Eryk Sun added the comment: The EINVAL error in Windows also needs improvement, but I don't what can be done after the fact. If there's a trailing slash when opening or creating a regular file, the NtCreateFile system call returns STATUS_OBJECT_INVALID_NAME. The Windows API maps this to ERROR_INVALID_NAME (123), which the CRT in turn maps to EINVAL (22). This error is too generic to handle. Even if the name ends in a slash, the error could be due to some other invalid character in the path (e.g. a common mistake is a '\t' or '\n' in a string literal). The problem could be addressed beforehand in shutil.copy by manually raising an exception if isdir() is false and the name has a trailing slash. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 12:46:18 2018 From: report at bugs.python.org (Mark Inderhees) Date: Tue, 13 Nov 2018 17:46:18 +0000 Subject: [issue35235] Access violation on alloc in Windows x86-64 embeddable python, pymalloc_alloc Message-ID: <1542131178.89.0.788709270274.issue35235@psf.upfronthosting.co.za> New submission from Mark Inderhees : I'm seeing an AV in python allocation logic when running my scripts. This only happens when using embedded python. It does not reproduce when using installed python. This is on Windows x86-64, I'm running Windows 10. I've seen this on 3.6.5 and 3.7.1. Here's the 3.7.1 stack on failure: 0:004> kpn # Child-SP RetAddr Call Site 00 000000d1`7439d650 00007ff8`e8303db6 python37!pymalloc_alloc(void ** ptr_p = 0x000000d1`7439d6c0, unsigned int64 nbytes = )+0x4b [c:\_work\5\s\objects\obmalloc.c @ 1398] 01 000000d1`7439d680 00007ff8`e82fb064 python37!_PyObject_Malloc(void * ctx = 0x00000000`00000000, unsigned int64 nbytes = 0x1c)+0x16 [c:\_work\5\s\objects\obmalloc.c @ 1555] 02 (Inline Function) --------`-------- python37!PyObject_Malloc+0x1c [c:\_work\5\s\objects\obmalloc.c @ 616] 03 000000d1`7439d6b0 00007ff8`e82fb18c python37!_PyLong_New(int64 size = 0n1)+0x40 [c:\_work\5\s\objects\longobject.c @ 210] 04 000000d1`7439d6e0 00007ff8`e83cbf28 python37!PyLong_FromLongLong(int64 ival = )+0x4c [c:\_work\5\s\objects\longobject.c @ 1102] 05 (Inline Function) --------`-------- python37!_PyLong_FromTime_t+0xc [c:\_work\5\s\python\pytime.c @ 88] 06 000000d1`7439d710 00007ff8`e83cb86e python37!tmtotuple(struct tm * p = 0x000000d1`7439d768, char * zone = 0x000000d1`7439d7c0 "Pacific Standard Time", int64 gmtoff = 0n-28800)+0xe0 [c:\_work\5\s\modules\timemodule.c @ 426] 07 000000d1`7439d740 00007ff8`e8307e18 python37!time_localtime(struct _object * self = 0x0000029f`3753bbe0, struct _object * args = )+0x96 [c:\_work\5\s\modules\timemodule.c @ 521] 08 000000d1`7439d850 00007ff8`e8308737 python37!_PyMethodDef_RawFastCallKeywords(struct PyMethodDef * method = 0x00000000`00000000, struct _object * self = 0x0000029f`371b7778, struct _object ** args = 0x0000029f`3754b3c8, int64 nargs = 0n1, struct _object * kwnames = 0x00000000`00000000)+0x3a8 [c:\_work\5\s\objects\call.c @ 694] 09 (Inline Function) --------`-------- python37!_PyCFunction_FastCallKeywords+0x22 [c:\_work\5\s\objects\call.c @ 730] 0a 000000d1`7439d8d0 00007ff8`e83091d3 python37!call_function(struct _object *** pp_stack = 0x000000d1`7439da28, int64 oparg = , struct _object * kwnames = 0x00000000`00000000)+0x3a7 [c:\_work\5\s\python\ceval.c @ 4554] 0b 000000d1`7439d990 00007ff8`e82f1390 python37!_PyEval_EvalFrameDefault(struct _frame * f = 0x0000029f`3754b220, int throwflag = 0n928230480)+0x913 [c:\_work\5\s\python\ceval.c @ 3095] 0c (Inline Function) --------`-------- python37!PyEval_EvalFrameEx+0x17 [c:\_work\5\s\python\ceval.c @ 547] 0d 000000d1`7439dad0 00007ff8`e83086a2 python37!_PyEval_EvalCodeWithName(struct _object * _co = 0x0000029f`37415a50, struct _object * globals = , struct _object * locals = , struct _object ** args = 0xffffffff`ffff2a88, int64 argcount = 0n3, struct _object ** kwnames = 0x00000000`00000000, struct _object ** kwargs = 0x0000029f`3753de28, int64 kwcount = 0n0, int kwstep = 0n1, struct _object ** defs = 0x0000029f`3743fe60, int64 defcount = 0n1, struct _object * kwdefs = 0x00000000`00000000, struct _object * closure = 0x00000000`00000000, struct _object * name = 0x0000029f`3744f470, struct _object * qualname = 0x0000029f`37441930)+0x1a0 [c:\_work\5\s\python\ceval.c @ 3930] 0e (Inline Function) --------`-------- python37!_PyFunction_FastCallKeywords+0x274 [c:\_work\5\s\objects\call.c @ 433] 0f 000000d1`7439db80 00007ff8`e8308d29 python37!call_function(struct _object *** pp_stack = 0x000000d1`7439dcd8, int64 oparg = , struct _object * kwnames = 0x00000000`00000000)+0x312 [c:\_work\5\s\python\ceval.c @ 4607] .... ---------- messages: 329857 nosy: markind priority: normal severity: normal status: open title: Access violation on alloc in Windows x86-64 embeddable python, pymalloc_alloc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 12:48:46 2018 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Nov 2018 17:48:46 +0000 Subject: [issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr In-Reply-To: <1542060592.48.0.788709270274.issue35222@psf.upfronthosting.co.za> Message-ID: <1542131326.95.0.788709270274.issue35222@psf.upfronthosting.co.za> R. David Murray added the comment: Because the RFCs are defined only for ascii. Non-ascii in RFC 2822 addresses is an RFC violation. In python2 non-ascii would usually round-trip through these functions, but again that was an accident. If you'd like to propose a doc clarification that would be fine, but the clarification would be that behavior on strings containing non-ascii is undefined. Note that these functions are considered soft-deprecated...they are in modules that are in the "Legacy API" section of the email docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 13:35:28 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Nov 2018 18:35:28 +0000 Subject: [issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability In-Reply-To: <1542119446.33.0.788709270274.issue35232@psf.upfronthosting.co.za> Message-ID: <1542134128.76.0.788709270274.issue35232@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 13:49:21 2018 From: report at bugs.python.org (Mark Inderhees) Date: Tue, 13 Nov 2018 18:49:21 +0000 Subject: [issue35235] Access violation on alloc in Windows x86-64 python, pymalloc_alloc In-Reply-To: <1542131178.89.0.788709270274.issue35235@psf.upfronthosting.co.za> Message-ID: <1542134961.39.0.788709270274.issue35235@psf.upfronthosting.co.za> Mark Inderhees added the comment: Actually, I have now seen this in full installed python. I have updated the title. ---------- title: Access violation on alloc in Windows x86-64 embeddable python, pymalloc_alloc -> Access violation on alloc in Windows x86-64 python, pymalloc_alloc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 13:59:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 18:59:33 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542135573.95.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 00b137c72f90fbc39a6cd7e48b37c58d19977180 by Victor Stinner in branch 'master': bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10519) https://github.com/python/cpython/commit/00b137c72f90fbc39a6cd7e48b37c58d19977180 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 14:03:31 2018 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Nov 2018 19:03:31 +0000 Subject: [issue35223] Pathlib incorrectly merges strings. In-Reply-To: <1542067576.58.0.788709270274.issue35223@psf.upfronthosting.co.za> Message-ID: <1542135811.71.0.788709270274.issue35223@psf.upfronthosting.co.za> Eryk Sun added the comment: os.path.join and pathlib are working as designed and documented. Similarly in POSIX we have the following: >>> p = os.path.join("/123/345", "/", "folder///filename.bin") >>> print(p) /folder///filename.bin >>> print(os.path.normpath(p)) /folder/filename.bin The difference is that in Windows there's no root ("/") filesystem, but instead a set of DOS devices (e.g. "C:", "CON:") and UNC shares (e.g. r"\\server\share"), so the Windows implementation of join() uses the drive from the already-joined components in order to resolve a rooted component. ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 14:20:41 2018 From: report at bugs.python.org (Ian Liu Rodrigues) Date: Tue, 13 Nov 2018 19:20:41 +0000 Subject: [issue35236] urllib.request.urlopen throws on some valid FTP files Message-ID: <1542136841.11.0.788709270274.issue35236@psf.upfronthosting.co.za> New submission from Ian Liu Rodrigues : Some FTP clients will not allow changing to a directory if the path does not ends with a slash. For example, try out this in a public FTP: from ftplib import FTP ftp = FTP('ftp.unicamp.br') ftp.login() ftp.cwd('pub/libreoffice') # throws error ftp.cwd('pub/libreoffice/') # OK The problem is urllib.request doesn't include the trailing slash, thus throwing an error. This behavior also happens with the command line ftp client. I think this happens because the libreoffice directory is a symlink, and this can be a FTP server specific behavior. ---------- components: Library (Lib) messages: 329862 nosy: Ian Liu Rodrigues priority: normal severity: normal status: open title: urllib.request.urlopen throws on some valid FTP files type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 14:24:56 2018 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Nov 2018 19:24:56 +0000 Subject: [issue35236] urllib.request.urlopen throws on some valid FTP files In-Reply-To: <1542136841.11.0.788709270274.issue35236@psf.upfronthosting.co.za> Message-ID: <1542137096.49.0.788709270274.issue35236@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9779 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 14:37:32 2018 From: report at bugs.python.org (Glenn Linderman) Date: Tue, 13 Nov 2018 19:37:32 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1542137852.65.0.788709270274.issue10486@psf.upfronthosting.co.za> Glenn Linderman added the comment: That's interesting, Pierre, I hadn't really read the RFC carefully, to realize that many of the "missing" variables from Apache are HTTP headers, and that section 4.1.18 tell how to convert HTTP headers to meta variables. The code in server.py 3.6 (Sorry, I should check the master branch) picks specific HTTP_ headers to include, rather than including them all per the rules. Doing the latter would go a long way toward being more compatible with Apache. I don't know if R?mi got his NGINX list from source code (looks like it) and if maybe NGINX also defines meta variables from the HTTP_ headers, that are not listed in the header file he seems to be quoting. Unless the code has already been improved for Python 3.7, I think there is still some work to do to make server.py conform even to the RFC, if not be compatible with Apache. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 14:40:10 2018 From: report at bugs.python.org (Anjali Malik) Date: Tue, 13 Nov 2018 19:40:10 +0000 Subject: [issue16438] Numeric operator predecence confusing In-Reply-To: <1352384371.29.0.086289583253.issue16438@psf.upfronthosting.co.za> Message-ID: <1542138010.58.0.788709270274.issue16438@psf.upfronthosting.co.za> Change by Anjali Malik : ---------- pull_requests: +9781 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 15:55:02 2018 From: report at bugs.python.org (Thierry Parmentelat) Date: Tue, 13 Nov 2018 20:55:02 +0000 Subject: [issue35237] Allow Path instances in sys.path ? Message-ID: <1542142502.59.0.788709270274.issue35237@psf.upfronthosting.co.za> New submission from Thierry Parmentelat : Hi; this is my first entry in this repo I ran today into a rather frustrating experience, that I'd to avoid it for others as far as possible In a nutshell I had a sphinx stub that read: import sys sys.path.append("..") import mymodule and because I was switching from os.path to pathlib.Path, I rather stupidly changed it into this import sys sys.path.append(Path("..").resolve()) import mymodule --- When trying to run this new code, the message I got was ModuleNotFoundError So I tried to troubleshoot the situation, and inserted something like for x in sys.path: print(x) and so the proper path showed up, and that's the point where I started banging my head against the screen Granted, I was doing too many changes at the same time, and it's entirely my fault if it took me ages really to figure it out eventually. --- Still, my proposal would be to *) either accept Path instances in sys.path, or *) somehow send a warning message stating that the Path instance is totally ignored; at least, I haven't found the corresponding piece of code yet, but as far as I am concerned it's truly as if this Path instance had been completely ignored when executing the import statement *) or at the very least add a mention about this possible issue in the import documentation I understand it was a stupid mistake, but with Path becoming THE right way to deal with paths, I think it is safe to predict that I won't be the only one making it. As I said I am a complete newbie with cpython's codebase and devel practices, so I'll warmly welcome all inputs on this one. thanks ---------- components: Library (Lib) messages: 329864 nosy: thierry.parmentelat priority: normal severity: normal status: open title: Allow Path instances in sys.path ? type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 15:59:37 2018 From: report at bugs.python.org (Ammar Askar) Date: Tue, 13 Nov 2018 20:59:37 +0000 Subject: [issue35237] Allow Path instances in sys.path ? In-Reply-To: <1542142502.59.0.788709270274.issue35237@psf.upfronthosting.co.za> Message-ID: <1542142777.26.0.788709270274.issue35237@psf.upfronthosting.co.za> Ammar Askar added the comment: Looks like there's an issue already open for this. ---------- nosy: +ammar2 resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> add support for path-like objects in sys.path _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:03:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 21:03:13 +0000 Subject: [issue35235] Access violation on alloc in Windows x86-64 python, pymalloc_alloc In-Reply-To: <1542131178.89.0.788709270274.issue35235@psf.upfronthosting.co.za> Message-ID: <1542142993.92.0.788709270274.issue35235@psf.upfronthosting.co.za> STINNER Victor added the comment: Try to reproduce your bug using PYTHONMALLOC=debug environment variable: https://pythondev.readthedocs.io/debug_tools.html#memory-debugger On Python 3.7, you can use "py -3.7 -X dev program.py" (-X dev option) to enable PYTHONMALLOC=debug. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:17:00 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Nov 2018 21:17:00 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542143820.4.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 746b2d35ea47005054ed774fecaed64fab803d7d by Gregory P. Smith in branch 'master': bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) https://github.com/python/cpython/commit/746b2d35ea47005054ed774fecaed64fab803d7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:17:06 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 21:17:06 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542143826.59.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:17:16 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 21:17:16 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542143836.82.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:29:55 2018 From: report at bugs.python.org (Oscar Esteban) Date: Tue, 13 Nov 2018 21:29:55 +0000 Subject: [issue35238] Alleviate memory reservation of fork_exec in subprocess.Popen via forkserver Message-ID: <1542144595.84.0.788709270274.issue35238@psf.upfronthosting.co.za> New submission from Oscar Esteban : ## Context We are developers of nipype (https://github.com/nipype) which is a workflow engine for neuroimaging software. We are experiencing problems that gave rise to the addition of ``os.posix_spawn`` to Python 3.8, and particularly, this - https://bugs.python.org/issue20104#msg222570 Our software runs command line subprocesses that can be quite memory-hungry and in some cases, in the order of tens of thousands processes. Therefore, we frequently see the OOM killing some of the processes. ## Status We have successfully leveraged the ``forkserver`` context (in addition to a low number of `maxtasksperchild`) of multiprocessing to ease the load. However, the fork_exec memory allocation is still problematic on systems that do not allow overcommitting virtual memory. Waiting for os.posix_spawn to be rolled out might not be an option for us, as the problem is hitting badly right now. ## Proposed solution I'd like to page experts on Lib/multiprocessing and Lib/subprocess to give their opinions about the following: is it possible to write an extension to `multiprocessing.util.Popen` such that it has the API of `subprocess.Popen` but the fork happens via the forkserver? My naive intuition is that we would need to create a new type of Process, make sure that it then calls os.exec*e() --possibly around here https://github.com/python/cpython/blob/f966e5397ed8f5c42c185223fc9b4d750a678d02/Lib/multiprocessing/popen_forkserver.py#L51--, and finally handle communication with the subprocess. Please let me know if that is even possible. ---------- components: Library (Lib) messages: 329868 nosy: oesteban priority: normal severity: normal status: open title: Alleviate memory reservation of fork_exec in subprocess.Popen via forkserver type: enhancement versions: 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 Tue Nov 13 16:49:01 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 21:49:01 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542145741.37.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I am going to dupe this to 33725 after all. ---------- resolution: -> duplicate superseder: -> High Sierra hang when using multi-processing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:50:08 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Nov 2018 21:50:08 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542145808.74.0.788709270274.issue35214@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fdc485a5dff8508328b4f26265d0af1ba5004597 by Miss Islington (bot) in branch '3.6': bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) https://github.com/python/cpython/commit/fdc485a5dff8508328b4f26265d0af1ba5004597 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:50:10 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 21:50:10 +0000 Subject: [issue33725] High Sierra hang when using multi-processing In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542145810.52.0.788709270274.issue33725@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: issue35219 is where I've run into this problem. I'm still trying to figure out all the details in my own case, but I can confirm that setting the environment variable does not always help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:50:33 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 21:50:33 +0000 Subject: [issue33725] High Sierra hang when using multi-processing In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542145833.65.0.788709270274.issue33725@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:51:01 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 21:51:01 +0000 Subject: [issue33725] macOS crashes after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542145861.98.0.788709270274.issue33725@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- title: High Sierra hang when using multi-processing -> macOS crashes after fork with no exec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 16:51:14 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Nov 2018 21:51:14 +0000 Subject: [issue33725] Pytho crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542145874.31.0.788709270274.issue33725@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- title: macOS crashes after fork with no exec -> Pytho crashes on macOS after fork with no exec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 17:35:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 22:35:52 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542148552.35.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 18:08:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 23:08:32 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration Message-ID: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> New submission from STINNER Victor : Extract of _PySys_EndInit(): SET_SYS_FROM_STRING_BORROW("path", config->module_search_path); sys.path is initialized from _PyMainInterpreterConfig.module_search_path object: the list of strings is not copied. As a consequence, when sys.path is modified, _PyMainInterpreterConfig is modified as well. For example, "import site" modifies sys.path. I dislike this behavior. I prefer to see _PyMainInterpreterConfig as "constant": a snapshot of the configuration used to startup Python. A side effect is that Py_NewInterpreter() copies the modified configuration, whereas starting from the "original" configuration. For the specific case of Py_NewInterpreter(), I'm not sure of what is the expected behavior... Py_NewInterpreter() imports the "site" module again, so it should reapply the same sys.path change. Note: I found this bug while working on better tests for global, core and main configurations: https://github.com/python/cpython/pull/10524 ---------- components: Interpreter Core messages: 329872 nosy: eric.snow, ncoghlan, vstinner priority: normal severity: normal status: open title: _PySys_EndInit() doesn't copy main interpreter configuration versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 18:24:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Nov 2018 23:24:32 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542151472.98.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7ddd56f4d835c6107b20a0b4233185bb59270142 by Victor Stinner in branch 'master': bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524) https://github.com/python/cpython/commit/7ddd56f4d835c6107b20a0b4233185bb59270142 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 18:44:33 2018 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 13 Nov 2018 23:44:33 +0000 Subject: [issue16438] Numeric operator predecence confusing In-Reply-To: <1352384371.29.0.086289583253.issue16438@psf.upfronthosting.co.za> Message-ID: <1542152673.07.0.788709270274.issue16438@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I'm actually thinking perhaps the "see :ref:`operator-summary`" clause should be separate and under Notes below the table, as opposed to current PR: ``` All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`) ``` reads oddly to me. ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 19:13:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 00:13:41 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542154421.71.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 19:33:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 00:33:30 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542155610.59.0.788709270274.issue35239@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9786 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 19:39:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Nov 2018 00:39:40 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542155980.4.0.788709270274.issue35214@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9fbcb1402efab4e287f25145a69ba14c9c6dbce9 by Miss Islington (bot) in branch '3.7': [3.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10522) https://github.com/python/cpython/commit/9fbcb1402efab4e287f25145a69ba14c9c6dbce9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 19:49:31 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 00:49:31 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542156571.19.0.788709270274.issue31354@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Is it an actual problem to compile extension modules with -flto? (I realize as an extension module there isn't a huge benefit to the concept unless it happens to have multiple source files or link against a non-shared library) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 19:54:49 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 00:54:49 +0000 Subject: [issue23734] zipimport should not check pyc timestamps against zipped py files In-Reply-To: <1426964347.09.0.21067648462.issue23734@psf.upfronthosting.co.za> Message-ID: <1542156889.3.0.788709270274.issue23734@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Correct, this issue was filed before we had the new pyc options (which came out of our September core dev. sprint in 2016 iirc). I'll just close it, the way forward for people using zip files on modern CPython interpreters is to explicitly use the new unchecked feature. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:01:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:01:57 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542157317.53.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 35c28d562ec7249f2a6aef8e326eadac130a1656 by Victor Stinner in branch '3.7': [3.7] bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524) (GH-10529) https://github.com/python/cpython/commit/35c28d562ec7249f2a6aef8e326eadac130a1656 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:03:15 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Nov 2018 01:03:15 +0000 Subject: [issue34784] Heap-allocated StructSequences In-Reply-To: <1537773797.44.0.956365154283.issue34784@psf.upfronthosting.co.za> Message-ID: <1542157395.42.0.788709270274.issue34784@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +9787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:07:44 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 01:07:44 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542157664.47.0.788709270274.issue33725@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- title: Pytho crashes on macOS after fork with no exec -> Python crashes on macOS after fork with no exec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:07:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:07:55 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542157675.2.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:10:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:10:43 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542157843.96.0.788709270274.issue35239@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached PR 10532 modifies _PySys_EndInit() to copy lists and dictionaries from the config. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:14:28 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 01:14:28 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542158068.25.0.788709270274.issue33725@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Hoo boy. I'm not sure I have the full picture, but things are starting to come into focus. After much debugging, I've narrowed down at least one crash to urllib.request.getproxies(). On macOS (darwin), this ends up calling _scproxy.get_proxies() which calls into the SystemConfiguration framework. I'll bet dollars to donuts that that calls into the ObjC runtime. Thus it is unsafe to call between fork and exec. This certainly seems to be the case even if the environment variable is set. The problem is that I think requests.post() probably also ends up in here somehow (still untraced), because by removing our call to urllib.requests.getproxies(), we just crash later on when requests.post() is called. I don't know what, if anything can be done in Python, except perhaps to document that anything that calls into the ObjC runtime between fork and exec can potentially crash the subprocess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:19:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:19:39 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start Message-ID: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> New submission from STINNER Victor : Travis CI fails randomly with "xvfb-run: error: Xvfb failed to start". Example: https://travis-ci.org/python/cpython/jobs/454776965 whereas the full test suite succeeded. ---------- messages: 329881 nosy: vstinner priority: normal severity: normal status: open title: Travis CI: xvfb-run: error: Xvfb failed to start _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:19:46 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Nov 2018 01:19:46 +0000 Subject: [issue34784] Heap-allocated StructSequences In-Reply-To: <1537773797.44.0.956365154283.issue34784@psf.upfronthosting.co.za> Message-ID: <1542158386.43.0.788709270274.issue34784@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: PR9665 solves also Issue28709 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:21:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:21:44 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1542158504.87.0.788709270274.issue35240@psf.upfronthosting.co.za> STINNER Victor added the comment: Extract of .travis.yml: $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then $XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest fi I'm not sure what is xvfb, nor why it's needed to run doctests... ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:21:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:21:50 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1542158510.17.0.788709270274.issue35240@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:26:47 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Nov 2018 01:26:47 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1542158807.33.0.788709270274.issue35240@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: xvfb is a utility that allows you to run a command in a virtual X server environment. I assume that is needed for the doctests that use the X server. I assume is related to PR9806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:27:35 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 01:27:35 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542158855.81.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +9789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:36:15 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 01:36:15 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542159375.96.0.788709270274.issue33725@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: A few other things I don't understand: * Why does setting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES only seem to work when it's set in the shell before the parent process executes? AFAICT, it does *not* work if you set that in os.environ in the parent process before the os.fork(). * Why does it only crash on the first invocation of our app? Does getproxies() cache the results somehow? There's too much internal application code in the way to know if we're doing something that prevents getproxies() from getting called in subsequent calls. * I can't seem to produce a smaller test case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:45:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:45:38 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542159938.66.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 88cbea4c6ff4987ce31f4fe6f73c2d04a3d37829 by Victor Stinner in branch '3.7': bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10537) https://github.com/python/cpython/commit/88cbea4c6ff4987ce31f4fe6f73c2d04a3d37829 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 20:45:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 01:45:57 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542159957.22.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 21:38:37 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Nov 2018 02:38:37 +0000 Subject: [issue35241] test_embed fails on MacOS buildbots Message-ID: <1542163117.23.0.788709270274.issue35241@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : https://buildbot.python.org/all/#/builders/147/builds/430/steps/4/logs/stdio https://buildbot.python.org/all/#/builders/109/builds/789/steps/4/logs/stdio ====================================================================== FAIL: test_init_default_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 398, in test_init_default_config self.check_config("init_default_config", {}, {}) File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 391, in check_config self.assertEqual(config['global_config'], expected_global) AssertionError: {'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_[467 chars]': 0} != {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, [467 chars]': 0} {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, 'Py_DontWriteBytecodeFlag': 0, 'Py_FileSystemDefaultEncodeErrors': 'surrogateescape', 'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_FrozenFlag': 0, - 'Py_HasFileSystemDefaultEncoding': 1, ? ^ + 'Py_HasFileSystemDefaultEncoding': 0, ? ^ 'Py_HashRandomizationFlag': 1, 'Py_IgnoreEnvironmentFlag': 0, 'Py_InspectFlag': 0, 'Py_InteractiveFlag': 0, 'Py_IsolatedFlag': 0, 'Py_NoSiteFlag': 0, 'Py_NoUserSiteDirectory': 0, 'Py_OptimizeFlag': 0, 'Py_QuietFlag': 0, 'Py_UTF8Mode': 0, 'Py_UnbufferedStdioFlag': 0, 'Py_VerboseFlag': 0} ====================================================================== FAIL: test_init_dev_mode (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 479, in test_init_dev_mode self.check_config("init_dev_mode", core_config, {}) File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 391, in check_config self.assertEqual(config['global_config'], expected_global) AssertionError: {'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_[467 chars]': 0} != {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, [467 chars]': 0} {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, 'Py_DontWriteBytecodeFlag': 0, 'Py_FileSystemDefaultEncodeErrors': 'surrogateescape', 'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_FrozenFlag': 0, - 'Py_HasFileSystemDefaultEncoding': 1, ? ^ + 'Py_HasFileSystemDefaultEncoding': 0, ? ^ 'Py_HashRandomizationFlag': 1, 'Py_IgnoreEnvironmentFlag': 0, 'Py_InspectFlag': 0, 'Py_InteractiveFlag': 0, 'Py_IsolatedFlag': 0, 'Py_NoSiteFlag': 0, 'Py_NoUserSiteDirectory': 0, 'Py_OptimizeFlag': 0, 'Py_QuietFlag': 0, 'Py_UTF8Mode': 0, 'Py_UnbufferedStdioFlag': 0, 'Py_VerboseFlag': 0} ====================================================================== FAIL: test_init_isolated (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 489, in test_init_isolated self.check_config("init_isolated", core_config, global_config) File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_embed.py", line 391, in check_config self.assertEqual(config['global_config'], expected_global) AssertionError: {'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_[467 chars]': 1} != {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, [467 chars]': 1} {'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, 'Py_DontWriteBytecodeFlag': 0, 'Py_FileSystemDefaultEncodeErrors': 'surrogateescape', 'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_FrozenFlag': 0, - 'Py_HasFileSystemDefaultEncoding': 1, ? ^ + 'Py_HasFileSystemDefaultEncoding': 0, ? ^ 'Py_HashRandomizationFlag': 1, 'Py_IgnoreEnvironmentFlag': 1, 'Py_InspectFlag': 0, 'Py_InteractiveFlag': 0, 'Py_IsolatedFlag': 1, 'Py_NoSiteFlag': 0, 'Py_NoUserSiteDirectory': 1, 'Py_OptimizeFlag': 0, 'Py_QuietFlag': 0, 'Py_UTF8Mode': 0, 'Py_UnbufferedStdioFlag': 0, 'Py_VerboseFlag': 0} ---------------------------------------------------------------------- Ran 15 tests in 6.518s FAILED (failures=3) 1 test failed again: test_embed ---------- components: Tests messages: 329887 nosy: pablogsal, vstinner priority: normal severity: normal status: open title: test_embed fails on MacOS buildbots versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 21:38:48 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Nov 2018 02:38:48 +0000 Subject: [issue35241] test_embed fails on MacOS buildbots In-Reply-To: <1542163117.23.0.788709270274.issue35241@psf.upfronthosting.co.za> Message-ID: <1542163128.29.0.788709270274.issue35241@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 13 23:35:55 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 14 Nov 2018 04:35:55 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1542170155.36.0.788709270274.issue35240@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Found a relevant issue but 3 years old : https://github.com/travis-ci/travis-ci/issues/4387#issuecomment-125635027 Doc PR : https://github.com/travis-ci/docs-travis-ci-com/pull/311 . The docs recommend usage of -a to select a free port. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 00:26:21 2018 From: report at bugs.python.org (Sergei Zobov) Date: Wed, 14 Nov 2018 05:26:21 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished Message-ID: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> New submission from Sergei Zobov : In case if the process target function put something unpickable in the `multiprocessing.Queue` and finish before `ForkingPickler`'s exception is handled we get two weird situations: * Internal queue semaphore stay acquired and never will be released, so we get `qsize()` always returns 1(or more if more then one process) even if there is nothing in queue's buffer and `empty()` returns `True`. * An exception's traceback will be silently suppressed. To reproduce this behavior I wrote a test in cpython repo (be aware sometime it pass sometime no): https://github.com/szobov/cpython/commit/95524f10a7b6510e9ab4647223cc67af85ebff86 I suppose it happens because of this: * The function `util._exit_function()` calls every time process target function finished. Inside this function the global (for current process) flag `utils._exiting` marks as `True`: https://github.com/python/cpython/blob/master/Lib/multiprocessing/process.py#L300 https://github.com/python/cpython/blob/master/Lib/multiprocessing/util.py#L294-L295 * When exception while pickling object happens in `Queue._feed` function we are ignore it because of the clause `is_exiting()` that checks the flag `utils._exiting` described above. https://github.com/python/cpython/blob/master/Lib/multiprocessing/queues.py#L257-L259 So we have unreleased semaphore and ignored exceptions. I think it's quite disappointing for user because they have broken queue and nothing about why it happened. I'm not quite sure that it's a bag but I found nothing in documentation about it. ---------- messages: 329889 nosy: szobov priority: normal severity: normal status: open title: multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 03:03:16 2018 From: report at bugs.python.org (Martin Panter) Date: Wed, 14 Nov 2018 08:03:16 +0000 Subject: [issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close() In-Reply-To: <1483731701.21.0.630358100063.issue29183@psf.upfronthosting.co.za> Message-ID: <1542182596.72.0.788709270274.issue29183@psf.upfronthosting.co.za> Martin Panter added the comment: There are actually two ?close? methods in the WSGI package: ServerHandler?s implementation extends the BaseHandler implementation. Making the ?close? methods do nothing if called a second time would avoid the error about ?self.status? being None, but won?t help very much with other problems, such as: * If no response has been sent when the exception happens, the first call to ?ServerHandler.close? still won?t have a HTTP status code or response size to log. It is more useful in this case to log the 500 code in the second ?close? call after the error page is generated, which is what happens in 2.6. * If the response was started when the exception happens, the first call to ?BaseHandler.close? will still reset ?self.headers_sent?, which fools ?handle_error? into trying to generate a 500 response despite already having started the application response. To be clear, what I had in mind last week was to adjust ?finish_response? to look something like: class BaseHandler: ... def finish_response(self): try: ... except: # Limited version of ?close? method on exception if hasattr(self.result, 'close'): self.result.close() raise self.close() # Full ?close? method when no exception For the record: This is related to Issue 27682, specifically about handling ConnectionAbortedError and other network errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 03:08:28 2018 From: report at bugs.python.org (pmpp) Date: Wed, 14 Nov 2018 08:08:28 +0000 Subject: [issue35243] readline timeout too long for async gfx use Message-ID: <1542182908.62.0.788709270274.issue35243@psf.upfronthosting.co.za> New submission from pmpp : unlike https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame which is fires about each 1/60 second : the callback for gui via PyOS_InputHook is as long as 0.1 second. https://github.com/python/cpython/blob/8e0b05e2f4b9fd703cbe1ae8d058852ef3781f44/Modules/readline.c#L1192 using repl asyncronously with such a timer is a bad experience when using async opengl based gui : asyncio loop steps should be able to be served at vsync speed which is not actually possible because of hardcoded value. 0.008 seconds would not be so bad, best would be plan next call to hit T+ frametime ( with a default to 0.016 ) each pass inside the loop. a use case for python would be panda3d and its various gui. real life example in other mainstream language : the javascript repl in the browser console. ---------- components: Extension Modules messages: 329891 nosy: pmpp priority: normal severity: normal status: open title: readline timeout too long for async gfx use type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 04:20:44 2018 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 14 Nov 2018 09:20:44 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542187244.77.0.788709270274.issue33196@psf.upfronthosting.co.za> Arcadiy Ivanov added the comment: @gus.goulart you have reproduced it. The screenshot showing `-11` means the process dumped core. Because it's the child that dumps core, it's masked by abrt. Observe: $ python3 --version Python 3.7.1 $ python3 ~/Downloads/test_lock_sigsegv.py Parent r_q: , , -11 $ abrt 61bdd28 1x /usr/bin/python3.7 2018-11-14 04:18:06 $ uname -a Linux myhost 4.18.17-300.fc29.x86_64 #1 SMP Mon Nov 5 17:56:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 04:23:49 2018 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 14 Nov 2018 09:23:49 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542187429.08.0.788709270274.issue33196@psf.upfronthosting.co.za> Arcadiy Ivanov added the comment: @taleinat The above has been reproduced on Fedora 29. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 04:31:13 2018 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 14 Nov 2018 09:31:13 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542187873.64.0.788709270274.issue33196@psf.upfronthosting.co.za> Change by Arcadiy Ivanov : Added file: https://bugs.python.org/file47933/coredump _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 04:39:39 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 14 Nov 2018 09:39:39 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542188379.72.0.788709270274.issue35230@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset a757649fd6535c5e65481eb1077e30687421b92b by INADA Naoki in branch 'master': bpo-35230: dict: Remove some macros (GH-10513) https://github.com/python/cpython/commit/a757649fd6535c5e65481eb1077e30687421b92b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 04:40:19 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 14 Nov 2018 09:40:19 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542188419.35.0.788709270274.issue35230@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:01:21 2018 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 14 Nov 2018 10:01:21 +0000 Subject: [issue28709] PyStructSequence_NewType is broken; makes GC type without setting Py_TPFLAGS_HEAPTYPE In-Reply-To: <1479254414.47.0.784230878249.issue28709@psf.upfronthosting.co.za> Message-ID: <1542189681.58.0.788709270274.issue28709@psf.upfronthosting.co.za> Petr Viktorin added the comment: Should be fixed in PR9665 (bpo-34784), thanks to Eddie Elizondo. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:01:50 2018 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 14 Nov 2018 10:01:50 +0000 Subject: [issue28709] PyStructSequence_NewType is broken; makes GC type without setting Py_TPFLAGS_HEAPTYPE In-Reply-To: <1479254414.47.0.784230878249.issue28709@psf.upfronthosting.co.za> Message-ID: <1542189710.34.0.788709270274.issue28709@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:07:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:07:11 +0000 Subject: [issue35230] Remove _Py_REF_DEBUG_COMMA In-Reply-To: <1542110925.09.0.788709270274.issue35230@psf.upfronthosting.co.za> Message-ID: <1542190031.81.0.788709270274.issue35230@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks. I almost started my project to convert macros to static inline functions just to remove ugly things like: #define _Py_REF_DEBUG_COMMA , (Well, there are other reasons to move to proper functions.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:11:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:11:28 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542190288.27.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:16:26 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 14 Nov 2018 10:16:26 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542190586.09.0.788709270274.issue31354@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: I'd say yes. In general python may have been compiled with -flto, but it's still a bit buggy from the compilers' side. It doesn't work well always or at all depending on the toolchain, and even if python was compiled with -flto, that doesn't mean that all c extensions compiled using that python build, would work properly with -flto. In my opinion that should be a flag reserved for python only, if used for its compilation, and not having it propagated to c extensions, similarly to the PGO related flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:24:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:24:53 +0000 Subject: [issue35241] [3.7] test_embed fails on MacOS buildbots In-Reply-To: <1542163117.23.0.788709270274.issue35241@psf.upfronthosting.co.za> Message-ID: <1542191093.3.0.788709270274.issue35241@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: test_embed fails on MacOS buildbots -> [3.7] test_embed fails on MacOS buildbots _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:35:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:35:40 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542191740.71.0.788709270274.issue33196@psf.upfronthosting.co.za> STINNER Victor added the comment: > At a minimum I think there should be a check trying to reduce arguments via incompatible context's process to prevent a SEGV. I'm not sure that I understand the bug. The reproducer script pass a multiprocessing.Queue to a child process and then the child crash when attempting to call multiprocessing.synchronize.Lock.__repr__(). Does the child reuse a copy of the lock of the parent process? Or does the child create a new SemLock? I reproduced the bug on Fedora 26. I attached the child process in gdb. The crash occurs on sem_getvalue() in the child process. Program received signal SIGSEGV, Segmentation fault. 0x00007f29a5156610 in sem_getvalue@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 (gdb) where #0 0x00007f29a5156610 in sem_getvalue@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 #1 0x00007f299c60e7bb in semlock_getvalue (self=0x7f299a95e2b0, _unused_ignored=0x0) at /home/haypo/prog/python/master/Modules/_multiprocessing/semaphore.c:541 #2 0x0000000000434537 in _PyMethodDef_RawFastCallKeywords (method=0x7f299c8102e0 , self=<_multiprocessing.SemLock at remote 0x7f299a95e2b0>, args=0x7f299c5f47e8, nargs=0, kwnames=0x0) at Objects/call.c:629 #3 0x0000000000607aff in _PyMethodDescr_FastCallKeywords (descrobj=, args=0x7f299c5f47e0, nargs=1, kwnames=0x0) at Objects/descrobject.c:288 #4 0x0000000000512f92 in call_function (pp_stack=0x7ffd3591f730, oparg=1, kwnames=0x0) at Python/ceval.c:4595 (...) (gdb) py-bt Traceback (most recent call first): File "/home/haypo/prog/python/master/Lib/multiprocessing/synchronize.py", line 170, in __repr__ elif self._semlock._get_value() == 1: File "/home/haypo/prog/python/master/test_lock_sigsegv.py", line 20, in child print("Child r_q: %r, %r, %r" % (r_q._rlock, r_q._wlock, r_q._sem), flush=True) File "/home/haypo/prog/python/master/Lib/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/haypo/prog/python/master/Lib/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/haypo/prog/python/master/Lib/multiprocessing/spawn.py", line 130, in _main return self._bootstrap() File "/home/haypo/prog/python/master/Lib/multiprocessing/spawn.py", line 629, in spawn_main File "", line 1, in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:36:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:36:59 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542191819.37.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bc09ee8bc9c0ce4873cdaab6ca524a3ee3a36be1 by Victor Stinner in branch '3.7': bpo-35233: Fix test_embed.InitConfigTests on macOS (GH-10539) https://github.com/python/cpython/commit/bc09ee8bc9c0ce4873cdaab6ca524a3ee3a36be1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 05:41:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 10:41:55 +0000 Subject: [issue35241] [3.7] test_embed fails on MacOS buildbots In-Reply-To: <1542163117.23.0.788709270274.issue35241@psf.upfronthosting.co.za> Message-ID: <1542192115.48.0.788709270274.issue35241@psf.upfronthosting.co.za> STINNER Victor added the comment: I merged https://github.com/python/cpython/pull/10539 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 06:02:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 11:02:17 +0000 Subject: [issue35241] [3.7] test_embed fails on MacOS buildbots In-Reply-To: <1542163117.23.0.788709270274.issue35241@psf.upfronthosting.co.za> Message-ID: <1542193337.64.0.788709270274.issue35241@psf.upfronthosting.co.za> STINNER Victor added the comment: macOS buildbots are back to green. Thanks Pablo for creating the issue! I forgot the subtle differences on Py_HasFileSystemDefaultEncoding on Python 3.7... Python 3.8 has a more "portable" behavior now. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:08:32 2018 From: report at bugs.python.org (Jaime Torres) Date: Wed, 14 Nov 2018 12:08:32 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build Message-ID: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> New submission from Jaime Torres : Clang is not in the list of allowed compilers when executed: python setup.py build --help-compiler --compiler=bcpp Borland C++ Compiler --compiler=cygwin Cygwin port of GNU C Compiler for Win32 --compiler=mingw32 Mingw32 port of GNU C Compiler for Win32 --compiler=msvc Microsoft Visual C++ --compiler=unix standard UNIX-style compiler I've tried to use the value unix in windows, to see if it will search for environment variables CC and CXX, but without success. ---------- components: Distutils messages: 329902 nosy: Jaime Torres, dstufft, eric.araujo priority: normal severity: normal status: open title: Allow to setup Clang as default compiler for modules build versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:22:50 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 14 Nov 2018 12:22:50 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542198170.83.0.788709270274.issue35244@psf.upfronthosting.co.za> St?phane Wirtel added the comment: I confirm the issue, the main issue we have to support the CLang compiler into distutils. ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:22:55 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 14 Nov 2018 12:22:55 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542198175.86.0.788709270274.issue35244@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:46:34 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 14 Nov 2018 12:46:34 +0000 Subject: [issue35143] `from __future__ import annotations` has no effect inside `ast.parse` In-Reply-To: <1541147333.05.0.788709270274.issue35143@psf.upfronthosting.co.za> Message-ID: <1542199594.89.0.788709270274.issue35143@psf.upfronthosting.co.za> ?ukasz Langa added the comment: I think this is a bug, actually. It's going to be an incompatibility in `ast.parse` so we'll probably want to only enable it in Python 3.8. This should have stringified annotations: >>> p = ast.parse(""" ... from __future__ import annotations ... a: 1 ... """) >>> p.body[1].annotation # ACTUAL <_ast.Num object at 0x1048cf470> >>> p.body[1].annotation # EXPECTED <_ast.Str object at 0x1048cf6a0> ---------- assignee: -> lukasz.langa stage: -> needs patch title: Annotations future requires unparse, but not accessible from Python -> `from __future__ import annotations` has no effect inside `ast.parse` type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:53:26 2018 From: report at bugs.python.org (Sergei Zobov) Date: Wed, 14 Nov 2018 12:53:26 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542200006.13.0.788709270274.issue35242@psf.upfronthosting.co.za> Change by Sergei Zobov : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 07:59:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 12:59:36 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542200376.77.0.788709270274.issue35239@psf.upfronthosting.co.za> STINNER Victor added the comment: Python has 3 kind of configurations: * global configuration variables like Py_VerboseFlag * core configuration: _PyCoreConfig * main interpreter configuration: _PyMainInterpreterConfig I tried to keep them consistency. Yesterday, I rewrote test_embed.InitConfigTests to really test that these 3 configurations are consistent... And I found multiple bugs :-) (I fixed them as well) sys.flags is immutable, but some configurations are only used to "initialize" Python which can then be modified. sys.path is a good example. I don't think that we can ensure that sys.path is always consistent with the main/core configuration (module_search_paths). It's possible to write "sys.path = ['/new/path']". There is no machinery at the module level to call a function when a sys module is *replaced*. I propose to try to ensure that the configuration is not modified during Python lifecycle, and so that sys.path is a *copy* of the configuration. Same rationale for sys.warnoptions (list) and sys._xoptions (dict). Attached PR 10532 implements this solution: copy lists and dicts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 08:24:33 2018 From: report at bugs.python.org (Yechoh) Date: Wed, 14 Nov 2018 13:24:33 +0000 Subject: [issue35245] list comprehension for flattened or nested list differ too much Message-ID: <1542201873.24.0.788709270274.issue35245@psf.upfronthosting.co.za> New submission from Yechoh : Suppose we have: forest = [[1,2],[3,4]] and we want: l1 = [['1','2'],['3','4']] we could write: l1 = [[str(leaf) for leaf in tree] for tree in forest] Now if we want: l2 = ['1','2','3','4'] What I expect to need to write is: l2 = [str(leaf) for leaf in tree for tree in forest] However, this gives an error: Traceback (most recent call last): File "", line 1, in NameError: name 'tree' is not defined Instead, I should write: l2 = [str(leaf) for tree in forest for leaf in tree] Notice the different order. I would prefer if the first version of constructing l2 over the second, since it follows closer to the reading order. Also, it is closer to the comprehension for a nested list, so changing a nested list comprehension to a flattened list comprehension is easy. ---------- messages: 329906 nosy: Yechoh priority: normal severity: normal status: open title: list comprehension for flattened or nested list differ too much type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 08:50:49 2018 From: report at bugs.python.org (lilydjwg) Date: Wed, 14 Nov 2018 13:50:49 +0000 Subject: [issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does Message-ID: <1542203449.76.0.788709270274.issue35246@psf.upfronthosting.co.za> New submission from lilydjwg : When I pass pathlib.Path to asyncio.create_subprocess_exec I get: TypeError: program arguments must be a bytes or text string, not PosixPath It's not so good when subprocess accepts this kind of arguments without issues. So can you add support for this? ---------- components: asyncio messages: 329907 nosy: asvetlov, lilydjwg, yselivanov priority: normal severity: normal status: open title: asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 08:53:16 2018 From: report at bugs.python.org (Gus Goulart) Date: Wed, 14 Nov 2018 13:53:16 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542203596.68.0.788709270274.issue33196@psf.upfronthosting.co.za> Gus Goulart added the comment: @vstinner, on Debian 9 I can see the problem as well but wasn't able to debug with the level of details you did. Could you please share the process you followed? What I found was: ./python -X dev test_lock_sigsegv.py Parent r_q: , , Fatal Python error: Segmentation fault Current thread 0x00007fab36124480 (most recent call first): File "/home/gus/Workspace/cpython/Lib/multiprocessing/synchronize.py", line 170 in __repr__ File "/home/gus/Workspace/cpython/test_lock_sigsegv.py", line 17 in child File "/home/gus/Workspace/cpython/Lib/multiprocessing/process.py", line 99 in run File "/home/gus/Workspace/cpython/Lib/multiprocessing/process.py", line 297 in _bootstrap File "/home/gus/Workspace/cpython/Lib/multiprocessing/spawn.py", line 130 in _main File "/home/gus/Workspace/cpython/Lib/multiprocessing/spawn.py", line 117 in spawn_main File "", line 1 in -11 Using GDB: (gdb) set follow-fork-mode child (gdb) run test_lock_sigsegv.py Starting program: /home/gus/Workspace/cpython/python test_lock_sigsegv.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Parent r_q: , , [New process 4941] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". process 4941 is executing new program: /home/gus/Workspace/cpython/python -11 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [Inferior 2 (process 4941) exited normally] (gdb) where No stack. (gdb) py-bt Unable to locate python frame (gdb) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 09:08:05 2018 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 14 Nov 2018 14:08:05 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542204485.15.0.788709270274.issue33196@psf.upfronthosting.co.za> Arcadiy Ivanov added the comment: @vstinner > I'm not sure that I understand the bug. The bug is, if a user makes an error and passes a Queue from context 'fork' to a child that is spawned using 'spawn', the passed Queue is, for obvious reasons, broken. The 'print("Child r_q: %r, %r, %r" % (r_q._rlock, r_q._wlock, r_q._sem), flush=True)' is simply a demonstration of a broken state of the SemLock observed in the child. The expected fix would be to stop the mixed context use of MP objects on the API level (ValueError?) or at least prevent a segfault. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 09:21:58 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 14 Nov 2018 14:21:58 +0000 Subject: [issue35245] list comprehension for flattened or nested list differ too much In-Reply-To: <1542201873.24.0.788709270274.issue35245@psf.upfronthosting.co.za> Message-ID: <1542205318.52.0.788709270274.issue35245@psf.upfronthosting.co.za> Steven D'Aprano added the comment: > l2 = [str(leaf) for leaf in tree for tree in forest] Expanded to nested loops, that becomes: l2 = [] for leaf in tree: for tree in forest: l2.append(str(leaf)) which of course gives a NameError, because you are trying to iterate over a tree that you haven't defined yet. The correct way to write this nested comprehension is to put the loops in the same order that they will appear in a nested loop: [str(leaf) for tree in forest for leaf in tree] There are thousands, or more, of nested comprehensions using the existing order in code around the world, if we swapped to your proposed "backwards" order it would change the meaning of their code and break it. That's not going to happen without an excellent reason. I'm closing this "rejected". If you want to debate this and push for the proposed change, you should discuss it on the Python-Ideas mailing list first. ---------- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 09:23:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 14:23:27 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542205407.9.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 10:20:47 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 15:20:47 +0000 Subject: [issue32429] Outdated Modules/Setup warning is invisible In-Reply-To: <1514326238.69.0.213398074469.issue32429@psf.upfronthosting.co.za> Message-ID: <1542208847.17.0.788709270274.issue32429@psf.upfronthosting.co.za> Julien Palard added the comment: Fixed in 961d54c5c1916c09883ebcf7191babc969e5a5cf. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 10:22:31 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 15:22:31 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542208951.78.0.788709270274.issue32613@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 64313478bcbd0a708c3ce5d4d14f977da56e4be9 by Julien Palard in branch 'master': bpo-32613: Update window FAQ (GH-5552) https://github.com/python/cpython/commit/64313478bcbd0a708c3ce5d4d14f977da56e4be9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:01:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 16:01:51 +0000 Subject: [issue33196] multiprocessing: serialization must ensure that contexts are compatible (the same) In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542211311.86.0.788709270274.issue33196@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched -> multiprocessing: serialization must ensure that contexts are compatible (the same) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:02:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 16:02:18 +0000 Subject: [issue33196] multiprocessing: serialization must ensure that contexts are compatible (the same) In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542211338.5.0.788709270274.issue33196@psf.upfronthosting.co.za> STINNER Victor added the comment: > The bug is, if a user makes an error and passes a Queue from context 'fork' to a child that is spawned using 'spawn', the passed Queue is, for obvious reasons, broken. Ok. I rewrote the issue title. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:14:47 2018 From: report at bugs.python.org (markmcclain) Date: Wed, 14 Nov 2018 16:14:47 +0000 Subject: [issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely Message-ID: <1542212087.25.0.788709270274.issue35247@psf.upfronthosting.co.za> New submission from markmcclain : test.test_socket.RDSTest.testPeek() can hang indefinitely. ThreadableTest attempts to ensure ordering of operations, but allows both the client and server to proceed without guaranteeing that the data is sent prior to the blocking attempt to peek at the socket's contents. Either the test needs to make recvfrom non-blocking with a timeout/retry loop or ensure data is sent prior to allowing the server to proceed. ---------- components: Tests messages: 329914 nosy: markmcclain priority: normal severity: normal status: open title: test.test_socket.RDSTest.testPeek hangs indefinitely type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:17:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 16:17:45 +0000 Subject: [issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely In-Reply-To: <1542212087.25.0.788709270274.issue35247@psf.upfronthosting.co.za> Message-ID: <1542212265.76.0.788709270274.issue35247@psf.upfronthosting.co.za> STINNER Victor added the comment: FYI I removed RDSTest.testCongestion() in bpo-34587. > test.test_socket.RDSTest.testPeek() can hang indefinitely. Any advice to explain how to reproduce the issue? Can you try to put a sleep() somewhere to make the race condition more likely? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:17:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 16:17:52 +0000 Subject: [issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely In-Reply-To: <1542212087.25.0.788709270274.issue35247@psf.upfronthosting.co.za> Message-ID: <1542212272.6.0.788709270274.issue35247@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 11:39:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 16:39:56 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542213596.01.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 01de89cb59107d4f889aa503a1c0350dae4aebaf by Victor Stinner in branch 'master': bpo-35233: InitConfigTests tests more config vars (GH-10541) https://github.com/python/cpython/commit/01de89cb59107d4f889aa503a1c0350dae4aebaf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:12:23 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 17:12:23 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542215543.45.0.788709270274.issue32613@psf.upfronthosting.co.za> Change by Julien Palard : ---------- pull_requests: +9792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:13:56 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 17:13:56 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542215636.43.0.788709270274.issue32613@psf.upfronthosting.co.za> Change by Julien Palard : ---------- pull_requests: +9793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:17:38 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Nov 2018 17:17:38 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542215857.99.0.788709270274.issue32613@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9053d2f2e09f9583473fb3c1960cba9bda8f3be1 by Miss Islington (bot) (Julien Palard) in branch '3.7': [3.7] bpo-32613: Update window FAQ (GH-5552). (GH-10544) https://github.com/python/cpython/commit/9053d2f2e09f9583473fb3c1960cba9bda8f3be1 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:18:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 17:18:13 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542215893.77.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:19:19 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Nov 2018 17:19:19 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542215959.73.0.788709270274.issue32613@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 137da0c5300c0a196084ab9efa61d116304de224 by Miss Islington (bot) (Julien Palard) in branch '3.6': [3.6] bpo-32613: Update window FAQ (GH-5552). (GH-10545) https://github.com/python/cpython/commit/137da0c5300c0a196084ab9efa61d116304de224 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:20:01 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 17:20:01 +0000 Subject: [issue32613] Use PEP 397 py launcher in windows faq In-Reply-To: <1516572429.98.0.467229070634.issue32613@psf.upfronthosting.co.za> Message-ID: <1542216001.86.0.788709270274.issue32613@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:28:52 2018 From: report at bugs.python.org (Davin Potts) Date: Wed, 14 Nov 2018 17:28:52 +0000 Subject: [issue33196] multiprocessing: serialization must ensure that contexts are compatible (the same) In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1542216532.52.0.788709270274.issue33196@psf.upfronthosting.co.za> Change by Davin Potts : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:29:34 2018 From: report at bugs.python.org (Davin Potts) Date: Wed, 14 Nov 2018 17:29:34 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542216574.89.0.788709270274.issue35242@psf.upfronthosting.co.za> Change by Davin Potts : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:50:30 2018 From: report at bugs.python.org (Mathieu Lamarre) Date: Wed, 14 Nov 2018 17:50:30 +0000 Subject: [issue35248] RawArray causes FileNotFoundError at cleanup Message-ID: <1542217830.03.0.788709270274.issue35248@psf.upfronthosting.co.za> Change by Mathieu Lamarre : ---------- components: Library (Lib) nosy: Mathieu Lamarre priority: normal severity: normal status: open title: RawArray causes FileNotFoundError at cleanup type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:52:37 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 17:52:37 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542217957.32.0.788709270274.issue33725@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: FWIW, I suspect that setting the environment variable only helps if it's done before the process starts. You cannot set it before the fork and have it affect the child. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:52:41 2018 From: report at bugs.python.org (Mathieu Lamarre) Date: Wed, 14 Nov 2018 17:52:41 +0000 Subject: [issue35248] RawArray causes FileNotFoundError at cleanup Message-ID: <1542217961.36.0.788709270274.issue35248@psf.upfronthosting.co.za> New submission from Mathieu Lamarre : Running: from multiprocessing.sharedctypes import RawArray from ctypes import c_uint32 if __name__ == '__main__': shared_array = RawArray(c_uint32, 1500) Causes: Traceback (most recent call last): File "/home/ava/miniconda3/envs/ava36/lib/python3.6/multiprocessing/util.py", line 262, in _run_finalizers finalizer() File "/home/ava/miniconda3/envs/ava36/lib/python3.6/multiprocessing/util.py", line 186, in __call__ res = self._callback(*self._args, **self._kwargs) File "/home/ava/miniconda3/envs/ava36/lib/python3.6/shutil.py", line 480, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/home/ava/miniconda3/envs/ava36/lib/python3.6/shutil.py", line 438, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/home/ava/miniconda3/envs/ava36/lib/python3.6/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'pym-10314-v8aznmmb' Python 3.6.6 |Anaconda, Inc.| (default, Oct 9 2018, 12:34:16) [GCC 7.3.0] on linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 12:58:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Nov 2018 17:58:11 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542218291.21.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9ee1d42f019ac827f73479ce241e95733d050e67 by Victor Stinner in branch '3.7': bpo-35233: InitConfigTests tests more config vars (GH-10541) (GH-10546) https://github.com/python/cpython/commit/9ee1d42f019ac827f73479ce241e95733d050e67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 13:11:26 2018 From: report at bugs.python.org (Davin Potts) Date: Wed, 14 Nov 2018 18:11:26 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542219086.85.0.788709270274.issue33725@psf.upfronthosting.co.za> Davin Potts added the comment: Barry's effort as well as comments in other links seem to all suggest that OBJC_DISABLE_INITIALIZE_FORK_SAFETY is not comprehensive in its ability to make other threads "safe" before forking. "Objective-C classes defined by the OS frameworks remain fork-unsafe" (from @kapilt's first link) suggests we furthermore remain at risk using certain MacOS system libraries prior to any call to fork. "To guarantee that forking is safe, the application must not be running any threads at the point of fork" (from @kapilt's second link) is an old truth that we continue to fight with even when we know very well that it's the truth. For newly developed code, we have the alternative to employ spawn instead of fork to avoid these problems in Python, C, Ruby, etc. For existing legacy code that employed fork and now surprises us by failing-fast on MacOS 10.13 and 10.14, it seems we are forced to face a technical debt incurred back when the choice was first made to spin up threads and afterwards to use fork. If we didn't already have an "obvious" (zen of Python) way to avoid such problems with spawn versus fork, I would feel this was something to solve in Python. As to helping the poor unfortunate souls who must fight the good fight with legacy code, I am not sure what to do to help though I would like to be able to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 13:16:05 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Nov 2018 18:16:05 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542219365.52.0.788709270274.issue33725@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Legacy code is easy to migrate as long as it uses Python 3. Just call mp.set_start_method('forkserver') at the top of your code and you're done. Some use cases may fail (if sharing non-picklable types), but they're probably not very common. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 13:17:03 2018 From: report at bugs.python.org (Mathieu Lamarre) Date: Wed, 14 Nov 2018 18:17:03 +0000 Subject: [issue35248] RawArray causes FileNotFoundError at cleanup In-Reply-To: <1542217961.36.0.788709270274.issue35248@psf.upfronthosting.co.za> Message-ID: <1542219423.69.0.788709270274.issue35248@psf.upfronthosting.co.za> Mathieu Lamarre added the comment: To repro, the temp directory returned by tempfile must be a network mount to reproduce this error. I have this on server with minimal disk space in /home and TMPDIR points to CIFS mounted volume. So maybe can only be reproduced if shutils operations on the temp dir are slow (or buggy). We have been using a network temp dir in a large project and RawArray is the only object giving us error so far. Maybe the error could be ignored, if it's only dual delete issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 13:17:18 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Nov 2018 18:17:18 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542219438.79.0.788709270274.issue31354@psf.upfronthosting.co.za> Ned Deily added the comment: This does sound like a regression bug that should be fixed in all branches. Another issue is that, if it is propagated to third-party extension module builds through distutils, there is no guarantee that the extension module is being built with the same compiler as Python itself was. ---------- nosy: +ned.deily resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 13:33:00 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Nov 2018 18:33:00 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542220380.03.0.788709270274.issue33725@psf.upfronthosting.co.za> Ned Deily added the comment: _scproxy has been known to be problematic for some time, see for instance Issue31818. That issue also gives a simple workaround: setting urllib's "no_proxy" environment variable to "*" will prevent the calls to the System Configuration framework. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 14:42:27 2018 From: report at bugs.python.org (Davin Potts) Date: Wed, 14 Nov 2018 19:42:27 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542224547.66.0.788709270274.issue33725@psf.upfronthosting.co.za> Davin Potts added the comment: Given the original post mentioned 2.7.15, I wonder if it is feasible to fork near the beginning of execution, then maintain and pass around a multiprocessing.Pool to be used when needed instead of dynamically forking? Working with legacy code is almost always more interesting than you want it to be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 14:47:15 2018 From: report at bugs.python.org (Davin Potts) Date: Wed, 14 Nov 2018 19:47:15 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542224835.89.0.788709270274.issue35219@psf.upfronthosting.co.za> Davin Potts added the comment: Resolution is marked dupe but status is still open. Are we closing this one or is there a more specific remedy for this situation (as opposed to what issue33725 discusses) that would be helpful to document? ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 14:55:11 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 19:55:11 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542225311.98.0.788709270274.issue35214@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset b6f4472dc4190e2fd668490d86aeefd2ab0df935 by Gregory P. Smith in branch '2.7': [2.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10538) https://github.com/python/cpython/commit/b6f4472dc4190e2fd668490d86aeefd2ab0df935 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:08:26 2018 From: report at bugs.python.org (Jules Lasne) Date: Wed, 14 Nov 2018 20:08:26 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc Message-ID: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> New submission from Jules Lasne : When working on the Documentation or when translating it, I often have to rebuild the doc locally to see the changes I made and see how it looks. However, with the current configuration, It takes (on my computer at least) more than 4 minutes to build. After investigating, I've found out that the build options on the Makefile of python-docs-fr and of cpython/Docs both have the `E` and `a` options set, which forces a complete rebuild, even when running locally. https://github.com/python/cpython/blob/9ee1d42f019ac827f73479ce241e95733d050e67/Doc/Makefile#L178-L208 https://github.com/python/python-docs-fr/commit/af8c7a95ab5bc50523ba919c74bb6e6b89d16962 My proposal is to add a `make dev` in the `python-docs-fr` Makefile and add in `cpython/Docs` a mode which will only recompile the needed files. ---------- components: Build messages: 329930 nosy: seluj78 priority: normal severity: normal status: open title: Docs Makefile always rebuilds entire doc type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:09:29 2018 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Nov 2018 20:09:29 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc In-Reply-To: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> Message-ID: <1542226169.65.0.788709270274.issue35249@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9795 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:30:37 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 20:30:37 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc In-Reply-To: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> Message-ID: <1542227437.46.0.788709270274.issue35249@psf.upfronthosting.co.za> Julien Palard added the comment: A `make html` builds the doc in 11s on my machine on the 2nd run, I think this is the build you're searching? ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:40:45 2018 From: report at bugs.python.org (Shane) Date: Wed, 14 Nov 2018 20:40:45 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle Message-ID: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> New submission from Shane : I noticed a slight mismatch in the parameter documentation for one of turtle's functions. onclick() accepts the parameters (fun, btn, add), but the documentation describes the parameters (fun, num, add). A minor issue, to be sure, but I wanted to point it out since I just noticed it. I'm using Python 3.7.1 but I suspect it's not isolated to that. >>> help(turtle.Turtle().onclick) Help on method onclick in module turtle: onclick(fun, btn=1, add=None) method of turtle.Turtle instance Bind fun to mouse-click event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). add -- True or False. If True, new binding will be added, otherwise it will replace a former binding. ---------- assignee: docs at python components: Documentation messages: 329932 nosy: Shane Smith, docs at python priority: normal severity: normal status: open title: Minor parameter documentation mismatch for turtle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:43:14 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 20:43:14 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1542219086.85.0.788709270274.issue33725@psf.upfronthosting.co.za> Message-ID: <333AD7C4-EF4D-468C-AFE3-453C713C9F56@python.org> Barry A. Warsaw added the comment: On Nov 14, 2018, at 10:11, Davin Potts wrote: > > > Davin Potts added the comment: > > Barry's effort as well as comments in other links seem to all suggest that OBJC_DISABLE_INITIALIZE_FORK_SAFETY is not comprehensive in its ability to make other threads "safe" before forking. Right. Setting the env var will definitely not make it thread safe. My understanding (please correct me if I?m wrong!) isn?t that this env var makes it safe, just that it prevents the ObjC runtime from core dumping. So it?s still up to the developer to know whether threads are involved or not. In our cases, these are single threaded applications. I?ve read elsewhere that ObjC doesn?t care if threads have actually been spun up or not. > "Objective-C classes defined by the OS frameworks remain fork-unsafe" (from @kapilt's first link) suggests we furthermore remain at risk using certain MacOS system libraries prior to any call to fork. Actually, it?s unsafe to call anything between fork and exec. Note that this doesn?t just affect Python; this is a pretty common idiom in other scripting languages too, from what I can tell. It?s certainly very common in Python. Note too that urllib.request.getproxies() will end up calling into the ObjC runtime via _scproxy, so you can?t even use requests after a fork but before exec. What I am still experimenting with is to see if I can define a pthread_atfork handler that will initialize the ObjC runtime before fork is actually called. I saw a Ruby approach like this, but it?s made more difficult in Python because pthread_atfork isn?t exposed to Python. I?m trying to see if I can implement it in ctypes, before I write an extension. > "To guarantee that forking is safe, the application must not be running any threads at the point of fork" (from @kapilt's second link) is an old truth that we continue to fight with even when we know very well that it's the truth. True, but do realize this problem affects you even in single threaded applications. > For newly developed code, we have the alternative to employ spawn instead of fork to avoid these problems in Python, C, Ruby, etc. For existing legacy code that employed fork and now surprises us by failing-fast on MacOS 10.13 and 10.14, it seems we are forced to face a technical debt incurred back when the choice was first made to spin up threads and afterwards to use fork. It?s tech debt you incur even if you don?t spin up threads. Just fork and do some work in the child before calling exec. If that work enters the ObjC runtime (as in the getproxies example), your child will coredump, > If we didn't already have an "obvious" (zen of Python) way to avoid such problems with spawn versus fork, I would feel this was something to solve in Python. As to helping the poor unfortunate souls who must fight the good fight with legacy code, I am not sure what to do to help though I would like to be able to help. *If* we can provide a hook to initialize the ObjC runtime in pthread_atfork, I think that?s something we could expose in Python. Then we can say legacy code can just invoke that, and at least you will avoid the worst outcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:44:42 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 20:44:42 +0000 Subject: [issue31818] [macOS] _scproxy.get_proxies() crash -- get_proxies() is not fork-safe? In-Reply-To: <1508409035.64.0.213398074469.issue31818@psf.upfronthosting.co.za> Message-ID: <1542228282.1.0.788709270274.issue31818@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:44:51 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 20:44:51 +0000 Subject: [issue31818] [macOS] _scproxy.get_proxies() crash -- get_proxies() is not fork-safe? In-Reply-To: <1508409035.64.0.213398074469.issue31818@psf.upfronthosting.co.za> Message-ID: <1542228291.22.0.788709270274.issue31818@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:45:57 2018 From: report at bugs.python.org (Jules Lasne) Date: Wed, 14 Nov 2018 20:45:57 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc In-Reply-To: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> Message-ID: <1542228357.34.0.788709270274.issue35249@psf.upfronthosting.co.za> Jules Lasne added the comment: Fixed in https://github.com/python/python-docs-fr/pull/426 ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:48:45 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 20:48:45 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc In-Reply-To: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> Message-ID: <1542228525.67.0.788709270274.issue35249@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> works for me stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:50:34 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 14 Nov 2018 20:50:34 +0000 Subject: [issue35249] Docs Makefile always rebuilds entire doc In-Reply-To: <1542226106.26.0.788709270274.issue35249@psf.upfronthosting.co.za> Message-ID: <1542228634.96.0.788709270274.issue35249@psf.upfronthosting.co.za> Change by Julien Palard : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 15:56:16 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Nov 2018 20:56:16 +0000 Subject: [issue35219] macOS 10.14 Mojave crashes in multiprocessing In-Reply-To: <1542045452.64.0.788709270274.issue35219@psf.upfronthosting.co.za> Message-ID: <1542228976.48.0.788709270274.issue35219@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Closing in favor of issue33725 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 17:06:27 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 14 Nov 2018 22:06:27 +0000 Subject: [issue35251] FTPHandler.ftp_open documentation error Message-ID: <1542233187.5.0.788709270274.issue35251@psf.upfronthosting.co.za> New submission from Lysandros Nikolaou : On https://docs.python.org/3/library/urllib.request.html?highlight=request#ftphandler-objects there is the sentence "The login is always done with empty username and password.", but in the (not so rare) case I am not missing something here, the code does parse the username and password and passes it on to connect_ftp, which then uses them. Should we update the docs? ---------- components: email messages: 329936 nosy: barry, lys.nikolaou, r.david.murray priority: normal severity: normal status: open title: FTPHandler.ftp_open documentation error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 18:35:08 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 23:35:08 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542238508.37.0.788709270274.issue31354@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 18:35:38 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Nov 2018 23:35:38 +0000 Subject: [issue31354] Fixing a bug related to LTO only build In-Reply-To: <1504648453.31.0.715065413662.issue31354@psf.upfronthosting.co.za> Message-ID: <1542238538.55.0.788709270274.issue31354@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 20:14:23 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 15 Nov 2018 01:14:23 +0000 Subject: [issue35252] test_functools dead code after FIXME Message-ID: <1542244463.09.0.788709270274.issue35252@psf.upfronthosting.co.za> New submission from Lysandros Nikolaou : In test_functools.TestSingleDispatch.test_invalid_registrations (https://github.com/python/cpython/blob/4c596d54aa6a55e9d2a3db78891e656ebbfb63c8/Lib/test/test_functools.py#L2299) there is a FIXME with an immediate return afterwards that says that the code after the return should only be allowed to run after PEP 560 is implemented. Now that it is implemented the dead code should work fine, so the return has to be deleted. ---------- components: Tests messages: 329937 nosy: lys.nikolaou priority: normal severity: normal status: open title: test_functools dead code after FIXME versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 20:30:23 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 15 Nov 2018 01:30:23 +0000 Subject: [issue35252] test_functools dead code after FIXME In-Reply-To: <1542244463.09.0.788709270274.issue35252@psf.upfronthosting.co.za> Message-ID: <1542245423.59.0.788709270274.issue35252@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- keywords: +patch pull_requests: +9797 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 20:42:56 2018 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Nov 2018 01:42:56 +0000 Subject: [issue35251] FTPHandler.ftp_open documentation error In-Reply-To: <1542233187.5.0.788709270274.issue35251@psf.upfronthosting.co.za> Message-ID: <1542246176.58.0.788709270274.issue35251@psf.upfronthosting.co.za> Change by R. David Murray : ---------- components: +Library (Lib) -email nosy: -barry, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 20:50:46 2018 From: report at bugs.python.org (Jorge Ramos) Date: Thu, 15 Nov 2018 01:50:46 +0000 Subject: [issue35253] Linker warning LNK4281 Message-ID: <1542246646.48.0.788709270274.issue35253@psf.upfronthosting.co.za> New submission from Jorge Ramos : When building python 3.6.7 x64 from source I get multiple warnings: -------------------------------------------------------------------- LINK : LNK4281 - "undesirable base address 0x1D110000 for x64 image; set base address above 4GB for best ASLR optimization". -------------------------------------------------------------------- after that, the build gives the offending module: -------------------------------------- [..\PCbuild\pythoncore.vcxproj] --------------------------------------- (e.g., there are many others) the .. means whatever parent directory the build files are on. I use the following batch file: ------------------------------------------------------------ Tools\msi\buildrelease.bat -x64 --pgo '-m test -q --pgo' ------------------------------------------------------------- Is this a problem? ---------- components: Build messages: 329938 nosy: neyuru priority: normal severity: normal status: open title: Linker warning LNK4281 type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 21:04:00 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Nov 2018 02:04:00 +0000 Subject: [issue34784] Heap-allocated StructSequences In-Reply-To: <1537773797.44.0.956365154283.issue34784@psf.upfronthosting.co.za> Message-ID: <1542247440.57.0.788709270274.issue34784@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: New changeset bfb855bef6b428d639693caaf4e4c84cbb8a2f51 by Pablo Galindo in branch 'master': bpo-34784: Implement correct cleanup in PyStructSequence new implementation (GH-10536) https://github.com/python/cpython/commit/bfb855bef6b428d639693caaf4e4c84cbb8a2f51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 21:05:32 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 15 Nov 2018 02:05:32 +0000 Subject: [issue35252] test_functools dead code after FIXME In-Reply-To: <1542244463.09.0.788709270274.issue35252@psf.upfronthosting.co.za> Message-ID: <1542247532.7.0.788709270274.issue35252@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: It actually seems like the test after the FIXME is wrong and should be changed or deleted altogether. Can someone give a pointer or two on what would be the best choice here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 22:22:35 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 15 Nov 2018 03:22:35 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1542252155.76.0.788709270274.issue33725@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I have a reliable way to call *something* in the pthread_atfork prepare handler, but I honestly don't know what to call to prevent the crash. In the Ruby thread, it seemed to say that you could just dlopen /System/Library/Frameworks/Foundation.framework/Foundation but that does not work for me. Neither does also loading the CoreFoundation and SystemConfiguration frameworks. If anybody has something that will reliably initialize the runtime, I can post my approach (there are a few subtleties). Short of that, I think there's nothing that can be done except ensure that exec is called right after fork. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 23:12:12 2018 From: report at bugs.python.org (pmpp) Date: Thu, 15 Nov 2018 04:12:12 +0000 Subject: [issue22412] Towards an asyncio-enabled command line In-Reply-To: <1410729335.06.0.363715018256.issue22412@psf.upfronthosting.co.za> Message-ID: <1542255132.02.0.788709270274.issue22412@psf.upfronthosting.co.za> Change by pmpp : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 14 23:59:51 2018 From: report at bugs.python.org (mengdexiaolian) Date: Thu, 15 Nov 2018 04:59:51 +0000 Subject: [issue35254] Process finished with exit code -1073741795 (0xC000001D) Message-ID: <1542257991.0.0.788709270274.issue35254@psf.upfronthosting.co.za> New submission from mengdexiaolian : when i run the following script with face_recognition module, there is a unnormal exception occurs: Process finished with exit code -1073741795 (0xC000001D) import face_recognition encodings = [] filename1 = "catherine.jpg" image1 = face_recognition.load_image_file(filename1) print(image1) encoding1 = face_recognition.face_encodings(image1)[0] print("bobo",encoding1) encodings.append(encoding1) print(encodings) filename2 = "william.jpg" image2 = face_recognition.load_image_file(filename2) encoding2 = face_recognition.face_encodings(image2)[0] encodings.append(encoding2) print(encodings) ---------- components: Extension Modules messages: 329942 nosy: mengdexiaolian priority: normal severity: normal status: open title: Process finished with exit code -1073741795 (0xC000001D) type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 00:45:15 2018 From: report at bugs.python.org (Eryk Sun) Date: Thu, 15 Nov 2018 05:45:15 +0000 Subject: [issue35254] Process finished with exit code -1073741795 (0xC000001D) In-Reply-To: <1542257991.0.0.788709270274.issue35254@psf.upfronthosting.co.za> Message-ID: <1542260715.41.0.788709270274.issue35254@psf.upfronthosting.co.za> Eryk Sun added the comment: 0xC000001D is STATUS_ILLEGAL_INSTRUCTION. This is probably due to a third-party bug that's corrupting the return address on the stack, so I'm closing this issue for now. It can be reopened if the developers of the face_recognition module determine that Python itself is at fault. ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed type: compile error -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 01:20:26 2018 From: report at bugs.python.org (Michael Felt) Date: Thu, 15 Nov 2018 06:20:26 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1542262826.42.0.788709270274.issue28009@psf.upfronthosting.co.za> Michael Felt added the comment: Historically, I started this issue because I saw that none of the calls made in uuid.py were working for AIX. I also assumed that they ALL worked already, at least somewhere. a) one cause is the difference between AIX and (all) others was the letter chosen to separate the six fields that from the hexadecimal macaddr. (AIX uses '.', others use ':'). b) on AIX only netstat -ia returns a macaddr - so the GETTERS array of routines to call could be shorter c) as the tests accept (I'll call it) no response aka None this was "passing" for all calls on AIX, including the mock test which had ":" hard coded into the test procedure and the mock data. d) the current test has to fail (i.e., always return None) when the output is coming from netstat because the output layout is fundamentally different. With netstat the keyword is in the first-line only and it determines the position, or index, of a potential value in the following lines. Other commands, such as ifconfig on linux, have the keyword and value on the same line with the keyword (position:index) proceeding the value (position:index+1) All this time I thought this was ONLY and AIX issue but in examining other platforms I see that some (e.g., Linux) do not have a macaddr value in netstat output - while others do (e.g., macos). In short, I would appreciate the current PR being merged so that AIX has at least basic support. However, I am ready to continue, as a new PR, re-working the tests (so that a response of None is at least a warning) when a macaddr is not found for a platform - rather than over customization of test_uuid.py (as I have started to do here for AIX). For platforms that do return a macaddr using netstat I would like to hear if that platform uses the "inline" method such as the command 'ifconfig' does on Linux, or if it is the "header" method such as on AIX and macos. Thank you for your consideration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 01:21:41 2018 From: report at bugs.python.org (Michael Felt) Date: Thu, 15 Nov 2018 06:21:41 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for netstat In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1542262901.1.0.788709270274.issue28009@psf.upfronthosting.co.za> Change by Michael Felt : ---------- title: core logic of uuid.getnode() is broken for AIX - all versions -> core logic of uuid.getnode() is broken for netstat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 01:57:19 2018 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Nov 2018 06:57:19 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542265039.48.0.788709270274.issue35226@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9798 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 02:50:24 2018 From: report at bugs.python.org (Chris Withers) Date: Thu, 15 Nov 2018 07:50:24 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542268224.29.0.788709270274.issue35226@psf.upfronthosting.co.za> Chris Withers added the comment: Assuming the PR is merged, what do I need to do for 3.7 and 3.6 backports? There's no doubt a doc for this somewhere, so please just point me at it :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 04:14:49 2018 From: report at bugs.python.org (Sergei Zobov) Date: Thu, 15 Nov 2018 09:14:49 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542273289.72.0.788709270274.issue35242@psf.upfronthosting.co.za> Sergei Zobov added the comment: I've decided to make the test more clean, so I added `time.sleep` and now we can be sure that here is enough time for queue's underlying process to synchronize all variables: https://github.com/szobov/cpython/compare/master...regression-test-on-multiprocessing-queue-feeder-ignore-exception It shows that sometimes `Queue._sem` will never be decreased. https://github.com/szobov/cpython/blob/master/Lib/multiprocessing/queues.py#L266 If it's undesirable behavior, would it be better to ignore this lines: https://github.com/szobov/cpython/blob/master/Lib/multiprocessing/queues.py#L257-L259 ? But in my thoughts the problem is in the functions `util._exit_function` and `util.is_exiting`. It's look like that `Queue._thread` share the same variable `util._exiting` with the process that started this thread. If you'll try to print it you see that when function `util._exit_function` executed for process it changes the value of `util._exiting` flag to `True` and after, from `Queue._thread`, the value for this flag stay `True`. But it's the daemon process and it should still work, isn't it? Or I'm missing something important here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 06:31:18 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Thu, 15 Nov 2018 11:31:18 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ Message-ID: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> New submission from Mathieu Dupuy : I think it's been a long time since Windows/IE no longer mess up with file extensions, so long I can't recall anymore. I just tried on a Windows 7 + IE 11 (released in 2013) to download the .tar.bz2 archive from docs.python.org and it worked alright. To me, that entry makes Python looks bad ("the archive format we use does not work correctly on the most common, main desktop platform"), the problem seems to not exist anymore, and IMHO, is not really Python related. I think that entry should be removed. ---------- messages: 329947 nosy: deronnax priority: normal severity: normal status: open title: delete "How do I extract the downloaded documentation" section in Windows FAQ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 06:32:10 2018 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Nov 2018 11:32:10 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1542281530.46.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9800 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 06:33:32 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Thu, 15 Nov 2018 11:33:32 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1542281612.02.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Mathieu Dupuy : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 06:56:39 2018 From: report at bugs.python.org (Sergei Zobov) Date: Thu, 15 Nov 2018 11:56:39 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542282999.45.0.788709270274.issue35242@psf.upfronthosting.co.za> Change by Sergei Zobov : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 08:06:50 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Thu, 15 Nov 2018 13:06:50 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1542287210.59.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Mathieu Dupuy : ---------- pull_requests: +9802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 08:30:01 2018 From: report at bugs.python.org (Iuliana Netoi) Date: Thu, 15 Nov 2018 13:30:01 +0000 Subject: [issue35256] The Console of Python 3.7.0. Message-ID: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> New submission from Iuliana Netoi : While running a function that uses a list to which I append the element "z", the Console modifies my code by adding "z" to the list each time I consequently run the function. Is that a bug? My function written in the Editor of Python 3.7.0. is the following: #%% my_list = ["this","is","my","very","first","list"] def problem2_2(my_list): my_list.append("z") print(my_list) #%% I click the "Run" icon in the Menu. Then I type problem2_2(my_list) in the CONSOLE. At the first execution it is ok. But when executing right again, the console adds another element "z" to my list. And so on, for each next execution - as if the Console modifies my code. (Anyway when reverting to the Editor, click inside the cell, and then "Run" icon in the Menu, only after the first execution it is printed the right number of elements)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< There is the Console executions: mmy_list = ["this","is","my","very","first","list"] def problem2_2(my_list): my_list.append("z") print(my_list) problem2_2(my_list) ['this', 'is', 'my', 'very', 'first', 'list', 'z'] problem2_2(my_list) ['this', 'is', 'my', 'very', 'first', 'list', 'z', 'z'] problem2_2(my_list) ['this', 'is', 'my', 'very', 'first', 'list', 'z', 'z', 'z'] problem2_2(my_list) ['this', 'is', 'my', 'very', 'first', 'list', 'z', 'z', 'z', 'z'] ---------- components: Tests messages: 329949 nosy: iuliananet priority: normal severity: normal status: open title: The Console of Python 3.7.0. versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 08:40:24 2018 From: report at bugs.python.org (Iuliana Netoi) Date: Thu, 15 Nov 2018 13:40:24 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1542289224.08.0.788709270274.issue35256@psf.upfronthosting.co.za> Change by Iuliana Netoi : ---------- type: -> behavior Added file: https://bugs.python.org/file47934/tema_2-2-PT-PYTHON--TRACKER-text.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 09:03:06 2018 From: report at bugs.python.org (Julien Palard) Date: Thu, 15 Nov 2018 14:03:06 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542290586.76.0.788709270274.issue31146@psf.upfronthosting.co.za> Change by Julien Palard : ---------- keywords: +patch pull_requests: +9804 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 09:46:34 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 15 Nov 2018 14:46:34 +0000 Subject: [issue35214] Get the test suite passing with clang Memory Sanitizer enabled In-Reply-To: <1542007595.0.0.788709270274.issue35214@psf.upfronthosting.co.za> Message-ID: <1542293194.59.0.788709270274.issue35214@psf.upfronthosting.co.za> Change by Alexey Izbyshev : ---------- nosy: +izbyshev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 09:50:49 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 15 Nov 2018 14:50:49 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1542293449.79.0.788709270274.issue35256@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I don't understand what you think is the bug. You keep repeatedly appending 'z' to the same list. Why are you surprised that it appends 'z' more than once? If you don't want to append it twice, don't call the function twice. Every time you call the function, it adds another 'z'. That's what the function does. It is working correctly. Can you explain what you think is the bug, because it looks to me like it is working as intended. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 11:14:01 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 15 Nov 2018 16:14:01 +0000 Subject: [issue35257] Add LDFLAGS_NODIST for the LDFLAGS not intended for propagation to C extensions. Message-ID: <1542298441.4.0.788709270274.issue35257@psf.upfronthosting.co.za> New submission from Charalampos Stratakis : Through acb8c5234302f8057b331abaafb2cc8697daf58f the CFLAGS_NODIST variable was created, in order to place there compiler flags used by the interpreter, but not intended to be propagated to C extensions. I saw a similar issue when working on backporting 67e997bcfdac55191033d57a16d1408aL1313 on python 3.6, where the -flto flag should be passed to CFLAGS_NODIST instead of BASECFLAGS, however even if that is fixed, the LDFLAGS will still be propagated to C extensions. Thus in order to provide more flexibility in that regard, I propose to add the LDFLAGS_NODIST variable, which in a similar vein as CFLAGS_NODIST, will hold the LDFLAGS intended to be used only by the interpreter. Thoughts or comments on this approach? ---------- components: Build, Distutils, Extension Modules messages: 329951 nosy: cstratak, dstufft, eric.araujo priority: normal severity: normal status: open title: Add LDFLAGS_NODIST for the LDFLAGS not intended for propagation to C extensions. versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 11:15:35 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 15 Nov 2018 16:15:35 +0000 Subject: [issue35257] Add LDFLAGS_NODIST for the LDFLAGS not intended for propagation to C extensions. In-Reply-To: <1542298441.4.0.788709270274.issue35257@psf.upfronthosting.co.za> Message-ID: <1542298535.0.0.788709270274.issue35257@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Correction: The second commit is referring to https://github.com/python/cpython/pull/9908/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 11:52:46 2018 From: report at bugs.python.org (Shane) Date: Thu, 15 Nov 2018 16:52:46 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1542300766.03.0.788709270274.issue35256@psf.upfronthosting.co.za> Shane added the comment: I suspect the author simply does not realize lists are mutable in Python. ---------- nosy: +Shane Smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 12:33:43 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 15 Nov 2018 17:33:43 +0000 Subject: [issue35258] Consider enabling -Wmissing-prototypes Message-ID: <1542303223.2.0.788709270274.issue35258@psf.upfronthosting.co.za> New submission from Alexey Izbyshev : This issue is a follow-up of msg329608 of #35081. GCC and Clang have -Wmissing-prototypes[1] diagnostic that is reported if a global function is defined without a previous declaration containing a prototype. The reasons may be the following: 1) The header where it is declared is not included before the definition. 2) There is a declaration before the definition, but it doesn't contain a prototype (e.g., "int foo()"). 3) There is no separate declaration of the function in the project at all. (1) is undesirable because the compiler can't check that signatures of the declaration and the definition match. If they don't, subtle issues may occur when such function is called using a wrong declaration. (2) is undesirable too because there is usually no reason to use declarations without prototypes. Often "int foo()" was meant to be "int foo(void)" -- these two have different meaning in C. (3) may mean that either the function is unused (which is probably undesirable) or it was intentionally defined without a declaration. One case when the latter makes sense is plugin-like files which define initialization functions or similar external entry points. Those may be called via pointers obtained with dlsym() or have calls generated at compile time, like Modules/config.c in CPython. It would be good to enable -Wmissing-prototypes to catch (1) and (2) -- such issues exist as of time of this report. However, (3) is a problem because of module initialization functions which would cause unwanted diagnostics. There is no function attribute that could be put in PyMODINIT_FUNC macro to suppress the diagnostic for a single function. The general diagnostic suppression machinery (#pragma GCC diagnostic[2]) affects everything on the following lines, and while the state can be saved and restored via "#pragma GCC diagnostic push/pop", we'd either need another macro to restore the state after the end of module initializer definitions or require that initializers always come last in the file. A workaround is to declare the initializer inside PyMODINIT_FUNC (or a new macro). For example (omitting platform-specific parts of PyMODINIT_FUNC): #define PyMODINIT_FUNC(name) \ extern PyObject *name(void); \ PyObject *name(void) PyMODINIT_FUNC(PyInit_time) { ... } I've also noticed that PyMODINIT_FUNC is used for functions with a different signature in Modules/_testmultiphase.c, so either another macro would be needed for that, or a general macro accepting a prototype as its variadic parameter could be added. Even if it's deemed infeasible to enable -Wmissing-prototypes by default, developers may find it useful to ensure that the diagnostic is reported only for files in Modules directory. [1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [2] https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html ---------- components: Build messages: 329954 nosy: izbyshev, vstinner priority: normal severity: normal status: open title: Consider enabling -Wmissing-prototypes type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 12:35:44 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Thu, 15 Nov 2018 17:35:44 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542303344.73.0.788709270274.issue35081@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: > Oh, I never saw this warning before. It seems to not be included in -Wall. Would you mind to open a new issue to discuss it? Victor, I've opened #35258 as you suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:15:14 2018 From: report at bugs.python.org (Tom Brown) Date: Thu, 15 Nov 2018 18:15:14 +0000 Subject: [issue12657] Cannot override JSON encoding of basic type subclasses In-Reply-To: <1311964088.32.0.0267577465373.issue12657@psf.upfronthosting.co.za> Message-ID: <1542305714.57.0.788709270274.issue12657@psf.upfronthosting.co.za> Tom Brown added the comment: I found this work-around useful https://stackoverflow.com/a/32782927 ---------- nosy: +Tom.Brown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:15:17 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 15 Nov 2018 18:15:17 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542305717.2.0.788709270274.issue35213@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset b65413b497a07f521d835b799be7dd0afcedbd65 by Terry Jan Reedy in branch 'master': bpo-35213: Where appropriate, use 'macOS' in idlelib. (#10478) https://github.com/python/cpython/commit/b65413b497a07f521d835b799be7dd0afcedbd65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:15:32 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Nov 2018 18:15:32 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542305732.78.0.788709270274.issue35213@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9805 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:15:41 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Nov 2018 18:15:41 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542305741.88.0.788709270274.issue35213@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:24:29 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Nov 2018 18:24:29 +0000 Subject: [issue12657] Cannot override JSON encoding of basic type subclasses In-Reply-To: <1311964088.32.0.0267577465373.issue12657@psf.upfronthosting.co.za> Message-ID: <1542306269.01.0.788709270274.issue12657@psf.upfronthosting.co.za> ?ric Araujo added the comment: A modern solution for this is to define a singledispatch function (with implementations for your custom types) and pass it as the `default` parameter to the dump functions. (That won?t avoid the custom ? dict copy, but that?s how the module works) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:24:52 2018 From: report at bugs.python.org (Arthur Neufeld) Date: Thu, 15 Nov 2018 18:24:52 +0000 Subject: [issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API Message-ID: <1542306291.56.0.788709270274.issue35259@psf.upfronthosting.co.za> New submission from Arthur Neufeld : In application compiled with #define Py_LIMITED_API 0x03040000 this method was used Py_FinalizeEx() Tested application with: SET PATH=...;C:\Program Files\Python35 APPLICATION.EXE Result: Entry Point Not Found (X) The procedure entry point Py_FinalizeEx could not be located in the dynamic link library C:\PATH\TO\APPLICATION.EXE Expected Result: Application runs Rebuilding, after replacing Py_FinalizeEx(void) with Py_Finalize(void): Application runs when pointing to 3.5 DLLs. Suggested resolution: Declaration should be restricted to ABI 3.6+: #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_FUNC(int) Py_FinalizeEx(void); #endif ---------- components: Interpreter Core messages: 329959 nosy: AJNeufeld priority: normal severity: normal status: open title: Py_FinalizeEx unconditionally exists in Py_LIMITED_API type: crash versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:35:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Nov 2018 18:35:39 +0000 Subject: [issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API In-Reply-To: <1542306291.56.0.788709270274.issue35259@psf.upfronthosting.co.za> Message-ID: <1542306939.11.0.788709270274.issue35259@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 13:44:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Nov 2018 18:44:52 +0000 Subject: [issue12657] Cannot override JSON encoding of basic type subclasses In-Reply-To: <1311964088.32.0.0267577465373.issue12657@psf.upfronthosting.co.za> Message-ID: <1542307492.55.0.788709270274.issue12657@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm working on a large patch which will include also the fix for this issue. This is a significant change and it can affect behavior and performance of existing code, so it can be made only in new version. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka versions: +Python 3.8 -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 14:31:39 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Nov 2018 19:31:39 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542310299.76.0.788709270274.issue35213@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 579c4175648f667d59954d48ada757621ff6d433 by Miss Islington (bot) in branch '3.7': bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) https://github.com/python/cpython/commit/579c4175648f667d59954d48ada757621ff6d433 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 14:31:56 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Nov 2018 19:31:56 +0000 Subject: [issue35213] IDLE: use 'macOS' where appropriate. In-Reply-To: <1541999174.82.0.788709270274.issue35213@psf.upfronthosting.co.za> Message-ID: <1542310316.38.0.788709270274.issue35213@psf.upfronthosting.co.za> miss-islington added the comment: New changeset be657c1fac3ce436976541cf2680a977217be813 by Miss Islington (bot) in branch '3.6': bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) https://github.com/python/cpython/commit/be657c1fac3ce436976541cf2680a977217be813 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 14:51:30 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 15 Nov 2018 19:51:30 +0000 Subject: [issue35253] Linker warning LNK4281 In-Reply-To: <1542246646.48.0.788709270274.issue35253@psf.upfronthosting.co.za> Message-ID: <1542311490.36.0.788709270274.issue35253@psf.upfronthosting.co.za> Brett Cannon added the comment: No, it's not a problem, just a potential enhancement. ---------- nosy: +brett.cannon, paul.moore, steve.dower, tim.golden, zach.ware type: compile error -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 14:53:20 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 15 Nov 2018 19:53:20 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542311600.79.0.788709270274.issue35244@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 15:05:52 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 15 Nov 2018 20:05:52 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1542312352.28.0.788709270274.issue35256@psf.upfronthosting.co.za> Eric V. Smith added the comment: Agreed that this is a misunderstanding and not a bug. iuliananet: you're modifying the same list each time you're calling problem2_2(). You might look for help on the python-tutors mailing list: https://mail.python.org/mailman/listinfo/tutor ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 15:36:44 2018 From: report at bugs.python.org (Jorge Ramos) Date: Thu, 15 Nov 2018 20:36:44 +0000 Subject: [issue35253] Linker warning LNK4281 In-Reply-To: <1542246646.48.0.788709270274.issue35253@psf.upfronthosting.co.za> Message-ID: <1542314204.68.0.788709270274.issue35253@psf.upfronthosting.co.za> Jorge Ramos added the comment: Ok, thanks! If it helps, here are all the modules that gave me that suggestion: pythoncore.vcxproj _testbuffer.vcxproj _testcapi.vcxproj _testimportmultiple.vcxproj select.vcxproj _overlapped.vcxproj _elementtree.vcxproj _decimal.vcxproj unicodedata.vcxproj _msi.vcxproj _multiprocessing.vcxproj _socket.vcxproj _bz2.vcxproj _ctypes.vcxproj _sqlite3.vcxproj python.vcxproj pythonw.vcxproj and it seems that the suggestions were repeated more than once for all of them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 16:09:43 2018 From: report at bugs.python.org (batterystaple456) Date: Thu, 15 Nov 2018 21:09:43 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments Message-ID: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> New submission from batterystaple456 : File a.py: ------------------------------------ print("foo", end='bar') # ParseError ------------------------------------ I think the error is caused by arguments in the Python 3 print() function (e.g. end, sep) that are not ignored by 2to3, and (possibly) treated like Python 2 code. Console stuff: --------------------------------------------------- $ pip install 2to3 Requirement already satisfied: 2to3 in .\python37\lib\site-packages (1.0) $ 2to3 .\a.py ... RefactoringTool: Can't parse .\a.py: ParseError: bad input: type=22, value='=', context=('', (1, 16)) ... --------------------------------------------------- ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 329966 nosy: batterystaple456 priority: normal severity: normal status: open title: 2to3 Parse Error on Python 3 print() with arguments type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 16:17:02 2018 From: report at bugs.python.org (Iuliana Netoi) Date: Thu, 15 Nov 2018 21:17:02 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542293449.79.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1932876989.1280333.1542316618430@mail.yahoo.com> Iuliana Netoi added the comment: Now I wrote the same list named my_list inside the function. And I deleted the function argument.When running again and again, the function remains as I defined it. So the console behavior depends on the list placing: before or inside the function. When the list is placed before the function and the function is called again and again, the console adds each time the element "z", enlarging the initial list.When the list is placed inside the function and the function is called again and again, the console does not add elements at all and the list remains as I defined it, so the initial one. ;;;;;;;;;;;;;;;;;;;; #%%def problem2_2():? ? ? my_list = ["this","is","my","very","first","list"]? ? ? my_list.append("z")? ? ? print(my_list)??? ? #%%;;;;;;;;;;;;;;;;;;; ?Here is the output, with no change in my list: In [1]: def problem2_2():? ?...:? ? ? ?my_list = ["this","is","my","very","first","list"]? ?...:? ? ? ?my_list.append("z")? ?...:? ? ? ?print(my_list) In [2]: problem2_2()['this', 'is', 'my', 'very', 'first', 'list', 'z'] In [3]: problem2_2()['this', 'is', 'my', 'very', 'first', 'list', 'z'] In [4]: problem2_2()['this', 'is', 'my', 'very', 'first', 'list', 'z'] In [5]: problem2_2()['this', 'is', 'my', 'very', 'first', 'list', 'z'] In [6]: On Thursday, November 15, 2018, 4:50:53 PM GMT+2, Steven D'Aprano wrote: Steven D'Aprano added the comment: I don't understand what you think is the bug. You keep repeatedly appending 'z' to the same list. Why are you surprised that it appends 'z' more than once? If you don't want to append it twice, don't call the function twice. Every time you call the function, it adds another 'z'. That's what the function does. It is working correctly. Can you explain what you think is the bug, because it looks to me like it is working as intended. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 16:19:49 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 15 Nov 2018 21:19:49 +0000 Subject: [issue35256] The Console of Python 3.7.0. In-Reply-To: <1542288601.52.0.788709270274.issue35256@psf.upfronthosting.co.za> Message-ID: <1542316789.57.0.788709270274.issue35256@psf.upfronthosting.co.za> Eric V. Smith added the comment: Yes, this is as expected. As I said, since this isn't a bug in Python, this is not the appropriate place to discuss your problem. I suggest python-tutors list, but there are many other places to learn about python global and local variables. ---------- components: -Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 16:56:03 2018 From: report at bugs.python.org (pmpp) Date: Thu, 15 Nov 2018 21:56:03 +0000 Subject: [issue35261] readline.c: PyOS_InputHook not protected against SIGWINCH Message-ID: <1542318963.39.0.788709270274.issue35261@psf.upfronthosting.co.za> New submission from pmpp : when using PyOS_InputHook from within readline module two signals are to be handled SIGINT and SIGWINCH SIGINT is really usefull in case hook has a problem though in some case it should be nice to prevent it too (async loop in repl background) but SIGWINCH is an annoyance and often lead to interpreter crash. sample file: linux crash test under ubuntu bionic python 3.7.1 gcc7 more elaborated test case https://github.com/pmp-p/aioprompt ---------- components: Extension Modules files: pih.py messages: 329969 nosy: pmpp priority: normal severity: normal status: open title: readline.c: PyOS_InputHook not protected against SIGWINCH type: crash versions: Python 3.7 Added file: https://bugs.python.org/file47935/pih.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:03:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Nov 2018 22:03:03 +0000 Subject: [issue35261] readline.c: PyOS_InputHook not protected against SIGWINCH In-Reply-To: <1542318963.39.0.788709270274.issue35261@psf.upfronthosting.co.za> Message-ID: <1542319383.56.0.788709270274.issue35261@psf.upfronthosting.co.za> STINNER Victor added the comment: Can you please describe what happens and what is the expected behavior? When I run "python3 pih.py", the script exits immediately and then a get many "kill: (5441) - No such process" errors in bash. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:05:13 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 15 Nov 2018 22:05:13 +0000 Subject: [issue9056] Adding additional level of bookmarks and section numbers in python pdf documents. In-Reply-To: <1277175637.31.0.472126376822.issue9056@psf.upfronthosting.co.za> Message-ID: <1542319513.61.0.788709270274.issue9056@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- nosy: +cheryl.sabella, mdk versions: +Python 3.8 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:12:18 2018 From: report at bugs.python.org (pmpp) Date: Thu, 15 Nov 2018 22:12:18 +0000 Subject: [issue35261] readline.c: PyOS_InputHook not protected against SIGWINCH In-Reply-To: <1542318963.39.0.788709270274.issue35261@psf.upfronthosting.co.za> Message-ID: <1542319938.22.0.788709270274.issue35261@psf.upfronthosting.co.za> pmpp added the comment: oops use: python3 -i -u -B pih.py to run crash test ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:18:01 2018 From: report at bugs.python.org (pmpp) Date: Thu, 15 Nov 2018 22:18:01 +0000 Subject: [issue35261] readline.c: PyOS_InputHook not protected against SIGWINCH In-Reply-To: <1542318963.39.0.788709270274.issue35261@psf.upfronthosting.co.za> Message-ID: <1542320281.89.0.788709270274.issue35261@psf.upfronthosting.co.za> pmpp added the comment: expected result would look like: python3.6 -i -u -B pih.py >>> Segmentation fault (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:28:41 2018 From: report at bugs.python.org (batterystaple456) Date: Thu, 15 Nov 2018 22:28:41 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments In-Reply-To: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> Message-ID: <1542320921.47.0.788709270274.issue35260@psf.upfronthosting.co.za> Change by batterystaple456 : ---------- type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 17:32:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Nov 2018 22:32:33 +0000 Subject: [issue35261] readline.c: PyOS_InputHook not protected against SIGWINCH In-Reply-To: <1542318963.39.0.788709270274.issue35261@psf.upfronthosting.co.za> Message-ID: <1542321153.48.0.788709270274.issue35261@psf.upfronthosting.co.za> STINNER Victor added the comment: You don't use properly ctypes. This issue is unrelated to signals. The fix is: HOOKFUNC = CFUNCTYPE(c_char_p,). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 18:18:08 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 15 Nov 2018 23:18:08 +0000 Subject: [issue28775] Option to set startup directory in IDLE In-Reply-To: <1479837252.01.0.0581172301847.issue28775@psf.upfronthosting.co.za> Message-ID: <1542323888.57.0.788709270274.issue28775@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is partially a duplicate of #22121, but that focused most on the default startup directory on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 18:21:44 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 15 Nov 2018 23:21:44 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542324104.46.0.788709270274.issue22121@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #28775 is about a user configuration setting. I need to try out %HOMEDRIVE%%HOMEPATH%. I am not sure what a 'post-installation script' means in practice. What language, when run, by whom? ---------- versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 19:28:56 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Nov 2018 00:28:56 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542328136.84.0.788709270274.issue22121@psf.upfronthosting.co.za> Terry J. Reedy added the comment: On Windows 10, Start Menu entries are no longer shortcuts, but are titles of shortcuts. On the 'most recent' and alphabetical listings, one must right click, select 'more', and then 'open file location'. One then gets a directory of shortcuts, such as C:\Users\Terry\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.7, which can be copied and edited. If one used 'Type here to search', right clicking immediately displays 'open file location'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 20:34:32 2018 From: report at bugs.python.org (Eryk Sun) Date: Fri, 16 Nov 2018 01:34:32 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542332072.01.0.788709270274.issue22121@psf.upfronthosting.co.za> Eryk Sun added the comment: > I am not sure what a 'post-installation script' means in practice. IIRC, there's no way to prevent environment-variable expansion when shortcuts are created by an MSI, so the shortcuts need to be created or modified after installing IDLE. Perhaps this can be implemented in the MSI with a custom action. Or perhaps this can be implemented after installing the package via the OnExecutePackageComplete hook method in Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp. > On the 'most recent' and alphabetical listings, one must right click, > select 'more', and then 'open file location'. One then gets a > directory of shortcuts, They're probably hiding the action to modify shortcuts since generally they're installed for all users in %ProgramData%, and modifying them requires administrator access. > such as C:\Users\Terry\AppData\Roaming\Microsoft\Windows\Start > Menu\Programs\Python 3.7, which can be copied and edited. You shouldn't need to copy a shortcut in your own AppData. You can modify it directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 20:44:22 2018 From: report at bugs.python.org (Abram Clark) Date: Fri, 16 Nov 2018 01:44:22 +0000 Subject: [issue35262] There should be a list.get just like dict.get Message-ID: <1542332662.89.0.788709270274.issue35262@psf.upfronthosting.co.za> New submission from Abram Clark : Just like with dictionaries, it is convenient to index lists without catching exceptions. Adding an import for this most basic functionality is slightly tedious, and I can't imagine it would break anything to add a list.get method. ---------- messages: 329978 nosy: Abram Clark priority: normal severity: normal status: open title: There should be a list.get just like dict.get type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 15 22:00:40 2018 From: report at bugs.python.org (neel patel) Date: Fri, 16 Nov 2018 03:00:40 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1542337240.83.0.788709270274.issue30082@psf.upfronthosting.co.za> neel patel added the comment: Can I work on this? I'm not sure of it's status, though. ---------- nosy: +ohno _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 00:33:00 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 16 Nov 2018 05:33:00 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542346380.93.0.788709270274.issue35250@psf.upfronthosting.co.za> Windson Yang added the comment: Yes, you are right. A quick fix would change 'num' to 'btn' in parameters in https://docs.python.org/3.3/library/turtle.html?highlight=turtle#turtle.onclick. I think they are the same thing. Do you want to create a patch? ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 00:39:35 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 16 Nov 2018 05:39:35 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542346775.93.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 00:53:42 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Nov 2018 05:53:42 +0000 Subject: [issue35262] There should be a list.get just like dict.get In-Reply-To: <1542332662.89.0.788709270274.issue35262@psf.upfronthosting.co.za> Message-ID: <1542347622.36.0.788709270274.issue35262@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This idea has been discussed before and was rejected. While get() makes sense and has valid use cases for dictionaries which use key based lookups, there isn't a parallel for lists. In general, we do just fine without list.get(). Also, it seems that other languages have mostly made the same decision in this regard. Thank you for the suggestion though. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 01:26:06 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Nov 2018 06:26:06 +0000 Subject: [issue35263] Add None handling for get_saved() in IDLE Message-ID: <1542349566.92.0.788709270274.issue35263@psf.upfronthosting.co.za> New submission from Raymond Hettinger : Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__ return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/multicall.py", line 176, in handler r = l[i](event) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/filelist.py", line 54, in close_all_callback reply = edit.close() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/pyshell.py", line 1014, in close return EditorWindow.close(self) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py", line 1015, in close reply = self.maybesave() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/outwin.py", line 93, in maybesave return 'yes' if self.get_saved() else 'no' File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py", line 948, in get_saved return self.undo.get_saved() AttributeError: 'NoneType' object has no attribute 'get_saved' ---------- assignee: terry.reedy components: IDLE messages: 329982 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: Add None handling for get_saved() in IDLE versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:19:05 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:19:05 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542352745.02.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- keywords: +patch pull_requests: +9808 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:19:23 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:19:23 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542352763.7.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: -3087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:20:43 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:20:43 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542352843.47.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: +9809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:31:54 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:31:54 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542353514.14.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: +9810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:32:56 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:32:56 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542353576.51.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: -9809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:33:05 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:33:05 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542353585.0.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: -9808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 02:39:25 2018 From: report at bugs.python.org (Hongxu Jia) Date: Fri, 16 Nov 2018 07:39:25 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1542353965.27.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Hongxu Jia : ---------- pull_requests: +9812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 03:07:25 2018 From: report at bugs.python.org (Peter Petrik) Date: Fri, 16 Nov 2018 08:07:25 +0000 Subject: [issue31601] Availability of utimensat, futimens not checked correctly on macOS In-Reply-To: <1506493420.2.0.154975027568.issue31601@psf.upfronthosting.co.za> Message-ID: <1542355645.96.0.788709270274.issue31601@psf.upfronthosting.co.za> Change by Peter Petrik : ---------- components: +Cross-Build -Build, macOS nosy: +Alex.Willmer, Peter Petrik versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 03:36:01 2018 From: report at bugs.python.org (Abram Clark) Date: Fri, 16 Nov 2018 08:36:01 +0000 Subject: [issue35262] There should be a list.get just like dict.get In-Reply-To: <1542332662.89.0.788709270274.issue35262@psf.upfronthosting.co.za> Message-ID: <1542357361.04.0.788709270274.issue35262@psf.upfronthosting.co.za> Abram Clark added the comment: There really are valid use cases for this. Would you please refer me to this previous discussion? In a particular small to medium sized Python repository of ~10k lines, list get is used 23 times, whereas other list builtin methods are used far less (for example list.pop is used once, though dict.pop is used 18 times). I would be happy to go into specific examples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 04:42:49 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 16 Nov 2018 09:42:49 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542361369.65.0.788709270274.issue35202@psf.upfronthosting.co.za> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: With the current PR, i think i removed all unused imports in Lib folder. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 04:50:56 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 16 Nov 2018 09:50:56 +0000 Subject: [issue35263] Add None handling for get_saved() in IDLE In-Reply-To: <1542349566.92.0.788709270274.issue35263@psf.upfronthosting.co.za> Message-ID: <1542361856.97.0.788709270274.issue35263@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- keywords: +patch pull_requests: +9813 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 04:59:04 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 16 Nov 2018 09:59:04 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542362344.05.0.788709270274.issue35250@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- keywords: +patch pull_requests: +9814 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 05:55:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 10:55:39 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542365739.28.0.788709270274.issue35239@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 37cd982df02795905886ab36a2378ed557cb6f60 by Victor Stinner in branch 'master': bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) https://github.com/python/cpython/commit/37cd982df02795905886ab36a2378ed557cb6f60 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:15:10 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:15:10 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542366910.15.0.788709270274.issue35239@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:22:39 2018 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Nov 2018 11:22:39 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments In-Reply-To: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> Message-ID: <1542367359.36.0.788709270274.issue35260@psf.upfronthosting.co.za> Mark Dickinson added the comment: I'm not sure I understand the report: 2to3 expects a valid Python 2 file as input, and the file a.py isn't a valid Python 2 file: the `print` line is a SyntaxError in the absence of a `from __future__ import print_function`. So yes, this *is* being treated like Python 2 code, but that's what 2to3 is designed to do. Can you say what you expected to happen here? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:34:38 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:34:38 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542368078.07.0.788709270274.issue35239@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d2be9a5c13221fb84c2221bbfd93efac6111e697 by Miss Islington (bot) in branch '3.7': bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) https://github.com/python/cpython/commit/d2be9a5c13221fb84c2221bbfd93efac6111e697 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:35:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 11:35:44 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542368144.48.0.788709270274.issue35239@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:40:52 2018 From: report at bugs.python.org (batterystaple456) Date: Fri, 16 Nov 2018 11:40:52 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments In-Reply-To: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> Message-ID: <1542368452.03.0.788709270274.issue35260@psf.upfronthosting.co.za> batterystaple456 added the comment: I was expecting that like other Python 3 code, since it is already in Python 3, it would not parse it like Python 2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:42:04 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 16 Nov 2018 11:42:04 +0000 Subject: [issue33816] New metaclass example for Data Model topic In-Reply-To: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> Message-ID: <1542368524.05.0.788709270274.issue33816@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 by INADA Naoki (Andr?s Delfino) in branch 'master': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:42:13 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:42:13 +0000 Subject: [issue33816] New metaclass example for Data Model topic In-Reply-To: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> Message-ID: <1542368533.64.0.788709270274.issue33816@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:42:25 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:42:25 +0000 Subject: [issue33816] New metaclass example for Data Model topic In-Reply-To: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> Message-ID: <1542368545.6.0.788709270274.issue33816@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:51:23 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:51:23 +0000 Subject: [issue33816] New metaclass example for Data Model topic In-Reply-To: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> Message-ID: <1542369083.01.0.788709270274.issue33816@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1b80a373d104480c51cacb8b07ec3b61e21d5fa0 by Miss Islington (bot) in branch '3.7': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/1b80a373d104480c51cacb8b07ec3b61e21d5fa0 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 06:58:12 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 11:58:12 +0000 Subject: [issue33816] New metaclass example for Data Model topic In-Reply-To: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> Message-ID: <1542369492.23.0.788709270274.issue33816@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 46fa7a60e08fc7486ecab726af93fa2cfe225305 by Miss Islington (bot) in branch '3.6': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/46fa7a60e08fc7486ecab726af93fa2cfe225305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:03:13 2018 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Nov 2018 13:03:13 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments In-Reply-To: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> Message-ID: <1542373393.26.0.788709270274.issue35260@psf.upfronthosting.co.za> Mark Dickinson added the comment: I'm still confused: the main purpose of 2to3 is to take Python 2 code and turn it into Python 3 code. The docs[1] are fairly unambiguous here: > 2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code. So expecting 2to3 *not* to parse code as though it's Python 2 code seem odd. [1] https://docs.python.org/3.7/library/2to3.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:04:44 2018 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Nov 2018 13:04:44 +0000 Subject: [issue35260] 2to3 Parse Error on Python 3 print() with arguments In-Reply-To: <1542316183.46.0.788709270274.issue35260@psf.upfronthosting.co.za> Message-ID: <1542373484.23.0.788709270274.issue35260@psf.upfronthosting.co.za> Mark Dickinson added the comment: Closing. 2to3 is working as designed here. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:05:55 2018 From: report at bugs.python.org (=?utf-8?q?Sebastian_H=C3=B6fer?=) Date: Fri, 16 Nov 2018 13:05:55 +0000 Subject: [issue30545] Enum equality across modules: comparing objects instead of values In-Reply-To: <1496379539.81.0.670964151039.issue30545@psf.upfronthosting.co.za> Message-ID: <1542373555.67.0.788709270274.issue30545@psf.upfronthosting.co.za> Sebastian H?fer added the comment: I ran into the same issue and while I see that this is not a bug I would suggest that this behaviour at least deserves a warning in the documentation under https://docs.python.org/3/library/enum.html#comparisons This unexpected behaviour can not only occur with messed up imports, but also when a module uses the importlib.reload() function and submodules are reloaded during runtime. I attached a minimal working example. In our case we have a central module where all constants, dataclasses and enums are defined. A main program imports several submodules which all import these datatypes. Reloading a submodule results in new object ids for the enums in this submodule and comparing data between different modules suddenly results in inconsistent behaviour. It took a while to debug, because except for the object id the enums look exactly the same and before reading this thread I did not realize that the comparison is actually done by object ids. ---------- nosy: +Sebastian H?fer Added file: https://bugs.python.org/file47936/enum_reload_example.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:10:44 2018 From: report at bugs.python.org (Alexandru Ardelean) Date: Fri, 16 Nov 2018 13:10:44 +0000 Subject: [issue35264] SSL Module build fails with OpenSSL 1.1.0 for Python 2.7 Message-ID: <1542373844.15.0.788709270274.issue35264@psf.upfronthosting.co.za> New submission from Alexandru Ardelean : The Modules/_ssl.c build fails. Error is: ``` building '_ssl' extension arm-openwrt-linux-muslgnueabi-gcc -fPIC -fno-strict-aliasing -Os -pipe -mcpu=xscale -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/build_dir/target-arm_xscale_musl_eabi/Python-2.7.15:Python-2.7.15 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -DNDEBUG -Os -pipe -mcpu=xscale -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/build_dir/target-arm_xscale_musl_eabi/Python-2.7.15:Python-2.7.15 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I. -IInclude -I./Include -I/staging_dir/target-arm_xscale_musl_eabi/include -I/staging_dir/toolchain-arm_xscale_gcc-7.3.0_musl_eabi/usr/include -I/staging_dir/toolchain-arm_xscale_gcc-7.3.0_musl_eabi/include/fortify -I/staging_dir/toolchain-arm_xscale_gcc-7.3.0_musl_eabi/include -I/staging_dir/target-arm_xscale_musl_eabi/usr/include -I/staging_dir/hostpkg/bin/Include -I/staging_dir/hostpkg/bin -c /build_dir/target-arm_xscale_musl_eabi/Python-2.7.15/Modules/_ssl.c -o build/temp.linux2-2.7//build_dir/target-arm_xscale_musl_eabi/Python-2.7.15/Modules/_ssl.o cc1: note: someone does not honour COPTS correctly, passed 2 times /build_dir/target-arm_xscale_musl_eabi/Python-2.7.15/Modules/_ssl.c:2117:44: error: 'PySSL_selected_npn_protocol' undeclared here (not in a function); did you mean 'PySSL_selected_alpn_protocol'? {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol, METH_NOARGS}, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ PySSL_selected_alpn_protocol ``` This is on OpenWrt. ---------- assignee: christian.heimes components: Build, SSL messages: 329995 nosy: Alexandru Ardelean, christian.heimes priority: normal severity: normal status: open title: SSL Module build fails with OpenSSL 1.1.0 for Python 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:27:34 2018 From: report at bugs.python.org (Alexandru Ardelean) Date: Fri, 16 Nov 2018 13:27:34 +0000 Subject: [issue35264] SSL Module build fails with OpenSSL 1.1.0 for Python 2.7 In-Reply-To: <1542373844.15.0.788709270274.issue35264@psf.upfronthosting.co.za> Message-ID: <1542374854.73.0.788709270274.issue35264@psf.upfronthosting.co.za> Change by Alexandru Ardelean : ---------- keywords: +patch pull_requests: +9818 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:29:05 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 13:29:05 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542374945.65.0.788709270274.issue35250@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:29:18 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 13:29:18 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542374958.02.0.788709270274.issue35250@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:55:16 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 13:55:16 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542376516.97.0.788709270274.issue35250@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 0461c3b635d53e8e75145695803a2fca288a1689 by Miss Islington (bot) in branch '3.7': bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) https://github.com/python/cpython/commit/0461c3b635d53e8e75145695803a2fca288a1689 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 08:56:36 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 13:56:36 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542376596.39.0.788709270274.issue35250@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 8856246c41b0663bfe8d3af7d52a7c337e25572d by Miss Islington (bot) in branch '3.6': bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) https://github.com/python/cpython/commit/8856246c41b0663bfe8d3af7d52a7c337e25572d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:04:22 2018 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 16 Nov 2018 14:04:22 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542377062.7.0.788709270274.issue34160@psf.upfronthosting.co.za> Stefan Behnel added the comment: > Maybe some people prefer sorting to get a more deterministic output Note that those people are much better off with C14N. It is the one tool designed for all of these use cases, even usable for cryptographic signatures. And it's trivial to use, it's just a different serialiser. The new option would only be for people who want the old behaviour for backwards compatibility reasons, like Ned who wants to keep his existing byte level tests working that were created by the previous version. Understandable, although re-serialising the test samples with C14N would probably still be the better approach, because it guards against more than just changes in the attribute order. Maybe it's time to think about adding the ET C14N module to the stdlib again, see issue13611. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:05:11 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 14:05:11 +0000 Subject: [issue24653] Mock.assert_has_calls([]) is surprising for users In-Reply-To: <1437126004.09.0.453747784975.issue24653@psf.upfronthosting.co.za> Message-ID: <1542377111.23.0.788709270274.issue24653@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Why this case should be explicitly mentioned? Is it an exception from some rules? Is the empty list special? Does existing documentation say that assert_has_calls([]) should raise an exception? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:15:05 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 16 Nov 2018 14:15:05 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542377705.49.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- pull_requests: +9821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:19:44 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 14:19:44 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1542377984.68.0.788709270274.issue13611@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:25:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 14:25:45 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context Message-ID: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> New submission from STINNER Victor : Currently, the Python initialization code base is full of: static void pymain_clear_cmdline(_PyMain *pymain, _PyCmdline *cmdline) { PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); ... PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } It's a hack that I wrote when I worked on the Python initialization code, to make sure that we use the same memory allocator to allocate and release memory. The problem is that Python allocates memory at startup, then the memory allocator can be changed in Py_Initialize() (ex: by PYTHONMALLOC environment variable), but at exit, we need to reuse the same memory allocator that we used to allocate memory early. Instead of "forcing" the memory allocator to "default allocator", I propose to add a new "context" structure which contains the memory allocator (PyMemAllocatorEx structure). Example: typedef struct { /* Enable UTF-8 mode? Set by -X utf8 command line option and PYTHONUTF8 environment variable. If set to -1 (default), inherit Py_UTF8Mode value. */ int utf8_mode; PyMemAllocatorEx raw_alloc; } _PyConfigCtx; The context should be passed to any function allocating directly or indirectly memory. Py_Main(), "core config" and "path config" are good target for these changes. These functions are used during Python initialization. I know that Eric Snow would like to pass a "context" to functions of the C API. I don't want to make a giant change of the C API. I only want to modify the internal C API, and only modifiy Python internal. The context that I propose is designed for early Python initialization, and fix the practical problem of memory allocator. Later we can discussed how _PyRuntime and the pointer to the current interpreter can be added into this context, or if a new context should be created. Attached PR is a proof-of-concept of my idea, but the giant PR might be splitted into smaller changes to more incremental changes. ---------- components: Interpreter Core messages: 330001 nosy: eric.snow, ncoghlan, vstinner priority: normal severity: normal status: open title: Internal C API: pass the memory allocator in a context type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:26:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 14:26:33 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context In-Reply-To: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> Message-ID: <1542378393.78.0.788709270274.issue35265@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9822 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:31:17 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 14:31:17 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1542378677.33.0.788709270274.issue13611@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: "c14n" is documented as an accepted serialization method of write() and there is some (non-working) code for support of C14N. e6a951b83e30b3b9c809a441041fb0f21f72b168 removed optional import of ElementC14N. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:38:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 14:38:25 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542379105.34.0.788709270274.issue34160@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: +1 for adding C14N support for ElementTree. But the problem will still exist for minidom. We will need either add the sort_attrs parameter in prettyxml() or complete C14N support in minidom. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:38:54 2018 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 16 Nov 2018 14:38:54 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542379134.92.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: Stefan, just to clarify: it isn't that I don't feel like re-serializing my gold files with the latest version. I run my test suite on 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, PyPy2, and PyPy3. Today, one gold file suffices for all those versions. Without the sorted attributes, 3.8 fails the test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:44:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 14:44:06 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig Message-ID: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> New submission from STINNER Victor : The C code of Python initialization uses _PyCoreConfig and _PyMainInterpreterConfig which co-exist and more or less redundant. For example, both structures have "argv": wchar_** for _PyCoreConfig, PyObject* (list of str) for _PyMainInterpreterConfig. I propose to put _PyCoreConfig inside _PyMainInterpreterConfig and move wchar_t* strings into a new _PyPreConfig structure. The main idea is that _PyPreConfig and wchar_* type are only used for early Python initialization, but once Python is initialization, the configuration should be provided as Python objects. I didn't check all configuration variables to see if it's doable or not, but I wrote a proof-of-concept pull request to show my idea with concrete (and working!) code. See attached PR. ---------- components: Interpreter Core messages: 330005 nosy: eric.snow, ncoghlan, vstinner priority: normal severity: normal status: open title: Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 09:44:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Nov 2018 14:44:40 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig In-Reply-To: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> Message-ID: <1542379480.67.0.788709270274.issue35266@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9823 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 12:50:36 2018 From: report at bugs.python.org (Dragoljub) Date: Fri, 16 Nov 2018 17:50:36 +0000 Subject: [issue35195] [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit() In-Reply-To: <1541717781.13.0.788709270274.issue35195@psf.upfronthosting.co.za> Message-ID: <1542390636.09.0.788709270274.issue35195@psf.upfronthosting.co.za> Dragoljub added the comment: Do we know if its possible to prevent the initialize LC_CTYPE on startup? Is there some combination of ENV-Var or CMD-Args that can avoid this slowdown on Windows? What are the next step to get the issue assigned? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 13:27:48 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Nov 2018 18:27:48 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1542392868.88.0.788709270274.issue35226@psf.upfronthosting.co.za> ?ric Araujo added the comment: Add the right ?needs backport to X.Y? labels to the PR and a bot will take care of it. (This info does not seem to be in the devguide!) ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 13:30:00 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Nov 2018 18:30:00 +0000 Subject: [issue35250] Minor parameter documentation mismatch for turtle In-Reply-To: <1542228045.84.0.788709270274.issue35250@psf.upfronthosting.co.za> Message-ID: <1542393000.91.0.788709270274.issue35250@psf.upfronthosting.co.za> ?ric Araujo added the comment: There is an HTML escaping problem in the PR list! ---------- nosy: +eric.araujo, ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 13:44:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 18:44:25 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1542393865.64.0.788709270274.issue13611@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 14:06:01 2018 From: report at bugs.python.org (Joshua Root) Date: Fri, 16 Nov 2018 19:06:01 +0000 Subject: [issue31601] Availability of utimensat, futimens not checked correctly on macOS In-Reply-To: <1506493420.2.0.154975027568.issue31601@psf.upfronthosting.co.za> Message-ID: <1542395161.78.0.788709270274.issue31601@psf.upfronthosting.co.za> Joshua Root added the comment: This isn't just a cross-build issue, or rather (depending on how you look at it) cross-builds are increasingly the norm due to Apple only providing a newer SDK on older OS versions. For example the latest version of Xcode available for 10.12 only comes with the 10.13 SDK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 14:12:49 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Nov 2018 19:12:49 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542395569.63.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I run my test suite on 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, PyPy2, > and PyPy3. Today, one gold file suffices for all those > versions. Without the sorted attributes, 3.8 fails the test. Would it make sense to rewrite the test to just make sure the XML roundtrips instead of relying on the exact byte sequence that is generated? IIRC, that is how we test pickling and various codecs -- rather than relying on implement specific details for a particular byte sequence -- the test is roughly "assert decode(encode(thing)) == thing". That allows the test to survive on-going improvements to serialization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 14:21:30 2018 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 16 Nov 2018 19:21:30 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542396090.06.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: It seemed like we were close to a consensus about adding back the option to sort the attributes, or did I misunderstand? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 14:23:07 2018 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 16 Nov 2018 19:23:07 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1542396187.0.0.788709270274.issue35148@psf.upfronthosting.co.za> Change by Vinay Sajip : ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 14:52:14 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Nov 2018 19:52:14 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1542397934.54.0.788709270274.issue34160@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > It seemed like we were close to a consensus about adding > back the option to sort the attributes, or did I > misunderstand? Adding a sort() option to prettyxml() seems perfectly reasonable. I wouldn't extend any of the other APIs though. Also, it is reasonable to consider adding a standards compliant canonicalization tool. > Without the sorted attributes, 3.8 fails the test. It seems to me that the test should be improved as well so that it doesn't rely on implementation details. The usual way to test serialization is to verify that it round trips. Unless the test is improved to not rely on implementation details, I'm concerned that we'll end-up having this conversation again if any other serialization improvements are made. So yes, I support adding a sort() option to prettyxml() and adding a canonicalization tool, but no I don't agree with the premise that Py 2.7, 3.4, 3.5, 3.6, 3.7, 3.8 were required to now and forever always produce byte-by-byte identical output -- afaict that was never a promised behavior, so any test that relies on that premise should be improved. FWIW, when I described the existing test as being "fragile", it wasn't a pejorative, I meant it in the literal sense of "easily broken". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 16:38:57 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 16 Nov 2018 21:38:57 +0000 Subject: [issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability In-Reply-To: <1542119446.33.0.788709270274.issue35232@psf.upfronthosting.co.za> Message-ID: <1542404337.0.0.788709270274.issue35232@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 18:52:58 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Nov 2018 23:52:58 +0000 Subject: [issue28401] Don't support the PEP384 stable ABI in pydebug builds In-Reply-To: <1476034292.17.0.316209799179.issue28401@psf.upfronthosting.co.za> Message-ID: <1542412378.34.0.788709270274.issue28401@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 338d54f0a59dc5e5b6c9e7397340169f3a3f8ea4 by Miss Islington (bot) (Stefano Rivera) in branch 'master': bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766) https://github.com/python/cpython/commit/338d54f0a59dc5e5b6c9e7397340169f3a3f8ea4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 19:24:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 17 Nov 2018 00:24:03 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context In-Reply-To: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> Message-ID: <1542414243.3.0.788709270274.issue35265@psf.upfronthosting.co.za> STINNER Victor added the comment: Passing the memory allocator is my first goal. My second goal is to cleanup the code reading the configuration, pymain_read_conf() in Modules/main.c: int utf8_mode = config->ctx.utf8_mode; int encoding_changed = 0; (...) /* bpo-34207: Py_DecodeLocale() and Py_EncodeLocale() depend on Py_UTF8Mode and Py_LegacyWindowsFSEncodingFlag. */ Py_UTF8Mode = config->ctx.utf8_mode; #ifdef MS_WINDOWS Py_LegacyWindowsFSEncodingFlag = config->legacy_windows_fs_encoding; #endif (...) /* Reset the configuration before reading again the configuration, just keep UTF-8 Mode value. */ int new_utf8_mode = config->ctx.utf8_mode; int new_coerce_c_locale = config->coerce_c_locale; if (_PyCoreConfig_Copy(config, &save_config) < 0) { pymain->err = _Py_INIT_NO_MEMORY(); goto done; } pymain_clear_cmdline(pymain, cmdline); config->ctx.utf8_mode = new_utf8_mode; config->coerce_c_locale = new_coerce_c_locale; /* The encoding changed: read again the configuration with the new encoding */ My main concern is: "bpo-34207: Py_DecodeLocale() and Py_EncodeLocale() depend on Py_UTF8Mode and Py_LegacyWindowsFSEncodingFlag". Python initialization code should depend on global variables. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 19:58:16 2018 From: report at bugs.python.org (Vlad Temian) Date: Sat, 17 Nov 2018 00:58:16 +0000 Subject: [issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew' In-Reply-To: <1465208759.2.0.0752415166741.issue27240@psf.upfronthosting.co.za> Message-ID: <1542416296.29.0.788709270274.issue27240@psf.upfronthosting.co.za> Vlad Temian added the comment: Is there any chance that this fix is gonna be ported to 3.5 as well? ---------- nosy: +vtemian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 20:06:39 2018 From: report at bugs.python.org (dzhu) Date: Sat, 17 Nov 2018 01:06:39 +0000 Subject: [issue35267] reproducible deadlock with multiprocessing.Pool Message-ID: <1542416799.14.0.788709270274.issue35267@psf.upfronthosting.co.za> New submission from dzhu : The attached snippet causes a deadlock just about every time it's run (tested with 3.6.7/Ubuntu, 3.7.1/Arch, 3.6.7/OSX, and 3.7.1/OSX -- deadlock seems to be less frequent on the last, but still common). The issue appears to be something like the following sequence of events: 1. The main thread calls pool.__exit__, eventually entering Pool._terminate_pool. 2. result_handler's state is set to TERMINATE, causing it to stop reading from outqueue. 3. The main thread, in _terminate_pool, joins on worker_handler, which is (usually) in the middle of sleeping for 0.1 seconds, opening a window for the next two steps to occur. 4. The worker process finishes its task and acquires the shared outqueue._wlock. 5. The worker attempts to put the result into outqueue, but its pickled form is too big to fit into the buffer of os.pipe, and it blocks here with the lock held. 6. worker_handler wakes up and exits, freeing _terminate_pool to continue. 7. _terminate_pool terminates the worker. 8. task_handler tries to put None into outqueue, but blocks, since the lock was acquired by the terminated worker. 9. _terminate_pool joins on task_handler, and everything is deadlocked. ---------- components: Library (Lib) files: lock.py messages: 330017 nosy: dzhu priority: normal severity: normal status: open title: reproducible deadlock with multiprocessing.Pool type: behavior versions: Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47937/lock.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 22:34:44 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 17 Nov 2018 03:34:44 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542425684.24.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by Windson Yang : ---------- keywords: +patch pull_requests: +9824 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 22:34:48 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 17 Nov 2018 03:34:48 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542425688.81.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by Windson Yang : ---------- keywords: +patch, patch pull_requests: +9824, 9826 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 22:34:53 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 17 Nov 2018 03:34:53 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542425693.43.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by Windson Yang : ---------- keywords: +patch, patch, patch pull_requests: +9824, 9825, 9826 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 22:44:41 2018 From: report at bugs.python.org (Windson Yang) Date: Sat, 17 Nov 2018 03:44:41 +0000 Subject: [issue35267] reproducible deadlock with multiprocessing.Pool In-Reply-To: <1542416799.14.0.788709270274.issue35267@psf.upfronthosting.co.za> Message-ID: <1542426281.67.0.788709270274.issue35267@psf.upfronthosting.co.za> Windson Yang added the comment: Hello, dzhu. I can reproduce on my OSX, since you already dive into the code, do you have any idea to fix or improve it? ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 22:48:13 2018 From: report at bugs.python.org (INADA Naoki) Date: Sat, 17 Nov 2018 03:48:13 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542426493.77.0.788709270274.issue34995@psf.upfronthosting.co.za> INADA Naoki added the comment: I want to hear mypy developer's comment. ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 16 23:51:07 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Nov 2018 04:51:07 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542430267.23.0.788709270274.issue34995@psf.upfronthosting.co.za> Guido van Rossum added the comment: This is runtime behavior, mypy doesn't care either way. It triggers on the presence of the decorator, not on what attributes it sets at runtime on the object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 01:11:43 2018 From: report at bugs.python.org (INADA Naoki) Date: Sat, 17 Nov 2018 06:11:43 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1542430267.23.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: INADA Naoki added the comment: > Guido van Rossum added the comment: > > This is runtime behavior, mypy doesn't care either way. It triggers on the > presence of the decorator, not on what attributes it sets at runtime on the > object. > > But it's only motivation is static hinting. My point is, is cached_property important static hint? For example, do you want support cached_property in mypy Protocol with same semantics? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 01:31:19 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Nov 2018 06:31:19 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542436279.06.0.788709270274.issue34995@psf.upfronthosting.co.za> Guido van Rossum added the comment: In mypy there would be no difference between a cached property and a normal one -- the type is the same either way. Caching is the quintessential runtime behavior -- it shouldn't matter for semantics, only for performance. (True, sometimes there are more subtle semantics that require caching past the first call, but this is beyond the realm of a type checker, which cannot typically tell whether a call is the first or not.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 01:38:13 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 06:38:13 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542436693.69.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 01:38:23 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 06:38:23 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542436703.45.0.788709270274.issue35202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 01:48:45 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 06:48:45 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542437325.15.0.788709270274.issue35202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3a600d224c1e1106756cc71639232ae1acae45bd by Miss Islington (bot) in branch '3.7': bpo-35202: Remove more unused imports in idlelib (GH-10573) https://github.com/python/cpython/commit/3a600d224c1e1106756cc71639232ae1acae45bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 02:00:35 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 07:00:35 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542438035.09.0.788709270274.issue35202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 8d816f74d7673c836b16e4423fed0ec6ee510290 by Miss Islington (bot) in branch '3.6': bpo-35202: Remove more unused imports in idlelib (GH-10573) https://github.com/python/cpython/commit/8d816f74d7673c836b16e4423fed0ec6ee510290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 02:03:32 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Nov 2018 07:03:32 +0000 Subject: [issue35202] Remove unused imports in standard library In-Reply-To: <1541790552.02.0.788709270274.issue35202@psf.upfronthosting.co.za> Message-ID: <1542438212.11.0.788709270274.issue35202@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thank you for the cleanup. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 04:03:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 17 Nov 2018 09:03:51 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1542436279.06.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: INADA-san: do you prefer to raise an exception? If yes, can we ensure that an exception will always be raised? See my 2 examples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 06:52:54 2018 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 17 Nov 2018 11:52:54 +0000 Subject: [issue35268] Windows asyncio reading continously stdin and stdout Stockfish Message-ID: <1542455574.0.0.788709270274.issue35268@psf.upfronthosting.co.za> New submission from Cezary Wagner : I have some problems with asyncio on Windows - it block where it should go. Documentation shows that it should work: https://docs.python.org/3/library/asyncio-stream.html -> StreamReader should return something. See 1st example: import asyncio import sys async def run_stockfish(): STOCKFISH_PATH = r'C:\root\chess\stockfish\stockfish 9\stockfish_9_x64_bmi2.exe' stockfish = await asyncio.subprocess.create_subprocess_exec( STOCKFISH_PATH, stdin=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) stockfish.stdin.write('uci'.encode()) while True: # BUG? - blocks at this line - no output line = await stockfish.stdout.read() print(line) await stockfish.wait() if sys.platform == "win32": asyncio.set_event_loop_policy( asyncio.WindowsProactorEventLoopPolicy()) asyncio.run(run_stockfish(), debug=True) 1st output (nothing): Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32 runfile('C:/Users/Cezary Wagner/PycharmProjects/stockfish-proxy/sandbox/async_proxy/s01_async_stockfish.py', wdir='C:/Users/Cezary Wagner/PycharmProjects/stockfish-proxy/sandbox/async_proxy') 2nd example: import asyncio import sys async def run_stockfish(): STOCKFISH_PATH = r'C:\root\chess\stockfish\stockfish 9\stockfish_9_x64_bmi2.exe' stockfish = await asyncio.subprocess.create_subprocess_exec( STOCKFISH_PATH, stdin=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) stockfish.stdin.write('uci'.encode()) while True: # BUG? - blocks at this line line = await stockfish.stdout.readline() print(line) await stockfish.wait() if sys.platform == "win32": asyncio.set_event_loop_policy( asyncio.WindowsProactorEventLoopPolicy()) asyncio.run(run_stockfish(), debug=True) 2nd output is little better (first line is read): Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32 runfile('C:/Users/Cezary Wagner/PycharmProjects/stockfish-proxy/sandbox/async_proxy/s01_async_stockfish.py', wdir='C:/Users/Cezary Wagner/PycharmProjects/stockfish-proxy/sandbox/async_proxy') b'Stockfish 9 64 BMI2 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott\r\n' What should be done in both case (or maybe done): Stockfish 9 64 BMI2 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott uci id name Stockfish 9 64 BMI2 id author T. Romstad, M. Costalba, J. Kiiski, G. Linscott option name Debug Log File type string default option name Contempt type spin default 20 min -100 max 100 option name Threads type spin default 1 min 1 max 512 option name Hash type spin default 16 min 1 max 131072 option name Clear Hash type button option name Ponder type check default false option name MultiPV type spin default 1 min 1 max 500 option name Skill Level type spin default 20 min 0 max 20 option name Move Overhead type spin default 30 min 0 max 5000 option name Minimum Thinking Time type spin default 20 min 0 max 5000 option name Slow Mover type spin default 89 min 10 max 1000 option name nodestime type spin default 0 min 0 max 10000 option name UCI_Chess960 type check default false option name SyzygyPath type string default option name SyzygyProbeDepth type spin default 1 min 1 max 100 option name Syzygy50MoveRule type check default true option name SyzygyProbeLimit type spin default 6 min 0 max 6 uciok ---------- components: Windows, asyncio messages: 330028 nosy: Cezary.Wagner, asvetlov, paul.moore, steve.dower, tim.golden, yselivanov, zach.ware priority: normal severity: normal status: open title: Windows asyncio reading continously stdin and stdout Stockfish versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 06:56:40 2018 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 17 Nov 2018 11:56:40 +0000 Subject: [issue35268] Windows asyncio reading continously stdin and stdout Stockfish In-Reply-To: <1542455574.0.0.788709270274.issue35268@psf.upfronthosting.co.za> Message-ID: <1542455800.69.0.788709270274.issue35268@psf.upfronthosting.co.za> Cezary Wagner added the comment: It looks like StremReader.read() not work and StremReader.readline() in Windows or I am not understand documentation. https://docs.python.org/3/library/asyncio-stream.html coroutine read(n=-1) Read up to n bytes. If n is not provided, or set to -1, read until EOF and return all read bytes. If EOF was received and the internal buffer is empty, return an empty bytes object. coroutine readline() Read one line, where ?line? is a sequence of bytes ending with \n. If EOF is received and \n was not found, the method returns partially read data. If EOF is received and the internal buffer is empty, return an empty bytes object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 09:54:32 2018 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Nov 2018 14:54:32 +0000 Subject: [issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew' In-Reply-To: <1465208759.2.0.0752415166741.issue27240@psf.upfronthosting.co.za> Message-ID: <1542466472.71.0.788709270274.issue27240@psf.upfronthosting.co.za> R. David Murray added the comment: No. 3.5 is in security-fix-only mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 12:13:58 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Nov 2018 17:13:58 +0000 Subject: [issue35267] reproducible deadlock with multiprocessing.Pool In-Reply-To: <1542416799.14.0.788709270274.issue35267@psf.upfronthosting.co.za> Message-ID: <1542474838.23.0.788709270274.issue35267@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 12:15:56 2018 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 17 Nov 2018 17:15:56 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine Message-ID: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> New submission from Zackery Spytz : If compute_cr_origin() fails in PyCoro_New(), coro->cr_origin won't be initialized. This will cause a crash during the coroutine's deallocation. I'll create a PR for this issue. ---------- components: Interpreter Core, asyncio messages: 330031 nosy: ZackerySpytz, asvetlov, yselivanov priority: normal severity: normal status: open title: A possible segfault involving a newly-created coroutine type: crash versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 12:20:42 2018 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 17 Nov 2018 17:20:42 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542475242.96.0.788709270274.issue35269@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +9829 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 12:34:00 2018 From: report at bugs.python.org (Yury Selivanov) Date: Sat, 17 Nov 2018 17:34:00 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542476040.02.0.788709270274.issue35269@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:16:53 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 19:16:53 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542482213.87.0.788709270274.issue25438@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 689d555ec135d4115574addd063c358ac4897cc4 by Miss Islington (bot) (Windson yang) in branch 'master': bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) https://github.com/python/cpython/commit/689d555ec135d4115574addd063c358ac4897cc4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:17:09 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 19:17:09 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542482229.24.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:17:19 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 19:17:19 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542482239.17.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:50:01 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 19:50:01 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542484201.65.0.788709270274.issue25438@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d1a97b36595726074a83452e5c476806936becba by Miss Islington (bot) in branch '3.7': [3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10586) https://github.com/python/cpython/commit/d1a97b36595726074a83452e5c476806936becba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:50:28 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Nov 2018 19:50:28 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542484228.1.0.788709270274.issue25438@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 8945017be4cc9527767bb66673e73e28e4b0b4d3 by Miss Islington (bot) in branch '3.6': [3.6] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10587) https://github.com/python/cpython/commit/8945017be4cc9527767bb66673e73e28e4b0b4d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 14:51:01 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 17 Nov 2018 19:51:01 +0000 Subject: [issue25438] document what codec PyMemberDef T_STRING decodes the char * as In-Reply-To: <1445236924.11.0.92849861938.issue25438@psf.upfronthosting.co.za> Message-ID: <1542484261.9.0.788709270274.issue25438@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 15:25:43 2018 From: report at bugs.python.org (E Kawashima) Date: Sat, 17 Nov 2018 20:25:43 +0000 Subject: [issue33392] pathlib .glob('*/') returns files as well as directories In-Reply-To: <1525094253.43.0.682650639539.issue33392@psf.upfronthosting.co.za> Message-ID: <1542486343.69.0.788709270274.issue33392@psf.upfronthosting.co.za> Change by E Kawashima : ---------- pull_requests: +9832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 18:06:01 2018 From: report at bugs.python.org (daniel hahler) Date: Sat, 17 Nov 2018 23:06:01 +0000 Subject: [issue35270] Cmd.complete does not handle cmd=None Message-ID: <1542495961.77.0.788709270274.issue35270@psf.upfronthosting.co.za> New submission from daniel hahler : When `parseline` returns `None` for `cmd` (like pdb++ might cause it when changing a cmd "disable" to "!disable"), the following will cause a TypeError: > compfunc = getattr(self, 'complete_' + cmd) "None" should be also forwarded to "completedefault", just like cmd="". ---------- components: Library (Lib) messages: 330035 nosy: blueyed priority: normal severity: normal status: open title: Cmd.complete does not handle cmd=None type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 18:06:25 2018 From: report at bugs.python.org (daniel hahler) Date: Sat, 17 Nov 2018 23:06:25 +0000 Subject: [issue35270] Cmd.complete does not handle cmd=None In-Reply-To: <1542495961.77.0.788709270274.issue35270@psf.upfronthosting.co.za> Message-ID: <1542495985.86.0.788709270274.issue35270@psf.upfronthosting.co.za> Change by daniel hahler : ---------- keywords: +patch pull_requests: +9833 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 23:42:01 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 18 Nov 2018 04:42:01 +0000 Subject: [issue34725] Py_GetProgramFullPath() odd behaviour in Windows In-Reply-To: <1537291607.58.0.956365154283.issue34725@psf.upfronthosting.co.za> Message-ID: <1542516121.93.0.788709270274.issue34725@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 177a41a07b7d13c70d068ea0962f07e625ae171e by Steve Dower in branch 'master': bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9860) https://github.com/python/cpython/commit/177a41a07b7d13c70d068ea0962f07e625ae171e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 23:42:12 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 18 Nov 2018 04:42:12 +0000 Subject: [issue34725] Py_GetProgramFullPath() odd behaviour in Windows In-Reply-To: <1537291607.58.0.956365154283.issue34725@psf.upfronthosting.co.za> Message-ID: <1542516132.45.0.788709270274.issue34725@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset e851049e0e045b5e0f9d5c6b8a64d7f6b8ecc9c7 by Steve Dower in branch '3.7': bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861) https://github.com/python/cpython/commit/e851049e0e045b5e0f9d5c6b8a64d7f6b8ecc9c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 17 23:44:39 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 18 Nov 2018 04:44:39 +0000 Subject: [issue34725] Py_GetProgramFullPath() odd behaviour in Windows In-Reply-To: <1537291607.58.0.956365154283.issue34725@psf.upfronthosting.co.za> Message-ID: <1542516279.61.0.788709270274.issue34725@psf.upfronthosting.co.za> Steve Dower added the comment: The next releases of 3.7 and 3.8 will include _Py_SetProgramFullPath() functions for embedders to set the eventual value of sys.executable before calling Py_Initialize(). It's undocumented and not guaranteed stable (and indeed, it looks like Victor is already working on another patch that may see it removed before it's ever released), but it's in now as a workaround for the cases that need it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 05:04:16 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 18 Nov 2018 10:04:16 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig In-Reply-To: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> Message-ID: <1542535456.14.0.788709270274.issue35266@psf.upfronthosting.co.za> Nick Coghlan added the comment: I like where you're going with this, but would be willing to write an update to PEP 432 to sketch out in advance what you now think the end state is going to look like? Merging the general structure of the draft PEP 432 implementation to make it possible to start migrating settings and see what's viable in practice has pretty much worked out as hoped, but we've diverged far enough from that structure now that we can't credibly claim to be working towards the current PEP draft as the new multi stage initialisation API. Changing the proposal (and adding yourself as a co-author) is fine - that was the whole point of enabling initial development as a private API in the first place. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 05:05:40 2018 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 18 Nov 2018 10:05:40 +0000 Subject: [issue15245] ast.literal_eval fails on some literals In-Reply-To: <1341346286.65.0.729285382693.issue15245@psf.upfronthosting.co.za> Message-ID: <1542535540.1.0.788709270274.issue15245@psf.upfronthosting.co.za> Mark Dickinson added the comment: > The question is should we make it working in older versions? That seems like an easy question: it would be a new feature in a bugfix branch, so no, we shouldn't make it work in older versions. Looks to me as though this issue can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 05:16:30 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 18 Nov 2018 10:16:30 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context In-Reply-To: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> Message-ID: <1542536190.19.0.788709270274.issue35265@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think the idea makes sense, but find the proposed name potentially confusing for two reasons: 1. It isn't only about configuration, it's about interpreter initialisation state in general 2. We use "context" for several other purposes already (most notably with statement context managers and async contexts) Given the proposed "_PyPreConfig" construct, how would you feel about calling this "_PyPreInitState"? The idea there being that like PreConfig, the PreInitState would be discarded once the interpreter was fully initialised - the PreInitState would only be needed to handle cleanup *while* initialising (either of temporary values, or in the event of initialisation failing and needing to undo previous allocations). My comment from #32566 also applies here: PEP 432 is now lagging so far behind the state of the private API implementation that it really needs an update to better reflect where you're wanting to take the public initialisation API following these changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 05:53:18 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 18 Nov 2018 10:53:18 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542538398.76.0.788709270274.issue35200@psf.upfronthosting.co.za> Nick Coghlan added the comment: (Retitled the issue to better reflect the underlying feature request) As Steven describes, there are enough problems with changing range.__repr__ that if that's the proposal, then the only possible answer is "No", and closing the issue. However, changing range.__str__ (and hence print, f-strings, logging, and more) offers many of the same benefits, without most of the downsides (repr will still roundtrip through eval, doctests won't break, etc). The only potential benefit that gets lost is the fact that entering "range(10)" at the REPL will still print "range(0, 10)", such that you need to do "print(range(10))" to get the version that shows the endpoint values. For longer ranges, "print(range(100))" will still end up being a lot more user friendly than "print(list(100))". ---------- title: Range repr could be better -> Make the half-open range behaviour easier to teach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 06:17:56 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 18 Nov 2018 11:17:56 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542539876.83.0.788709270274.issue35200@psf.upfronthosting.co.za> Julien Palard added the comment: In one hand I'm OK to enhance the __str__ of range, so I'll change my PR for this. It will not fix the issue, but let's not break backward compatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 06:23:41 2018 From: report at bugs.python.org (Marcin Niemira) Date: Sun, 18 Nov 2018 11:23:41 +0000 Subject: [issue32281] bdist_rpm fails if no rpm command and rpmbuild is not in /usr/bin or /bin In-Reply-To: <1513034809.77.0.213398074469.issue32281@psf.upfronthosting.co.za> Message-ID: <1542540221.45.0.788709270274.issue32281@psf.upfronthosting.co.za> Change by Marcin Niemira : ---------- keywords: +patch pull_requests: +9835 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 07:08:07 2018 From: report at bugs.python.org (wvxvw) Date: Sun, 18 Nov 2018 12:08:07 +0000 Subject: [issue35271] venv creates pyvenv.cfg with wrong home Message-ID: <1542542887.08.0.788709270274.issue35271@psf.upfronthosting.co.za> New submission from wvxvw : I must have some environment variable set, which affects this behavior, but I don't know which one that would be. What happens is as follows: No matter in what directory I execute this command: python3 -m venv .venv or python3 -m venv $(pwd)/.venv no matter if the path is relative or absolute, the value of "home" in generated pyvenv.cfg will point to some other virtual environment I created earlier. I would expect that at the minimum, if you aren't going to use the argument given on command line, then, at the minimum, alert the user about it. Why even bother given the argument in this case? PS. I discovered this, perhaps, due to using Emacs + pyvenv-* commands which probably set some environment variables. ---------- components: Library (Lib) messages: 330044 nosy: wvxvw priority: normal severity: normal status: open title: venv creates pyvenv.cfg with wrong home type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 07:39:18 2018 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 18 Nov 2018 12:39:18 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542544758.17.0.788709270274.issue35081@psf.upfronthosting.co.za> Stefan Behnel added the comment: Making _PyGC_FINALIZED() internal broke Cython (https://github.com/cython/cython/issues/2721). It's used in the finaliser implementation (https://github.com/cython/cython/blob/da657c8e326a419cde8ae6ea91be9661b9622504/Cython/Compiler/ModuleNode.py#L1442-L1456), to determine if an object for which tp_dealloc() is called has already been finalised or whether we have to do it. I'm not sure how to deal with this on our side now. Any clue? ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 07:59:31 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 18 Nov 2018 12:59:31 +0000 Subject: [issue35271] venv creates pyvenv.cfg with wrong home In-Reply-To: <1542542887.08.0.788709270274.issue35271@psf.upfronthosting.co.za> Message-ID: <1542545971.98.0.788709270274.issue35271@psf.upfronthosting.co.za> Eric V. Smith added the comment: You're going to have to provide some information, we can't guess at what's going on. At the very least: What OS? What shell? Which exact version of Python? How was it installed? Where is the file pyvenv.cfg that shows the problem? What are its entire contents? What are all of your environment variable? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 08:36:06 2018 From: report at bugs.python.org (Muhammed Alkan) Date: Sun, 18 Nov 2018 13:36:06 +0000 Subject: [issue35272] sqlite3 get the connected database url Message-ID: <1542548166.85.0.788709270274.issue35272@psf.upfronthosting.co.za> New submission from Muhammed Alkan : A feature for to get the connected database path or URL from connection object (sqlite3.Connection). ---------- messages: 330047 nosy: berker.peksag, ghaering, midnio priority: normal severity: normal status: open title: sqlite3 get the connected database url type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 08:38:15 2018 From: report at bugs.python.org (DamlaAltun) Date: Sun, 18 Nov 2018 13:38:15 +0000 Subject: [issue35272] sqlite3 get the connected database url In-Reply-To: <1542548166.85.0.788709270274.issue35272@psf.upfronthosting.co.za> Message-ID: <1542548295.71.0.788709270274.issue35272@psf.upfronthosting.co.za> DamlaAltun added the comment: Yeah, that would be great enhancement ---------- nosy: +DamlaAltun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 09:09:32 2018 From: report at bugs.python.org (Berker Peksag) Date: Sun, 18 Nov 2018 14:09:32 +0000 Subject: [issue35272] sqlite3 get the connected database url In-Reply-To: <1542548166.85.0.788709270274.issue35272@psf.upfronthosting.co.za> Message-ID: <1542550172.1.0.788709270274.issue35272@psf.upfronthosting.co.za> Berker Peksag added the comment: Just to be sure, what do you want to do is import sqlite3 conn = sqlite3.connect("foo.db") assert conn.database_path == "foo.db" right? I don't think that's something worth to expose in the Connection object. What's your use case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 09:32:51 2018 From: report at bugs.python.org (Muhammed Alkan) Date: Sun, 18 Nov 2018 14:32:51 +0000 Subject: [issue35272] sqlite3 get the connected database url In-Reply-To: <1542548166.85.0.788709270274.issue35272@psf.upfronthosting.co.za> Message-ID: <1542551571.06.0.788709270274.issue35272@psf.upfronthosting.co.za> Muhammed Alkan added the comment: The use case could be - Using it to check if you're connected to correct database (as you know the mutability could change the connection) - Getting the name, helping the developers while debugging. - No more reasons :P ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 11:31:56 2018 From: report at bugs.python.org (Robert Pollak) Date: Sun, 18 Nov 2018 16:31:56 +0000 Subject: [issue35145] sqlite3: optionally autoconvert table_info's DATETIME fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1542558716.2.0.788709270274.issue35145@psf.upfronthosting.co.za> Change by Robert Pollak : ---------- title: sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields -> sqlite3: optionally autoconvert table_info's DATETIME fields _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 11:46:01 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Nov 2018 16:46:01 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542559561.64.0.788709270274.issue35269@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 062a57bf4b768ef726975bcc1d34398387520147 by Miss Islington (bot) (Zackery Spytz) in branch 'master': bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) https://github.com/python/cpython/commit/062a57bf4b768ef726975bcc1d34398387520147 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 11:46:12 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Nov 2018 16:46:12 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542559572.5.0.788709270274.issue35269@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 11:58:23 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Nov 2018 16:58:23 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542560303.04.0.788709270274.issue35269@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ae02a929ddd748b67b3e6f6c6665267f031142e7 by Miss Islington (bot) in branch '3.7': bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) https://github.com/python/cpython/commit/ae02a929ddd748b67b3e6f6c6665267f031142e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:25:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Nov 2018 17:25:34 +0000 Subject: [issue30455] Generate all tokens related code and docs from Grammar/Tokens In-Reply-To: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> Message-ID: <1542561934.16.0.788709270274.issue30455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could anybody please make a review? There are two alternate PRs: PR 1860 and PR 10370. The difference between them is that the former one uses Lib/token.py as a source, and the latter one uses Grammar/Tokens as a source and generates Lib/token.py too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:26:50 2018 From: report at bugs.python.org (Luna Chen) Date: Sun, 18 Nov 2018 17:26:50 +0000 Subject: [issue35251] FTPHandler.ftp_open documentation error In-Reply-To: <1542233187.5.0.788709270274.issue35251@psf.upfronthosting.co.za> Message-ID: <1542562010.39.0.788709270274.issue35251@psf.upfronthosting.co.za> Luna Chen added the comment: Hi there Lysandros, I'm happy to investigate into this and send a PR. I think we will need some test cases for this as well. Please let me know! :) ---------- nosy: +BNMetrics _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:28:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Nov 2018 17:28:37 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542562117.92.0.788709270274.issue9842@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could anybody please look at PR 10330? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:30:57 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Nov 2018 17:30:57 +0000 Subject: [issue35169] Improve error messages for assignment In-Reply-To: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> Message-ID: <1542562257.61.0.788709270274.issue35169@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Benjamin, could you please take a look at this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:45:32 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Sun, 18 Nov 2018 17:45:32 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1542563132.57.0.788709270274.issue32035@psf.upfronthosting.co.za> Sanyam Khurana added the comment: The change in current PR is very minor and looks good enough that aligns the docs with the docstring and functionality of `ZipFile.writestr` as described. Can a core-contributor, please look at this? Also, I'm adding 3.8 for this change. ---------- nosy: +CuriousLearner versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 12:58:05 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Sun, 18 Nov 2018 17:58:05 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1542563885.21.0.788709270274.issue18859@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +9837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 13:12:29 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 18 Nov 2018 18:12:29 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542564749.27.0.788709270274.issue35269@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 13:42:30 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 18 Nov 2018 18:42:30 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1542566549.99.0.788709270274.issue35131@psf.upfronthosting.co.za> Jason R. Coombs added the comment: The problem you've encountered is that previously the file was assumed to be one encoding and would fail if it was not that encoding... so it was possible to lazy-load the file and process each line. In the new model, where you need to evaluate the viability of the file in one of two candidate encodings, you'll necessarily need to read the entire file once before processing its contents. Therefore, I recommend one of these options: 1. Always read the file in binary mode, ascertain the "best" encoding, then rewind the file and wrap it in a TextIOWrapper for that encoding. Presumably this logic is common--perhaps there's already a routine that does just that. 2. In a try/except block, read the entire content, decoded, into another iterable ... and then have the logic below rely on that content. i.e. `f = list(f)`. 3. Always assume UTF-8 instead of the system encoding. This change would be backward incompatible, so probably isn't acceptable without at least an interim release with a deprecation warning. I recommend a combination of (1) and then (3) in the future. That is: def determine_best_encoding(f, encodings=('utf-8', sys.getdefaultencoding())): """ Attempt to read and decode all of stream f using the encodings and return the first one that succeeds. Rewinds the file. """ f = open(..., 'rb) encoding = determine_best_encoding(f) if encoding != 'utf-8': warnings.warn("Detected pth file with unsupported encoding", DeprecationWarning) f = io.TextIOWrapper(f, encoding) Then, in a future version, dropping support for local encodings, all of that code can be replaced with `f = open(..., encoding='utf-8')`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 14:08:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Nov 2018 19:08:59 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1542568139.26.0.788709270274.issue32035@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 14:11:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Nov 2018 19:11:19 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1542568279.21.0.788709270274.issue32035@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since the docstring contains more information, it is better to just copy words from the docstring to the documentation. There are also other places where string is improperly used instead of bytes or the type is not specified. The note about file name encoding doesn't make sense in Python 3, since ZipFile.write() doesn't support bytes as a file name. PR 10592 fixed this. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 14:25:33 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 18 Nov 2018 19:25:33 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1542569133.27.0.788709270274.issue11122@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +bhyde, ned.deily versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 14:25:44 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 18 Nov 2018 19:25:44 +0000 Subject: [issue32281] bdist_rpm fails if no rpm command and rpmbuild is not in /usr/bin or /bin In-Reply-To: <1513034809.77.0.213398074469.issue32281@psf.upfronthosting.co.za> Message-ID: <1542569144.15.0.788709270274.issue32281@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, @n0npax, for producing a PR implementing what I suggested. It looks good. However, while testing it, I ran across earlier open Issue11122 in which the same issue of building rpms on macOS is brought up. (Sorry I didn't see this earlier!) The solution proposed there is to just unconditionally use rpmbuild as the use of rpm was for now obsolete versions. I don't really have any experience with rpmbuild or stake in making the change. But, rather than applying PR 10589, it looks like following through on Issue11122 would be the better approach. Therefore, I'm going to close this issue (and PR) as a duplicate and suggest we move the discussion and perhaps generate a new PR there. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> bdist_rpm should use rpmbuild, not rpm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 14:29:02 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 18 Nov 2018 19:29:02 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1542569342.86.0.788709270274.issue11122@psf.upfronthosting.co.za> Ned Deily added the comment: Note that Issue32281 also describes the problem of trying to use build_rpm on non-rpm systems, again specifically macOS. Before stumbling on this issue,I had suggested over there to use change bdist_rpm to not use hardwired paths for rpmbuild but, if the better solution is to just unconditionally use rpmbuild, let's do that instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 15:10:22 2018 From: report at bugs.python.org (Marcin Niemira) Date: Sun, 18 Nov 2018 20:10:22 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1542571822.76.0.788709270274.issue11122@psf.upfronthosting.co.za> Change by Marcin Niemira : ---------- pull_requests: +9839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 16:17:38 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 18 Nov 2018 21:17:38 +0000 Subject: [issue35269] A possible segfault involving a newly-created coroutine In-Reply-To: <1542474956.13.0.788709270274.issue35269@psf.upfronthosting.co.za> Message-ID: <1542575858.6.0.788709270274.issue35269@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Thanks, Zackery! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 16:27:19 2018 From: report at bugs.python.org (Carl Bordum Hansen) Date: Sun, 18 Nov 2018 21:27:19 +0000 Subject: [issue25988] collections.abc.Indexable In-Reply-To: <1451686739.56.0.219134772531.issue25988@psf.upfronthosting.co.za> Message-ID: <1542576439.85.0.788709270274.issue25988@psf.upfronthosting.co.za> Carl Bordum Hansen added the comment: Thank you for all the hours all of you spent on making Python awesome. I would like to start contributing as well. Do you consider it time to remove `__getattr__` in `Lib/collections/__init__.py` on master yet (introduced in pr #5460)? ---------- nosy: +carlbordum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 16:35:23 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 18 Nov 2018 21:35:23 +0000 Subject: [issue25988] collections.abc.Indexable In-Reply-To: <1451686739.56.0.219134772531.issue25988@psf.upfronthosting.co.za> Message-ID: <1542576923.03.0.788709270274.issue25988@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 16:43:02 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 18 Nov 2018 21:43:02 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542577382.84.0.788709270274.issue35200@psf.upfronthosting.co.za> Julien Palard added the comment: My first though went to giving something really simple like: >>> print(range(10)) 1, 2, ..., 8, 9 But for the empty range it would give an empty string. It may make sense, but may also be surprising. The other way would be to print [1, 2, ..., 8. 9], so the empty range gets [] instead of nothing. I think I prefer the first way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 16:57:08 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Nov 2018 21:57:08 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1542577382.84.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <20181118215701.GA11582@ando.pearwood.info> Steven D'Aprano added the comment: On Sun, Nov 18, 2018 at 09:43:02PM +0000, Julien Palard wrote: > My first though went to giving something really simple like: > > >>> print(range(10)) > 1, 2, ..., 8, 9 -1 Surely that would be your *second* thought, since you already had a perfectly adequate first thought: is explicit about what kind of object we have. Remember, there will be times where people don't know they have a range object, and are printing it to find out what they have. Let's just move that from __repr__ to __str__. > But for the empty range it would give an empty string. It may make > sense, but may also be surprising. > > The other way would be to print [1, 2, ..., 8. 9], so the empty range gets [] instead of nothing. Certainly not. That looks like a list containing 1, 2, ellipsis, 8, 9, and will only increase confusion about the difference between lists and range objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 17:27:11 2018 From: report at bugs.python.org (Julien Palard) Date: Sun, 18 Nov 2018 22:27:11 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542580031.09.0.788709270274.issue35200@psf.upfronthosting.co.za> Julien Palard added the comment: If I understand correctly, you'd like str(range(10)) to return ""? I'm really unconfortable doing this, for me __str__ is here to return an ?informal or nicely printable string representation of an object", not a convoluted "<{type(object)} object ...>" notation. I agree with you, the [0, 1, ..., 8, 9] notation is too confusing with the repr of a list, that's why I proposed the "0, 1, ..., 8, 9" which looks nice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 17:31:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 18 Nov 2018 22:31:35 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542580295.96.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: > Making _PyGC_FINALIZED() internal broke Cython (...) Aha, interesting. Would you mind to open a new dedicated issue? So we can discuss how much of the GC details we want to leak into the API :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 17:42:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 18 Nov 2018 22:42:40 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542580960.16.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: TODO: add a NEWS entry for all these changes. Copy of Nick Coghlan's comment: https://github.com/python/cpython/pull/10275#issuecomment-439339982 @vstinner For folks consuming source archives (Linux distros, anyone embedding Python in a larger application, etc) rather than prebuilt binaries, the build process is something that can break, even for Py_BUILD_CORE only changes. For those folks, when they pull a new source archive, their builds may break, especially if they're applying additional downstream patches the way Linux distros do. The NEWS entry for this header file rearrangement should go in the Build section (https://github.com/python/cpython/tree/master/Misc/NEWS.d/next/Build) rather than the C API section (since these headers aren't part of the public API at all), but it should still exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 17:48:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 18 Nov 2018 22:48:20 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig In-Reply-To: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> Message-ID: <1542581300.48.0.788709270274.issue35266@psf.upfronthosting.co.za> STINNER Victor added the comment: > I like where you're going with this, but would be willing to write an update to PEP 432 to sketch out in advance what you now think the end state is going to look like? Sadly, I'm unable to design in advance what will be the final state. Python initialization is a giant beast, full of traps, with many practical issues. I'm moving slowly, step by step. For example, this issue "only" move wchar_t* out of _PyCoreConfig, but Eric Snow told that me that he (or you, Nick, I don't recall) would prefer to not use "Unicode" during the very first initialization stage. wchar_t* is already Unicode. I'm unable to see yet how to have 3 stages: 1) no unicode 2) C structures, wchar_t* 3) Python objects Currently, (1)+(2) is _PyCoreConfig and (3) is _PyMainInterpreterConfig. I prefer to work directly on the code to make sure to have a working implementation, than working on paper but don't know if it's possible to implement it :-) One issue is that it requires more steps, but from my point of view we better control the risk since it's possible to move back if we make a mistake in a small change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 21:08:45 2018 From: report at bugs.python.org (Eric Wieser) Date: Mon, 19 Nov 2018 02:08:45 +0000 Subject: [issue8987] Distutils doesn't quote Windows command lines properly In-Reply-To: <1276406573.22.0.576013989845.issue8987@psf.upfronthosting.co.za> Message-ID: <1542593325.31.0.788709270274.issue8987@psf.upfronthosting.co.za> Eric Wieser added the comment: > then we should perhaps instead consider the rewrite for 3.6: provide a *new* distutils function that does use Popen and does things "right" (based on everything we've learned since distutils was written), leaving the old function in place, deprecated, for backward compatibility. Was any progress made towards achieving this? It's frustrating that the correct quoting behavior we get with `subprocess.Popen(List[str])` is not used by `spawn`, and now every level of distutils code has to think about whether it needs to quote its arguments for the shell. ---------- nosy: +Eric.Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 21:12:25 2018 From: report at bugs.python.org (Mark Lawrence) Date: Mon, 19 Nov 2018 02:12:25 +0000 Subject: [issue8987] Distutils doesn't quote Windows command lines properly In-Reply-To: <1276406573.22.0.576013989845.issue8987@psf.upfronthosting.co.za> Message-ID: <1542593545.14.0.788709270274.issue8987@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 21:52:35 2018 From: report at bugs.python.org (Lisa Roach) Date: Mon, 19 Nov 2018 02:52:35 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1542595955.41.0.788709270274.issue24209@psf.upfronthosting.co.za> Change by Lisa Roach : ---------- pull_requests: +9840 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 21:54:20 2018 From: report at bugs.python.org (Lisa Roach) Date: Mon, 19 Nov 2018 02:54:20 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1542596060.85.0.788709270274.issue24209@psf.upfronthosting.co.za> Lisa Roach added the comment: Looks like the original author isn't around anymore (feel free to chime in if you are, Link!), so I went ahead and made a PR. I added a quick unit test, it's not much but more than nothing, plus updated the documentation. ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 22:45:00 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 19 Nov 2018 03:45:00 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1542599100.44.0.788709270274.issue24209@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 18 23:10:42 2018 From: report at bugs.python.org (Shivank Gautam) Date: Mon, 19 Nov 2018 04:10:42 +0000 Subject: [issue35052] Coverity scan: copy/paste error in Lib/xml/dom/minidom.py In-Reply-To: <1540308654.33.0.788709270274.issue35052@psf.upfronthosting.co.za> Message-ID: <1542600642.63.0.788709270274.issue35052@psf.upfronthosting.co.za> Shivank Gautam added the comment: Hey Tal, I am extremely sorry for all delay. actually, due to internship and my university exams, I am unable to dedicate my time to bug(#35052). please consider it and you can tell Charalampos Stratakis in the bug to push his prepared pull request. I hope you will be still supportive when I will return in mid-dec after completing my exams. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 01:24:19 2018 From: report at bugs.python.org (yesheng) Date: Mon, 19 Nov 2018 06:24:19 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list Message-ID: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> New submission from yesheng <13611358285 at 139.com>: def yyy(): a, b = 'abc', 'abd' print([eval(i) for i in ('a', 'b')]) def zzz(): a, b = 'abc', 'abd' print({i: eval(i) for i in ('a', 'b')}) yyy() # ok zzz() # NameError: name 'a' is not defined, however in yyy() it is ok ---------- messages: 330073 nosy: yesheng priority: normal severity: normal status: open title: 'eval' in generator expression behave different in dict from list type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 02:18:31 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 07:18:31 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542611911.01.0.788709270274.issue35273@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I get NameError for both versions in both 3.6.5 and 3.7.1. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 02:42:57 2018 From: report at bugs.python.org (yesheng) Date: Mon, 19 Nov 2018 07:42:57 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542613377.97.0.788709270274.issue35273@psf.upfronthosting.co.za> yesheng <13611358285 at 139.com> added the comment: I tried again, and could not reproduce on 3.6.7, latest update: For 3.6.7: Both yyy() and zzz() got NameError For 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] yyy() got ['abc', 'abd'] zzz() got NameError 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] yyy() got ['abc', 'abd'] zzz() got NameError ---------- versions: +Python 2.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 02:45:59 2018 From: report at bugs.python.org (otst) Date: Mon, 19 Nov 2018 07:45:59 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter Message-ID: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> New submission from otst : My environment OS:Ubuntu18.04(x64) Python:3.6.6 Run print("\x98") in Python3 interpreter then freeze or slow responsed. Not problem run print '\x98' in Python 2.7.15rc1. Also no problem for python3 -c "print('\x98');" and run .py file. ---------- components: Interpreter Core messages: 330076 nosy: otst priority: normal severity: normal status: open title: Running print("\x98") then freeze in Interpreter type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 02:49:10 2018 From: report at bugs.python.org (Peter Otten) Date: Mon, 19 Nov 2018 07:49:10 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542613750.48.0.788709270274.issue35273@psf.upfronthosting.co.za> Peter Otten <__peter__ at web.de> added the comment: You probably saw this is in Python 2.7 where it is the expected behaviour. All versions of Python 3 should produce the NameError. ---------- nosy: +peter.otten versions: +Python 3.6 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 03:25:55 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Nov 2018 08:25:55 +0000 Subject: [issue25988] collections.abc.Indexable In-Reply-To: <1451686739.56.0.219134772531.issue25988@psf.upfronthosting.co.za> Message-ID: <1542615955.54.0.788709270274.issue25988@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 03:30:27 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 19 Nov 2018 08:30:27 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542616227.15.0.788709270274.issue35274@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I'm afraid I can't reproduce that in Python 3.5.2 or 3.6.4. Can you try this? from time import time print(time(), '\x98', time()); print(time()) and copy and paste the results. What terminal/console are you using? If you change to a different console, does the problem go away? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 03:33:17 2018 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Nov 2018 08:33:17 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542616397.98.0.788709270274.issue35244@psf.upfronthosting.co.za> Dong-hee Na added the comment: @matrixise Hi, St?phane Can I take a look at this issue if no one works on it? I have contributed to CPython, but it seems to be a good opportunity to contribute to a larger module. One more thing, It would be a good guide if you let me know what I should pay attention to when solving this issue. Thanks ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 03:42:14 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 19 Nov 2018 08:42:14 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542616934.84.0.788709270274.issue35244@psf.upfronthosting.co.za> St?phane Wirtel added the comment: Of course you can, good luck, if you need help ping us. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 03:45:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 08:45:05 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542617105.02.0.788709270274.issue35233@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 04:06:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 09:06:02 +0000 Subject: [issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers In-Reply-To: <1542121861.06.0.788709270274.issue35233@psf.upfronthosting.co.za> Message-ID: <1542618362.62.0.788709270274.issue35233@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 0e1312c959dcfd0193ed0c7ab3fd45d440da6d78 by Victor Stinner in branch '3.7': bpo-35233: test_embed: fix filesystem encoding (GH-10597) https://github.com/python/cpython/commit/0e1312c959dcfd0193ed0c7ab3fd45d440da6d78 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 04:26:01 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 19 Nov 2018 09:26:01 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1542580031.09.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <20181119085943.GB11582@ando.pearwood.info> Steven D'Aprano added the comment: On Sun, Nov 18, 2018 at 10:27:11PM +0000, Julien Palard wrote: > > Julien Palard added the comment: > > If I understand correctly, you'd like str(range(10)) to return ""? Exactly the same as you suggested for repr(range(10)) to return, so yes. > I'm really unconfortable doing this, for me __str__ is here to return > an ?informal or nicely printable string representation of an object", I think that the output you suggested is an informal AND nicely printable string representation of the object. In what way do you think it fails? It's an *informal* representation in the sense that it doesn't mimic the range constructor, you can't evaluate it, it isn't even legal Python syntax. "Nicely printable" is a matter of taste, but I think its quite nice (just not suitable for use as the repr), and especially nice for the purpose of showing the kind of object we're dealing with, rather than just the values in it. > not a convoluted "<{type(object)} object ...>" notation. If this is too convoluted for str(), why is it suitable for beginners when it goes through repr() instead? > I agree with you, the [0, 1, ..., 8, 9] notation is too confusing with > the repr of a list, that's why I proposed the "0, 1, ..., 8, 9" which > looks nice. Except that it gives no clue that it is a range object, and fails for empty ranges. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 05:12:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 10:12:36 +0000 Subject: [issue25083] Python can sometimes create incorrect .pyc files In-Reply-To: <1442143572.78.0.211523310189.issue25083@psf.upfronthosting.co.za> Message-ID: <1542622356.13.0.788709270274.issue25083@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 05:38:14 2018 From: report at bugs.python.org (Thomas Guettler) Date: Mon, 19 Nov 2018 10:38:14 +0000 Subject: [issue35275] Reading umask (thread-safe) Message-ID: <1542623894.75.0.788709270274.issue35275@psf.upfronthosting.co.za> New submission from Thomas Guettler : Up to now there is no thread way to read the umask in Python https://stackoverflow.com/questions/53227072/reading-umask-thread-safe You can use this pattern: current_umask = os.umask(0) # line1 os.umask(current_umask) # line2 return current_umask A thread which executes between line1 and line2 will have a different umask. I would be great, if the python standard library would provide correspondig thread safe method. Related question at stackoverflow: https://stackoverflow.com/questions/53227072/reading-umask-thread-safe ---------- messages: 330083 nosy: guettli priority: normal severity: normal status: open title: Reading umask (thread-safe) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:08:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Nov 2018 11:08:53 +0000 Subject: [issue35275] Reading umask (thread-safe) In-Reply-To: <1542623894.75.0.788709270274.issue35275@psf.upfronthosting.co.za> Message-ID: <1542625733.97.0.788709270274.issue35275@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is no thread way to read the umask in C as well. The os module provides thin wrappers to the POSIX API. os.umask() acts exactly as a C function umask(). If thread safe method be added in the POSIX API we can expose it in the os module. ---------- nosy: +serhiy.storchaka resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:32:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 11:32:26 +0000 Subject: [issue35275] Reading umask (thread-safe) In-Reply-To: <1542623894.75.0.788709270274.issue35275@psf.upfronthosting.co.za> Message-ID: <1542627146.39.0.788709270274.issue35275@psf.upfronthosting.co.za> STINNER Victor added the comment: Maybe the Python documentation can be enhanced to document functions which are known to have a side-effect "process-wide" vs "thread-safe" functions. For example, signal.pthread_sigmark() affects the current thread, wheras locale.setlocale() is process-wide. See "POSIX Safety Concepts" of the glibc: https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html#POSIX-Safety-Concepts Example with setlocale, "MT-Unsafe": https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:33:06 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 11:33:06 +0000 Subject: [issue35244] Allow to setup Clang as default compiler for modules build In-Reply-To: <1542197312.07.0.788709270274.issue35244@psf.upfronthosting.co.za> Message-ID: <1542627186.58.0.788709270274.issue35244@psf.upfronthosting.co.za> Steve Dower added the comment: You might consider adding this support to setuptools rather than CPython. The distutils module is basically closed to non-essential enhancements like this, and will eventually be deprecated for public use (which means totally unused on Windows and only used to build CPython itself on other platforms). Setuptools will merge in what it needs to cover existing scenarios and will become a required dependency for distutils-like builds. So eventually it will end up only in there anyway, and people will get to use it sooner if you start by putting it in setuptools. ---------- stage: -> test needed type: -> enhancement versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:34:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 11:34:00 +0000 Subject: [issue35275] Reading umask (thread-safe) In-Reply-To: <1542623894.75.0.788709270274.issue35275@psf.upfronthosting.co.za> Message-ID: <1542627240.26.0.788709270274.issue35275@psf.upfronthosting.co.za> STINNER Victor added the comment: My own (incomplete) list of "process-wide states": https://vstinner.readthedocs.io/threads.html#process-wide ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:36:24 2018 From: report at bugs.python.org (otst) Date: Mon, 19 Nov 2018 11:36:24 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542627384.62.0.788709270274.issue35274@psf.upfronthosting.co.za> otst added the comment: I used GNOME Terminal 3.28.2. I tried advised code Gnome Terminal and LXTerminal 0.3.1. but stop after first time() function. results: 1542621412.508629 (stop. Control+D later)? 1542621412.5086305 1542621412.5087285 >>> KeyboardInterrupt >>> Tried change '\x98' to '\x97' results: 1542621365.7332687 1542621365.73327 1542621365.733405 '\x97' is no problem. Perhaps the encoding may be affecting it. I used UTF-8 on the terminal. I changed the SHIFT_JIS and tried print('\x98'), but it did not stop. As a result of trying a little, what was okay: SHIFT_JIS ISO-2022-KR IBM850 GBK Also, I am Japanese and my computer is in Japanese environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:36:57 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 11:36:57 +0000 Subject: [issue8987] Distutils doesn't quote Windows command lines properly In-Reply-To: <1276406573.22.0.576013989845.issue8987@psf.upfronthosting.co.za> Message-ID: <1542627417.22.0.788709270274.issue8987@psf.upfronthosting.co.za> Steve Dower added the comment: There's been progress in terms of setuptools eventually adopting distutils, so that looks likely and we're basically planning on it. Adding this as an enhancement to setuptools is going to be a better approach than adding it to distutils in my opinion. ---------- versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:39:11 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 11:39:11 +0000 Subject: [issue35268] Windows asyncio reading continously stdin and stdout Stockfish In-Reply-To: <1542455574.0.0.788709270274.issue35268@psf.upfronthosting.co.za> Message-ID: <1542627551.94.0.788709270274.issue35268@psf.upfronthosting.co.za> Steve Dower added the comment: Are you awaiting those calls (and the write())? I can't tell at first glance whether you need to, but it seems like missing await there would cause your problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:43:20 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 11:43:20 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1542627800.37.0.788709270274.issue30082@psf.upfronthosting.co.za> Steve Dower added the comment: Looks like it's available. It will be a new subprocess option to not create a new window. The underlying issue is that some applications always request a console, and if your own application doesn't have one then Windows will create it. Normally you would fix this in the target application, but we can offer an option to try and force any new windows to be hidden (though as Eryk points out, it may cause unexpected behaviour and so should not be the default). ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:49:31 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 11:49:31 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542628171.04.0.788709270274.issue22121@psf.upfronthosting.co.za> Steve Dower added the comment: I still think the best option is a command line flag like "--open-in-homedir" that causes Idle to do a chdir to the user's documents folder. This way we can put a static option in the start menu item in the installer and not worry about the limitations of MSI, etc. These limitations also exist in MSIX (app store packages) which is coming soon as well. Alternatively, we could check the current directory to see if it matches sys.prefix (or whatever it matches) and chdir in that case. No option needed. For reference, VS Code requires "code.exe ." to start in the current directory, and otherwise uses its default no matter where you start it from. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:50:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 11:50:10 +0000 Subject: [issue35276] Document thread safety Message-ID: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> New submission from STINNER Victor : Many developers only discover that a Python function/module is not thread safe because they have a bug in production... Some examples: * bpo-7672: ssl * bpo-8865: select.poll is not thread safe * bpo-539175, bpo-21216: socket.gethostbyname() * bpo-7980: time.strptime() * bpo-6647: warnings.catch_warnings() * bpo-11077, bpo-33479: Tkinter * bpo-1336, bpo-19809: subprocess on Python 2 * bpo-15329: deque * bpo-35275: os.umask() Hopefully, sometimes it was possible to fix it: * bpo-3139: bytearray, buffer protocol * bpo-28969: @functools.lru_cache * bpo-21291: subprocess.Popen.wait() In the asyncio documentation, I explicitly documented that, by design, most classes are not thread-safe. For example, asyncio.Lock() is *NOT* thread-safe: https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Lock Maybe we should start to use a standard way to describe "thread safety". See "POSIX Safety Concepts" of the GNU libc: https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html#POSIX-Safety-Concepts Example with setlocale, "MT-Unsafe": https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html -- My own (incomplete) list of "process-wide states": https://vstinner.readthedocs.io/threads.html#process-wide ---------- assignee: docs at python components: Documentation messages: 330093 nosy: docs at python, vstinner priority: normal severity: normal status: open title: Document thread safety versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:50:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 11:50:30 +0000 Subject: [issue35275] Reading umask (thread-safe) In-Reply-To: <1542623894.75.0.788709270274.issue35275@psf.upfronthosting.co.za> Message-ID: <1542628230.6.0.788709270274.issue35275@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, let's move to bpo-35276: "Document thread safety". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 06:53:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 11:53:08 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1542628388.2.0.788709270274.issue35276@psf.upfronthosting.co.za> STINNER Victor added the comment: "Proces-wide" vs "thread-safe" is one thing. Another interesting property is "reentrant", but maybe that's too wide? Somehow related, iterating on a container and modify it may or may not work depending on the container type and the kind of modifications. -- > bpo-8865: select.poll is not thread safe I checked select documentation, it doesn't mention "thread" anywhere :-( https://docs.python.org/dev/library/select.html#poll-objects ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:21:44 2018 From: report at bugs.python.org (Donald Stufft) Date: Mon, 19 Nov 2018 12:21:44 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools Message-ID: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> New submission from Donald Stufft : Upgrade the bundled pip/setuptools to the latest version. Making this issue because blurb gets mad at me if I try to add a news entry without a bpo issue. ---------- assignee: dstufft components: Library (Lib) messages: 330096 nosy: dstufft priority: normal severity: normal status: open title: Upgrade bundled pip/setuptools versions: 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 Mon Nov 19 07:23:05 2018 From: report at bugs.python.org (Donald Stufft) Date: Mon, 19 Nov 2018 12:23:05 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542630185.27.0.788709270274.issue35277@psf.upfronthosting.co.za> Change by Donald Stufft : ---------- keywords: +patch pull_requests: +9843 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:46:03 2018 From: report at bugs.python.org (Yusuke Endoh) Date: Mon, 19 Nov 2018 12:46:03 +0000 Subject: [issue35278] directory traversal in tempfile prefix Message-ID: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> New submission from Yusuke Endoh : Hello, The tempfile library does not check the prefix argument, which can be exploited to create files outside tmpdir by using directory traversal. ``` >>> import tempfile >>> tempfile.gettempprefix() 'tmp' >>> f = tempfile.NamedTemporaryFile(prefix="/home/mame/cracked") >>> f.name '/home/mame/crackedlt3y_ddm' ``` The same issue was found and treated as a vulnerability in PHP (CVE-2006-1494) and Ruby (CVE-2018-6914). I first reported this issue to security at python.org at July 2018. Some people kindly discussed it, and finally I was told to create a ticket here. ---------- components: Library (Lib) messages: 330097 nosy: Yusuke Endoh priority: normal severity: normal status: open title: directory traversal in tempfile prefix type: security versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:46:52 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Nov 2018 12:46:52 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542631612.25.0.788709270274.issue35277@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:46:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Nov 2018 12:46:52 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542631612.86.0.788709270274.issue35277@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It would be better to not add the bundle in the git repository, but add an external dependency like for Tcl/Tk on Windows. Every new release of pip+setuptools increases the size of the git repository by around 2 MiB. This will be the fourth update in 2018. There were 9 updates in 2016. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:47:03 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Nov 2018 12:47:03 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542631623.65.0.788709270274.issue35277@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:47:28 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Nov 2018 12:47:28 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542631647.99.0.788709270274.issue35277@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 07:49:21 2018 From: report at bugs.python.org (Donald Stufft) Date: Mon, 19 Nov 2018 12:49:21 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1542631761.61.0.788709270274.issue35277@psf.upfronthosting.co.za> Donald Stufft added the comment: It doesn't bother me if you want to make that change, I don't currently have the time to do it. I just figured I'd throw the update PRs up since I can do it quickly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 09:02:10 2018 From: report at bugs.python.org (Ryan Zoeller) Date: Mon, 19 Nov 2018 14:02:10 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1542636130.31.0.788709270274.issue26660@psf.upfronthosting.co.za> Change by Ryan Zoeller : ---------- nosy: +rtzoeller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 09:05:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 14:05:50 +0000 Subject: [issue35278] directory traversal in tempfile prefix In-Reply-To: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> Message-ID: <1542636350.08.0.788709270274.issue35278@psf.upfronthosting.co.za> STINNER Victor added the comment: Ruby handled this issue as a vulnerability: https://www.ruby-lang.org/en/news/2018/03/28/unintentional-file-and-directory-creation-with-directory-traversal-cve-2018-6914/ The doc of "gettempprefix" says "This does not contain the directory component", so it is natural for users to think "prefix" will accept only a file name. Maybe we can silently truncated the directort part of the prefix to only keep the base name in stable branches, but raise an exception in Python 3.8? Or maybe emit a deprecation warning in Python 3.7? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 09:08:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 14:08:55 +0000 Subject: [issue35278] [security] directory traversal in tempfile prefix In-Reply-To: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> Message-ID: <1542636535.11.0.788709270274.issue35278@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: directory traversal in tempfile prefix -> [security] directory traversal in tempfile prefix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 09:26:55 2018 From: report at bugs.python.org (=?utf-8?b?Vm9qdMSbY2ggQm/EjWVr?=) Date: Mon, 19 Nov 2018 14:26:55 +0000 Subject: [issue35279] asyncio uses too many threads by default Message-ID: <1542637615.61.0.788709270274.issue35279@psf.upfronthosting.co.za> New submission from Vojt?ch Bo?ek : By default, asyncio spawns as many as os.cpu_count() * 5 threads to run I/O on. When combined with beefy machines (e.g. kubernetes servers) with, says, 56 cores, it results in very high memory usage. This is amplified by the fact that the `concurrent.futures.ThreadPoolExecutor` threads are never killed, and are not re-used until `max_workers` threads are spawned. Workaround: loop.set_default_executor(concurrent.futures.ThreadPoolExecutor(max_workers=8)) This is still not ideal as the program might not need max_workers threads, but they are still spawned anyway. I've hit this issue when running asyncio program in kubernetes. It created 260 idle threads and then ran out of memory. I think the default max_workers should be limited to some max value and ThreadPoolExecutor should not spawn new threads unless necessary. ---------- components: asyncio messages: 330101 nosy: Vojt?ch Bo?ek, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio uses too many threads by default type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 10:16:41 2018 From: report at bugs.python.org (pmpp) Date: Mon, 19 Nov 2018 15:16:41 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542640601.22.0.788709270274.issue35274@psf.upfronthosting.co.za> pmpp added the comment: hi i can reproduce with a ubuntu bionic or mint19 client toward a python3.4.3 reached via ssh server: - via mate-terminal or terminator : same behaviour as OP report - meanwhile using the same python3 directly via vnc + xterm gives : pm / # python3 Python 3.4.3 (default, Nov 12 2018, 22:25:49) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print( chr(152) ) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character '\x98' in position 0: ordinal not in range(128) >>> ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 10:20:30 2018 From: report at bugs.python.org (dingens) Date: Mon, 19 Nov 2018 15:20:30 +0000 Subject: [issue35280] Interactive shell overwrites history Message-ID: <1542640830.02.0.788709270274.issue35280@psf.upfronthosting.co.za> New submission from dingens : When opening two shells at the same time, history from the one that is closed first gets lost. Steps to reproduce: - let's call the contents of the history before this experiment `z` - open two interactive shells called A and B - execute commands in them, say `a` and `b`, respectively - close shell A - close shell B Actual behavior: - history contains `z` then `b` Expected behavior: - history contains `z` then `a` then `b` possibly related: issue22940 ---------- messages: 330103 nosy: dingens priority: normal severity: normal status: open title: Interactive shell overwrites history type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 10:22:45 2018 From: report at bugs.python.org (pmpp) Date: Mon, 19 Nov 2018 15:22:45 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542640965.93.0.788709270274.issue35274@psf.upfronthosting.co.za> pmpp added the comment: LC_ALL=en_US.UTF-8 on the ssh line is the culprit unset LC_ALL , gives same lockup result. but: LC_ALL=C give sames results as vnc, where no locale was set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 10:30:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Nov 2018 15:30:15 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542641415.69.0.788709270274.issue35274@psf.upfronthosting.co.za> STINNER Victor added the comment: I can reproduce the issue on Fedora 29 in gnome-terminal. Python is not blocked at all. It's just your terminal which stops displaying new strings. Try: import time print("\x98") with open("x", "w") as fp: fp.write("done\n") fp.flush() print("wait") time.sleep(5) print("exit") And see file "x" created even after print("\x98"). Sorry, I'm not interested to investigate the terminal behavior. ---------- nosy: +vstinner resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 10:45:49 2018 From: report at bugs.python.org (pmpp) Date: Mon, 19 Nov 2018 15:45:49 +0000 Subject: [issue35274] Running print("\x98") then freeze in Interpreter In-Reply-To: <1542613559.05.0.788709270274.issue35274@psf.upfronthosting.co.za> Message-ID: <1542642349.0.0.788709270274.issue35274@psf.upfronthosting.co.za> pmpp added the comment: anything not using "libvte" is fine i suggest you try "mlterm" a very good multilingual terminal ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 12:45:30 2018 From: report at bugs.python.org (Neil Conway) Date: Mon, 19 Nov 2018 17:45:30 +0000 Subject: [issue35267] reproducible deadlock with multiprocessing.Pool In-Reply-To: <1542416799.14.0.788709270274.issue35267@psf.upfronthosting.co.za> Message-ID: <1542649530.07.0.788709270274.issue35267@psf.upfronthosting.co.za> Change by Neil Conway : ---------- nosy: +nconway _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 13:24:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 19 Nov 2018 18:24:55 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542651895.27.0.788709270274.issue22121@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Eryk: If one wants a shortcut on the desktop, I believe the one in a directory has to be copied. I was also trying to cover the case where IDLE is installed for all users and a particular user wants a customized shortcut. Steve: Microsoft's effort to keep most users ignorant of command lines has been all too successful. So a new C.L. option can only be part of a solution. It seems that IDLE automatically changing directory, under some circumstances on some systems, to ???, should be part of a solution. But Documents is better that HOME. (This is the default now on Mac.) Last week there was a discussion of this issue started by someone who teaches or supports Python for non-computer experts at a university with multiple computers around the campus networked to a central computer with installed Python. What he and others want is for IDLE to start in a particular user's Python scripts subdirectory, and not have to change the directory in the open file dialog. This will require a new config option. For a config option to work with repository python (at least for me), I would like python.bat to the repository directory that contains /Lib rather than merely set PYTHONHOME to same. I need to make a list a ways to start Python and the consequences for sys.path and current directory on the three major systems and add it to idlelib/README.txt. For this issue, there are also ways to open a file after IDLE is started. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:02:19 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 19:02:19 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542654139.5.0.788709270274.issue22121@psf.upfronthosting.co.za> Raymond Hettinger added the comment: ISTM, the start directory needs to be a configuration option. The problem is that most users start IDLE using an icon rather than from the command-line (the latter is already challenging on Windows because they would have to put Python on the PATH just to launch IDLE and if they've already found and changed to the executable directly, it is a unfair further burden to now have to specify a different directory where their py files will be parked). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:08:31 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Mon, 19 Nov 2018 19:08:31 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1542654511.08.0.788709270274.issue18859@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Patch added in PR: https://github.com/python/cpython/pull/10591 ---------- nosy: +CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:14:33 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 19:14:33 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1542654873.03.0.788709270274.issue35276@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The general rule in Python is that nothing can be considered atomic unless specifically documented as atomic (such as the queue module or lru_cache which have internal locks). The only safe action is to put locks around all accesses to shared resources. We should have a FAQ entry to that effect. It should also note that "thread-safe" means different things to different people. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:25:49 2018 From: report at bugs.python.org (Lihu) Date: Mon, 19 Nov 2018 19:25:49 +0000 Subject: [issue35281] Allow access to unittest.TestSuite tests Message-ID: <1542655549.43.0.788709270274.issue35281@psf.upfronthosting.co.za> New submission from Lihu : I would like to have access to the list of tests in a TestSuite object. Currently there are two ways of doing this: I can access the protected attribute `_tests`, or I can iterate over the TestSuite and re-create data that I already have. The former option isn't part of the public API and makes mypy mad, and the latter seems redundant. Could we get a public property or getter for the internal test list (or a more appropriate implementation if necessary)? ---------- components: Library (Lib) messages: 330111 nosy: lbenezriravin priority: normal severity: normal status: open title: Allow access to unittest.TestSuite tests type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:28:53 2018 From: report at bugs.python.org (Lihu) Date: Mon, 19 Nov 2018 19:28:53 +0000 Subject: [issue35281] Allow access to unittest.TestSuite tests In-Reply-To: <1542655549.43.0.788709270274.issue35281@psf.upfronthosting.co.za> Message-ID: <1542655733.54.0.788709270274.issue35281@psf.upfronthosting.co.za> Change by Lihu : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:44:45 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 19:44:45 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542656685.83.0.788709270274.issue35200@psf.upfronthosting.co.za> Raymond Hettinger added the comment: After more thought, I'm in agreement with the comments that the proposed __str__ revision is confusing. After teaching another Python intro course last week, I'm now thinking that no change should be made. There are other effective ways to teach half-open intervals (i.e. using slicing on strings is now my preferred way). Also students need to learn about using list() with iterators. This core skill comes up with generators, enumerate, zip, filter, etc. So, we just need to teach the skill earlier in the course than we did with Python2.7. I recommend that we just close this and resist the urge to create a new oddity that does't generalize well (i.e. most other iterators can't show a preview of the output without actually consuming some of their inputs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 14:52:53 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 19 Nov 2018 19:52:53 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1542657173.17.0.788709270274.issue35131@psf.upfronthosting.co.za> Brett Cannon added the comment: There is not "find best encoding" code, hence why so much code out there uses chardet. :) This might also tie into issue #33944 and the idea of rethinking .pth files. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 15:26:33 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 19 Nov 2018 20:26:33 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542659193.89.0.788709270274.issue35200@psf.upfronthosting.co.za> Julien Palard added the comment: Hi Raymond, I agree, there exist other means of teaching half closed range, but I was more concerned by self-taught students, alone facing the current range repr than students well accompanied. I also agree, let's not change the current repr (for backward compatibility) and let's not change the current str (it won't help anyway), so I'm closing this. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 15:41:18 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 19 Nov 2018 20:41:18 +0000 Subject: [issue28401] Don't support the PEP384 stable ABI in pydebug builds In-Reply-To: <1476034292.17.0.316209799179.issue28401@psf.upfronthosting.co.za> Message-ID: <1542660078.96.0.788709270274.issue28401@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 16:04:22 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 19 Nov 2018 21:04:22 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542661462.34.0.788709270274.issue35221@psf.upfronthosting.co.za> Change by Julien Palard : ---------- keywords: +patch pull_requests: +9847 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 16:11:35 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 19 Nov 2018 21:11:35 +0000 Subject: [issue33944] Deprecate and remove pth files In-Reply-To: <1529688140.44.0.56676864532.issue33944@psf.upfronthosting.co.za> Message-ID: <1542661895.01.0.788709270274.issue33944@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Regarding other uses of .pth files, the project [future-fstrings](https://github.com/asottile/future-fstrings) relies on .pth files to enable its at-startup behavior. I'm also +1 to remove .pth files, but I also believe it's not viable today due to development installs of pkg_resource-style namespace packages. I haven't read the full history of this issue, but plan to get caught up on it soon. ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 16:59:41 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 21:59:41 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542664781.12.0.788709270274.issue35221@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur with Lisa that this is something the people need to learn (that is why they're taking a class). FWIW, I've seen people copy square brackets for optional arguments, "mypow(base[, exp])" and angle brackets for syntax, " if else ". We also see it with the ellipsis. Accordingly, there should be a FAQ entry or tutorial section on meta-syntactic variable and syntax placeholders. The would also be a good place to cover the confusing "/" and "*" notations generated by the argument clinic: __getattribute__(self, name, /). FWIW, if your students are also cutting-and-pasting the prompt, this is clearly an education issue and not an issue with the venv docs. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 17:13:05 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Nov 2018 22:13:05 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1542665585.63.0.788709270274.issue35276@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One idea is that you could author a threading HOWTO document that covers atomicity, locks, queues, reentrancy, etc. This is a thorny topic and it would be nice to have the principles and techniques collected in one place. Ideally, it would include examples of what to expect in various situations. For example, the pure python OrderedDict can be put in an inconsistent state if two threads make updates without a mutex; however, the containers implemented in C can never be broken even if they don't guarantee atomicity (i.e. a dict update making a pure python callback to __hash__ will never result in a broken dict). ISTM that the docs have presumed that people using threading know what they're doing; however, we know that isn't always true ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 18:40:21 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Nov 2018 23:40:21 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1542670821.29.0.788709270274.issue22121@psf.upfronthosting.co.za> Steve Dower added the comment: AFAICT, the best logic is this: if os.path.normcase(os.getcwd()) == os.path.normcase(sys.prefix): os.chdir(get_default_location(sys.platform)) The only complexity is likely to be that "Documents" is localized on Windows, and SHGetFolderPathW [1] requires ctypes, though I wouldn't be surprised if there's a hidden English link available. There might be some trick necessary for macOS too. All the command line options will work for now, but will break in the future. [1]: https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shgetfolderpathw It's not real obvious, but when https://bugs.python.org/issue34977 lands - soon! - we'll get good PATH support back, including for Idle. This means you'll get "idle[3[.y]].exe" available globally that will do the same thing as the icon in Start. In this situation, the logic above is the _only_ option that will work properly, as there are no arguments we can pass. So forcing the CWD out of the install directory but otherwise leaving it alone is the best option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 18:48:09 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Mon, 19 Nov 2018 23:48:09 +0000 Subject: [issue35251] FTPHandler.ftp_open documentation error In-Reply-To: <1542233187.5.0.788709270274.issue35251@psf.upfronthosting.co.za> Message-ID: <1542671289.1.0.788709270274.issue35251@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Yeah, I am not currently working on this, so feel free to make a PR anytime you want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 19:01:11 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 20 Nov 2018 00:01:11 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542672071.11.0.788709270274.issue35200@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Raymond: > I'm in agreement with the comments that the proposed __str__ revision is confusing. In what way is it "confusing"? I'm especially perplexed that Julien apparently thinks it is confusing when emitted by str(), but educational and useful when emitted by repr(). This makes no sense to me. I think Julien's idea is a good one, just not for repr, and I don't think it is confusing at all. Raymond: > most other iterators can't show a preview of the output without actually consuming some of their inputs `range` is not some arbitrary iterator, in fact it isn't an iterator at all: py> r = range(10) py> iter(r) is r False It is a sequence, like list and tuple, and like list and tuple it is perfectly capable of showing its content (in full or part) on demand. Other important built-in sequence types like strings, lists and tuples aren't hamstrung with the restriction not to do anything iterators can't do, there's no good reason for range objects to be given that restriction. Julien: > I'm closing this. Not so hasty, please. Some of us think this is a worthwhile enhancement. You might have changed your mind, but the idea is bigger than you now :-) I'm taking this discussion to Python-Ideas to see if there is community interest in this feature. If so, I'm going to reopen the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 19:07:06 2018 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 20 Nov 2018 00:07:06 +0000 Subject: [issue35271] venv creates pyvenv.cfg with wrong home In-Reply-To: <1542542887.08.0.788709270274.issue35271@psf.upfronthosting.co.za> Message-ID: <1542672426.84.0.788709270274.issue35271@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 19:27:33 2018 From: report at bugs.python.org (Windson Yang) Date: Tue, 20 Nov 2018 00:27:33 +0000 Subject: [issue35251] FTPHandler.ftp_open documentation error In-Reply-To: <1542233187.5.0.788709270274.issue35251@psf.upfronthosting.co.za> Message-ID: <1542673653.02.0.788709270274.issue35251@psf.upfronthosting.co.za> Change by Windson Yang : ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 19 19:51:49 2018 From: report at bugs.python.org (Windson Yang) Date: Tue, 20 Nov 2018 00:51:49 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542675109.75.0.788709270274.issue35273@psf.upfronthosting.co.za> Windson Yang added the comment: I get NameError for both versions in both 3.4.4, 3.5.2, 3.6.4, 3.7.1 ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 02:34:55 2018 From: report at bugs.python.org (Peter Petrik) Date: Tue, 20 Nov 2018 07:34:55 +0000 Subject: [issue31601] Availability of utimensat, futimens not checked correctly on macOS In-Reply-To: <1506493420.2.0.154975027568.issue31601@psf.upfronthosting.co.za> Message-ID: <1542699295.49.0.788709270274.issue31601@psf.upfronthosting.co.za> Peter Petrik added the comment: This issue blocks QGIS distribution on MacOS for 10.11 and 10.12 releases, https://github.com/lutraconsulting/qgis-mac-packager/issues/22 I would like to know how much work is involved to fix the issue, possible whether there is a plan to fix it. Also we would appreciate quote & timeline for fix to info at lutraconsulting.co.uk, so we can consider to sponsor this fix. Thanks ---------- nosy: +Peter Petrik2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 02:57:19 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 20 Nov 2018 07:57:19 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542700639.44.0.788709270274.issue34995@psf.upfronthosting.co.za> INADA Naoki added the comment: I worried about people think we recommend it when we support it, while this is just a request from one person, not recommendation after wide discussion. But it doesn't affect to static tools than I suspected. Tools like autocompletion should support cached_property in normal class anyway. And this pull request doesn't promote the cached_property support in the document. So I don't have a strong objections for now. Generally speaking, I don't like this type of changes. Some people think it's improvement, but since there are no clear vision/recommendation how ABCs are used, it's just a random increasing code. We can't maintain "preferably only one obvious way" for now, especially about ABCs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 03:42:47 2018 From: report at bugs.python.org (flying sheep) Date: Tue, 20 Nov 2018 08:42:47 +0000 Subject: [issue31292] `python setup.py check --restructuredtext` fails when a include directive is present. In-Reply-To: <1503928665.81.0.590770692205.issue31292@psf.upfronthosting.co.za> Message-ID: <1542703367.58.0.788709270274.issue31292@psf.upfronthosting.co.za> Change by flying sheep : ---------- keywords: +patch pull_requests: +9848 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 05:21:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 10:21:15 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1542709275.26.0.788709270274.issue35276@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't think that it would make sense to annotate *each* function in the documentation, that would require too much work. I suggest to start to annotate functions which are known to have "side effects" or are not safe whereas users can be surprised to read that they are unsafe in the context of multithreading. For example, document that os.chdir() is "process-wide" (I'm not sure how to document it). I think that everybody agrees that it's the case, and IMHO it's an useful information. At least, one user has been surprised to read that os.umask() is process-wide: "I would be great, if the python standard library would provide correspondig thread safe method." https://bugs.python.org/issue35275 > One idea is that you could author a threading HOWTO document that covers atomicity, locks, queues, reentrancy, etc. This is a thorny topic and it would be nice to have the principles and techniques collected in one place. Yes. About the definition of atomicity, thread-safe, process-wide, etc. There is an existing example: contextlib describes "Reentrant context managers". https://docs.python.org/dev/library/contextlib.html#reentrant-cms > Ideally, it would include examples of what to expect in various situations. For example, the pure python OrderedDict can be put in an inconsistent state if two threads make updates without a mutex; however, the containers implemented in C can never be broken even if they don't guarantee atomicity (i.e. a dict update making a pure python callback to __hash__ will never result in a broken dict). This is where Python becomes obscure. Depending on the implementation, a method can be atomic or not :-/ Maybe atomicity should be documented as a "CPython implementation detail"!? > ISTM that the docs have presumed that people using threading know what they're doing; however, we know that isn't always true ;-) I don't understand threads and I have no idea which method are thread-safe or not. Each time, I should look at the doc, read the implementation, etc. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 06:11:01 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Nov 2018 11:11:01 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1542712261.43.0.788709270274.issue18859@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset d5d33681c1cd1df7731eb0fb7c0f297bc2f114e6 by ?ukasz Langa (Sanyam Khurana) in branch 'master': bpo-18859: Document --with-valgrind option in README.valgrind (#10591) https://github.com/python/cpython/commit/d5d33681c1cd1df7731eb0fb7c0f297bc2f114e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 06:12:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Nov 2018 11:12:05 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1542712325.54.0.788709270274.issue18859@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 06:17:54 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Tue, 20 Nov 2018 11:17:54 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542712674.26.0.788709270274.issue34995@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: I am with Inada-san actually. I would go as far as saying that @cached_property @abstractmethod def something(): ... should unconditionally raise on definition. Mostly because this is just misleading. This declaration doesn't guarantee that the implementation will use caching (neither Python nor mypy can enforce this). Caching is an _implementation_ detail, while ABCs are used to specify _interface_. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 07:27:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 12:27:56 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542716876.35.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: Example of the bug: import locale # LC_CTYPE: latin1 encoding locale.setlocale(locale.LC_ALL, "en_GB") # LC_MONETARY: utf8 encoding locale.setlocale(locale.LC_MONETARY, "ar_SA.UTF-8") lc = locale.localeconv() for attr in ( "mon_grouping", "int_curr_symbol", "currency_symbol", "mon_decimal_point", "mon_thousands_sep", ): print(f"{attr}: {lc[attr]!a}") Python 3.7 output: mon_grouping: [] int_curr_symbol: 'SAR ' currency_symbol: '\xd8\xb1.\xd8\xb3' mon_decimal_point: '.' mon_thousands_sep: '' Expected output: mon_grouping: [] int_curr_symbol: 'SAR ' currency_symbol: '\u0631.\u0633' mon_decimal_point: '.' mon_thousands_sep: '' Tested on Fedora 29. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 07:36:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 12:36:21 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542717381.64.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9849 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 07:47:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 12:47:44 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542718064.57.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-33954: float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator. It may be nice to fix these two bugs at the same times, since they are related :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 08:24:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 13:24:19 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1542720259.95.0.788709270274.issue35276@psf.upfronthosting.co.za> STINNER Victor added the comment: Aha, another strange beast: in Python 3, locale.localeconv() now changes temporarily the LC_CTYPE locale is some cases, and this change affects other threads. That's not something expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 09:10:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 14:10:05 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542723005.07.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested manually PR 10606: LC_ALL= LC_CTYPE=xxx LC_MONETARY=xxx ./python -c 'import locale; locale.setlocale(locale.LC_ALL, ""); print(ascii(locale.localeconv()["currency_symbol"]))' '\xa3' Result (bug = result/error without the fix): * LC_CTYPE=en_GB, LC_MONETARY=ar_SA.UTF-8: currency_symbol='\u0631.\u0633' (bug: '\xd8\xb1.\xd8\xb3') * LC_CTYPE=en_GB, LC_MONETARY=fr_FR.UTF-8: currency_symbol='\u20ac' (bug: '\xe2\x82\xac') * LC_CTYPE=en_GB, LC_MONETARY=uk_UA.koi8u: currency_symbol='\u0433\u0440\u043d.' (bug: '\xc7\xd2\xce.') * LC_CTYPE=fr_FR.UTF-8, LC_MONETARY=uk_UA.koi8u: currency_symbol='\u0433\u0440\u043d.' (bug: UnicodeDecodeError) Locale encodings: * en_GB: latin1 * ar_SA.UTF-8: utf8 * fr_FR.UTF-8: utf8 * uk_UA.koi8u: KOI8-U ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 09:10:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 14:10:13 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542723013.64.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 09:27:54 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 20 Nov 2018 14:27:54 +0000 Subject: [issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes In-Reply-To: <1526648438.42.0.682650639539.issue33570@psf.upfronthosting.co.za> Message-ID: <1542724074.42.0.788709270274.issue33570@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- pull_requests: +9850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 10:20:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 15:20:28 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542727228.86.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 02e6bf7f2025cddcbde6432f6b6396198ab313f4 by Victor Stinner in branch 'master': bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) https://github.com/python/cpython/commit/02e6bf7f2025cddcbde6432f6b6396198ab313f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 10:37:01 2018 From: report at bugs.python.org (Mathias Ettinger) Date: Tue, 20 Nov 2018 15:37:01 +0000 Subject: [issue29298] argparse fails with required subparsers, un-named dest, and empty argv In-Reply-To: <1484664769.91.0.625725054847.issue29298@psf.upfronthosting.co.za> Message-ID: <1542728221.37.0.788709270274.issue29298@psf.upfronthosting.co.za> Mathias Ettinger added the comment: I was just hit by the very same issue and added the following test into `_get_action_name` to work around it: elif isinstance(argument, _SubParsersAction): return '{%s}' % ','.join(map(str, argument.choices)) I checked #9253 as referenced by paul j3 and like the `argument.name()` approach as well as it's less specific. Any chance this can be addressed one way or another? ---------- nosy: +Mathias Ettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 10:59:07 2018 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 20 Nov 2018 15:59:07 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542729547.95.0.788709270274.issue34995@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:00:30 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 20 Nov 2018 16:00:30 +0000 Subject: [issue28043] Sane defaults for SSLContext options and ciphers In-Reply-To: <1473419921.81.0.961538270346.issue28043@psf.upfronthosting.co.za> Message-ID: <1542729630.49.0.788709270274.issue28043@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- pull_requests: +9851 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:18:41 2018 From: report at bugs.python.org (Julien Palard) Date: Tue, 20 Nov 2018 16:18:41 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542730721.71.0.788709270274.issue31146@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 6b73bb523a176123a819e4ebac3727d31d861515 by Julien Palard in branch 'master': bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) https://github.com/python/cpython/commit/6b73bb523a176123a819e4ebac3727d31d861515 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:19:05 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 16:19:05 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542730745.76.0.788709270274.issue31146@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:19:20 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 16:19:20 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542730760.94.0.788709270274.issue31146@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:19:33 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 16:19:33 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542730773.19.0.788709270274.issue31146@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 11:25:27 2018 From: report at bugs.python.org (Matt Wilber) Date: Tue, 20 Nov 2018 16:25:27 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542731127.74.0.788709270274.issue34995@psf.upfronthosting.co.za> Matt Wilber added the comment: Inada-san, I think it's fair to ask for a broader vision about how ABCs are used. In that respect I'm wondering about some inconsistencies in the existing functools module about whether wrappers should maintain the wrapped function's __isabstractmethod__ attribute. Both singledispatchmethod and partialmethod implement their own way of copying __isabstractmethod__ from the wrapped function. singledispatchmethod does this in addition to calling update_wrapper, whereas partialmethod doesn't seem to use update_wrapper at all. In terms of a broader vision, then, should the decorators in functools be more consistent about whether the __isabstractmethod__ attribute of a wrapped function is preserved in the wrapped version? Should update_wrapper be the way to standardize this? If so, it would make sense either to remove the __isabstractmethod__ copying from those decorators, or otherwise to add __isabstractmethod__ to the list of attributes that are copied from the wrapped function by update_wrapper. Hopefully viewing the problem in this way avoids the pitfalls of adding random code to the codebase, as you are pointing out. Let me know if this discussion belongs in a broader issue than this one. Thank you :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:18:04 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Tue, 20 Nov 2018 17:18:04 +0000 Subject: [issue25439] Add type checks to urllib.request.Request In-Reply-To: <1445247083.91.0.927080887762.issue25439@psf.upfronthosting.co.za> Message-ID: <1542734284.56.0.788709270274.issue25439@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- assignee: -> CuriousLearner nosy: +CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:19:13 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Tue, 20 Nov 2018 17:19:13 +0000 Subject: [issue25439] Add type checks to urllib.request.Request In-Reply-To: <1445247083.91.0.927080887762.issue25439@psf.upfronthosting.co.za> Message-ID: <1542734353.4.0.788709270274.issue25439@psf.upfronthosting.co.za> Sanyam Khurana added the comment: I'm working on applying the patch cleanly to master branch for this. Also adding 3.8 and 3.7 as candidates for the bug. ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:26:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 17:26:14 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542734774.03.0.788709270274.issue9842@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129 by Serhiy Storchaka in branch 'master': bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) https://github.com/python/cpython/commit/6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:26:22 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 17:26:22 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542734782.08.0.788709270274.issue9842@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:26:30 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 17:26:30 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542734790.1.0.788709270274.issue9842@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:27:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 17:27:19 +0000 Subject: [issue35169] Improve error messages for assignment In-Reply-To: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> Message-ID: <1542734839.41.0.788709270274.issue35169@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 97f1efb6062188645a470daaa91e3669d739c75f by Serhiy Storchaka in branch 'master': bpo-35169: Improve error messages for forbidden assignments. (GH-10342) https://github.com/python/cpython/commit/97f1efb6062188645a470daaa91e3669d739c75f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 12:40:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 17:40:23 +0000 Subject: [issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self" In-Reply-To: <1448654213.28.0.807225788685.issue25750@psf.upfronthosting.co.za> Message-ID: <1542735623.38.0.788709270274.issue25750@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:07:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:07:05 +0000 Subject: [issue35169] Improve error messages for assignment In-Reply-To: <1541445452.32.0.788709270274.issue35169@psf.upfronthosting.co.za> Message-ID: <1542737225.61.0.788709270274.issue35169@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:07:57 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:07:57 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542737277.88.0.788709270274.issue9842@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f8f9915f9585a5d4f4a4457ef43ac66607c5f380 by Miss Islington (bot) in branch '3.7': bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) https://github.com/python/cpython/commit/f8f9915f9585a5d4f4a4457ef43ac66607c5f380 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:08:11 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:08:11 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542737291.37.0.788709270274.issue9842@psf.upfronthosting.co.za> miss-islington added the comment: New changeset dac5124ba498b51a2c46e2bda751150ae244ed47 by Miss Islington (bot) in branch '3.6': bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) https://github.com/python/cpython/commit/dac5124ba498b51a2c46e2bda751150ae244ed47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:31:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:31:42 +0000 Subject: [issue33325] Optimize sequences of constants in the compiler In-Reply-To: <1524312560.56.0.682650639539.issue33325@psf.upfronthosting.co.za> Message-ID: <1542738702.43.0.788709270274.issue33325@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Good point! Thank you Mark for your comment. In theory, fewer bytecodes is better (the first example doesn't create a new object, it operates with references to existing objects). But in practice the difference is very small and overwhelmed by random factors. We need hundreds or thousands of constants to get a stable result. This is far from a common use case. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:41:12 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542739272.2.0.788709270274.issue35021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3ec0f495163da3b7a15deb2805cec48aed432f58 by Serhiy Storchaka in branch 'master': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/3ec0f495163da3b7a15deb2805cec48aed432f58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:41:12 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542739272.36.0.702299269573.issue31752@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3ec0f495163da3b7a15deb2805cec48aed432f58 by Serhiy Storchaka in branch 'master': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/3ec0f495163da3b7a15deb2805cec48aed432f58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:32 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:41:32 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542739292.32.0.788709270274.issue35021@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:32 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:41:32 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542739292.45.0.663665092547.issue31752@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:38 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:41:38 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542739298.56.0.788709270274.issue35021@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:41:38 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:41:38 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542739298.66.0.663665092547.issue31752@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:45:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:45:43 +0000 Subject: [issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self" In-Reply-To: <1448654213.28.0.807225788685.issue25750@psf.upfronthosting.co.za> Message-ID: <1542739543.55.0.788709270274.issue25750@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 by Serhiy Storchaka in branch 'master': bpo-25750: Fix a compiler warning introduced in GH-9084. (GH-10234) https://github.com/python/cpython/commit/b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:51:43 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Tue, 20 Nov 2018 18:51:43 +0000 Subject: [issue25439] Add type checks to urllib.request.Request In-Reply-To: <1445247083.91.0.927080887762.issue25439@psf.upfronthosting.co.za> Message-ID: <1542739903.94.0.788709270274.issue25439@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +9862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:59:14 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:59:14 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542740354.87.0.788709270274.issue35021@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d57ab8ac182d15558118523ad1b11b029e105c46 by Miss Islington (bot) in branch '3.7': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/d57ab8ac182d15558118523ad1b11b029e105c46 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 13:59:15 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 18:59:15 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542740354.99.0.702299269573.issue31752@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d57ab8ac182d15558118523ad1b11b029e105c46 by Miss Islington (bot) in branch '3.7': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/d57ab8ac182d15558118523ad1b11b029e105c46 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:02:52 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 19:02:52 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542740572.61.0.788709270274.issue35021@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7a0d964afb41bde846771c81ba746238339cdd8c by Miss Islington (bot) in branch '3.6': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/7a0d964afb41bde846771c81ba746238339cdd8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:02:53 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 19:02:53 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542740573.38.0.702299269573.issue31752@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7a0d964afb41bde846771c81ba746238339cdd8c by Miss Islington (bot) in branch '3.6': bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) https://github.com/python/cpython/commit/7a0d964afb41bde846771c81ba746238339cdd8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:15:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:15:48 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542741348.27.0.788709270274.issue35021@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:15:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:15:48 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542741348.4.0.663665092547.issue31752@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:19:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:19:37 +0000 Subject: [issue9842] Document ... used in recursive repr of containers In-Reply-To: <1284336324.93.0.400210409006.issue9842@psf.upfronthosting.co.za> Message-ID: <1542741577.85.0.788709270274.issue9842@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:28:26 2018 From: report at bugs.python.org (Emily Morehouse) Date: Tue, 20 Nov 2018 19:28:26 +0000 Subject: [issue30455] Generate all tokens related code and docs from Grammar/Tokens In-Reply-To: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> Message-ID: <1542742106.98.0.788709270274.issue30455@psf.upfronthosting.co.za> Change by Emily Morehouse : ---------- pull_requests: +9865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:34:11 2018 From: report at bugs.python.org (Martin DeMello) Date: Tue, 20 Nov 2018 19:34:11 +0000 Subject: [issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir Message-ID: <1542742451.18.0.788709270274.issue35282@psf.upfronthosting.co.za> New submission from Martin DeMello : It would be useful for lib2to3.refactor to return which files were actually changed. Right now that information is logged but not returned. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 330149 nosy: martindemello priority: normal severity: normal status: open title: Add a return value to lib2to3.refactor.refactor_file and refactor_dir type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:37:49 2018 From: report at bugs.python.org (Martin DeMello) Date: Tue, 20 Nov 2018 19:37:49 +0000 Subject: [issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir In-Reply-To: <1542742451.18.0.788709270274.issue35282@psf.upfronthosting.co.za> Message-ID: <1542742669.24.0.788709270274.issue35282@psf.upfronthosting.co.za> Change by Martin DeMello : ---------- keywords: +patch pull_requests: +9866 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:56:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:56:41 +0000 Subject: [issue35021] Assertion failures in datetimemodule.c. In-Reply-To: <1539884234.35.0.788709270274.issue35021@psf.upfronthosting.co.za> Message-ID: <1542743801.05.0.788709270274.issue35021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 40fdf471931f029ea07e6190f0fe116e0735661b by Serhiy Storchaka in branch '2.7': [2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617) https://github.com/python/cpython/commit/40fdf471931f029ea07e6190f0fe116e0735661b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 14:56:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:56:41 +0000 Subject: [issue31752] Assertion failure in timedelta() in case of bad __divmod__ In-Reply-To: <1507670968.8.0.213398074469.issue31752@psf.upfronthosting.co.za> Message-ID: <1542743801.18.0.702299269573.issue31752@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 40fdf471931f029ea07e6190f0fe116e0735661b by Serhiy Storchaka in branch '2.7': [2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617) https://github.com/python/cpython/commit/40fdf471931f029ea07e6190f0fe116e0735661b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 15:14:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 20:14:32 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542744872.42.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 15:34:03 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 20 Nov 2018 20:34:03 +0000 Subject: [issue35281] Allow access to unittest.TestSuite tests In-Reply-To: <1542655549.43.0.788709270274.issue35281@psf.upfronthosting.co.za> Message-ID: <1542746043.1.0.788709270274.issue35281@psf.upfronthosting.co.za> Brett Cannon added the comment: I don't quite follow what you're after as it sounds the same as calling `list(test_suite)`. Am I missing something or are you just trying to avoid the list creation? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:04:53 2018 From: report at bugs.python.org (Arthur Neufeld) Date: Tue, 20 Nov 2018 21:04:53 +0000 Subject: [issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API In-Reply-To: <1542306291.56.0.788709270274.issue35259@psf.upfronthosting.co.za> Message-ID: <1542747893.4.0.788709270274.issue35259@psf.upfronthosting.co.za> Change by Arthur Neufeld : ---------- keywords: +patch pull_requests: +9868 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:06:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 21:06:26 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542747986.0.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6eff6b8eecd7a8eccad16419269fa18ec820922e by Victor Stinner in branch '3.7': bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) https://github.com/python/cpython/commit/6eff6b8eecd7a8eccad16419269fa18ec820922e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:08:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 21:08:55 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542748135.44.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:28:33 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 20 Nov 2018 21:28:33 +0000 Subject: [issue34532] Windows launcher exits with error after listing available versions In-Reply-To: <1535476358.72.0.56676864532.issue34532@psf.upfronthosting.co.za> Message-ID: <1542749313.93.0.788709270274.issue34532@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d by Steve Dower (Brendan Gerrity) in branch 'master': bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) https://github.com/python/cpython/commit/c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:28:51 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 21:28:51 +0000 Subject: [issue34532] Windows launcher exits with error after listing available versions In-Reply-To: <1535476358.72.0.56676864532.issue34532@psf.upfronthosting.co.za> Message-ID: <1542749331.12.0.788709270274.issue34532@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:32:38 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 20 Nov 2018 21:32:38 +0000 Subject: [issue34532] Windows launcher exits with error after listing available versions In-Reply-To: <1535476358.72.0.56676864532.issue34532@psf.upfronthosting.co.za> Message-ID: <1542749558.3.0.788709270274.issue34532@psf.upfronthosting.co.za> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:35:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 21:35:49 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1542749749.83.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9871 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:36:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 21:36:19 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542749779.54.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset df3051b53fd7f2862a4087f5449e811d8421347a by Victor Stinner in branch '3.6': bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) (GH-10621) https://github.com/python/cpython/commit/df3051b53fd7f2862a4087f5449e811d8421347a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:37:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 21:37:25 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542749845.32.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 16:48:38 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Nov 2018 21:48:38 +0000 Subject: [issue34532] Windows launcher exits with error after listing available versions In-Reply-To: <1535476358.72.0.56676864532.issue34532@psf.upfronthosting.co.za> Message-ID: <1542750518.55.0.788709270274.issue34532@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 129642a1ff6a2f55933186b2303c307d58b710eb by Miss Islington (bot) in branch '3.7': bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) https://github.com/python/cpython/commit/129642a1ff6a2f55933186b2303c307d58b710eb ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:00:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 22:00:43 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1542751243.43.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: Minimum reproducer, on Fedora 29: import locale locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') print(ascii('{:n}'.format(1.5))) Current result: 'H,5' Output with PR 10623: '1,5' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:16:29 2018 From: report at bugs.python.org (Dieter Maurer) Date: Tue, 20 Nov 2018 22:16:29 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" Message-ID: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> New submission from Dieter Maurer : In module "threading", class "Thread" defines "is_alive" and defines "isAlive = is_alive". The derived class "_DummyThread" redefines "is_alive" but forgets to update the "isAlive" alias. As a consequence, calling "_DummyThread.isAlive" leads to an "AssertionErrror". The "isAlive" method is mentioned in the docstring of "Thread.join". ---------- components: Library (Lib) messages: 330158 nosy: dmaurer priority: normal severity: normal status: open title: "threading._DummyThread" redefines "is_alive" but forgets "isAlive" type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:37:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 22:37:48 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542753468.36.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:38:01 2018 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 20 Nov 2018 22:38:01 +0000 Subject: [issue35284] Incomplete error handling in the compiler's compiler_call() Message-ID: <1542753481.5.0.788709270274.issue35284@psf.upfronthosting.co.za> New submission from Zackery Spytz : compiler_call() needs to check if an error occurred during the maybe_optimize_method_call() call. ---------- components: Interpreter Core messages: 330159 nosy: ZackerySpytz priority: normal severity: normal status: open title: Incomplete error handling in the compiler's compiler_call() type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:40:30 2018 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 20 Nov 2018 22:40:30 +0000 Subject: [issue35284] Incomplete error handling in the compiler's compiler_call() In-Reply-To: <1542753481.5.0.788709270274.issue35284@psf.upfronthosting.co.za> Message-ID: <1542753630.63.0.788709270274.issue35284@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +9873 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:46:27 2018 From: report at bugs.python.org (=?utf-8?b?SWduYXMgQnJhxaFpxaFraXM=?=) Date: Tue, 20 Nov 2018 22:46:27 +0000 Subject: [issue35285] Make Proactor api extensible for reasonably any file handle Message-ID: <1542753987.17.0.788709270274.issue35285@psf.upfronthosting.co.za> New submission from Ignas Bra?i?kis : There was old issue (https://bugs.python.org/issue30539) requesting extension ability at proactor loop for third party libraries. It was rejected as it was asking to broad functionality and not particular api. This issue purpose is to discuss more concrete api needed to bring proactor functionally at least on par with selector. While loop covers most valid cases it still has no ability to run any third party libraries with file descriptors. As a consequence there is workarounds with unofficial api and handle wrappers to expose and call private proactor methods (https://github.com/m-labs/asyncserial/blob/master/asyncserial/asyncserial.py#L172). Selector basically has the following api: loop.add_reader(fd, callback, *args) loop.remove_reader(fd) loop.add_writer(fd, callback, *args) loop.remove_writer(fd) Nature of selector makes it easy for user to provide those operations on descriptor: make read from when it is available or make write from somewhere when you can also cancel operation. Proactor on the other hand need to be told what and where to copy, and run callback when it's done (probably with error, also buffer passed to callback ???). It also needs to have ability to cancel operations. One possibility of such api could look like this: loop.start_read_operation(fd, buffer, done_callback, *args) where done_callback = function(buffer, bytes_read, error) loop.cancel_read_operation(fd, operation) loop.start_write_operation(fd, buffer, done_callback, *args) where done_callback = function(bytes_written, error) loop.cancel_write_operation(fd, operation) There probably can be a plenty refinement here to the naming buffer, or callback workings, but in general there should be start and cancel operations. This api might even be implemented for selectors (selectors might imitate behaviour with custom writer), thought probably it this usage might be discouraged in favour of add_writer/reader logic. As examples of this api besides IOCP (which is implementation in question here) there is linux aio (http://man7.org/linux/man-pages/man2/io_submit.2.html) api which uses similar proactor concepts. This api obviously can be wrapped to higher level api with futures, but this probably should remain low level functionality where it is responsibility of library implementer to do right thing. Usage is pretty limited here: mainly writing file descriptors and devices/ttys asynchronously on Win32 platform. Python itself is not exactly systems programming language, but it convenient for accessing some OS features. Sockets and pipes are covered by standard library. But still if could prevent plenty of hacks and give library writers and odd few users place to hang on. ---------- components: asyncio messages: 330160 nosy: Ignas Bra?i?kis, asvetlov, yselivanov priority: normal severity: normal status: open title: Make Proactor api extensible for reasonably any file handle type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:46:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 22:46:28 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542753988.5.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a new PR 10624: * move "#ifndef Py_LIMITED_API" code to a new unstable/objimpl.h header file * Include/unstable/ files (Include/unstable/objimpl.h) are no longer prefixed with "unstable_". Include/unstable/ directory must not be added to the search paths for headers (gcc -I Include/unstable/). unstable/objimpl.h must not be included directly: it fails with a compiler error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:53:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 22:53:57 +0000 Subject: [issue35134] Move !Py_LIMITED_API to Include/pycapi/ In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542754437.65.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: I propose the following organization: * Include/*.h should be the "stable API" * Include/unstable/*.h is the "unstable API" (if Py_LIMITED_API is *not* defined at all) * Include/internal/pycore_*.h is the "internal" API It should become easier to see what is exposed or not to the stable ABI just by looking at Include.*.h. It should also become easier to spot in a review when a pull request something to the stable ABI, whereas it should be added to the unstable or internal API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 17:54:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 22:54:57 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542754497.94.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Move !Py_LIMITED_API to Include/pycapi/ -> Add a new Include/unstable/ subdirectory for the "unstable" API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 18:18:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 23:18:11 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542755891.18.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 18:20:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 23:20:10 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542756010.5.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: Stefan Behnel: > Making _PyGC_FINALIZED() internal broke Cython (https://github.com/cython/cython/issues/2721). It's used in the finaliser implementation (https://github.com/cython/cython/blob/da657c8e326a419cde8ae6ea91be9661b9622504/Cython/Compiler/ModuleNode.py#L1442-L1456), to determine if an object for which tp_dealloc() is called has already been finalised or whether we have to do it. I'm not sure how to deal with this on our side now. Any clue? I wrote PR 10626 to add _PyGC_FINALIZED() back to the C API. My intent was only to remove _PyObject_GC_TRACK(o) and _PyObject_GC_UNTRACK(o) from the public C API. I didn't expect that anyone would use _PyGC_FINALIZED() :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 18:43:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 23:43:15 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542757395.11.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 3e21ad1a254cc33e8d4920ad7f026254ec728bee by Victor Stinner in branch 'master': bpo-35081: Move _PyGC_FINALIZED() back to C API (GH-10626) https://github.com/python/cpython/commit/3e21ad1a254cc33e8d4920ad7f026254ec728bee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 18:55:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Nov 2018 23:55:32 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542758132.02.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Just to avoid the risk of name conflict, would it make sense to rename "unstable" to "pyunstable" or something else with "py" inside? I'm not sure if #include "unstable/objimpl.h" first looks the same directory than the header file that does the include? Note: I tested "make install" and I get a /opt/py38/include/python3.8dm/unstable/ directory which contains a single file (yet): objimpl.h. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 19:29:52 2018 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Nov 2018 00:29:52 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1542760192.51.0.788709270274.issue34977@psf.upfronthosting.co.za> Steve Dower added the comment: For people watching the bug, this is ready for review. Most of the change is adding a "layout" script (roughly the equivalent of "make install" for Windows, but with more flexibility to generate different structures, precompile stuff, etc.) About the only CPython change is to venv. I added a new launcher variation that looks for pyvenv.cfg and runs the python.exe listed in that, so now we don't have to copy any DLLs into the venv at all (it's needed because the old one would try to LoadLibrary DLLs inside the store package, which is not allowed, but it also fixes my #1 complaint about venv which is that upgrading the base Python breaks all venvs). There are also a few tweaks to the startup process, including extending the existing __PYVENV_LAUNCHER__ env variable from macOS to Windows as well, though it's handled in a different location. And a couple of minor tweaks to tests - issues discovered now that it's pretty easy to generate a "real" layout to run tests in. I can break this up into a couple of PRs if that's preferred, though it doesn't really gain anything. If you're not interested in the new layout script, stop reading the PR after you finish launcher.c :) ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 19:53:53 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 21 Nov 2018 00:53:53 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542761633.94.0.788709270274.issue35273@psf.upfronthosting.co.za> Josh Rosenberg added the comment: The "bug" is the expected behavior for 2.7, as previously noted, and does not exist on Python 3 (where list comprehensions follow the same rules as generator expressions for scoping), where NameErrors are raised consistently. ---------- nosy: +josh.r resolution: -> not a bug versions: +Python 2.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 20:20:30 2018 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Nov 2018 01:20:30 +0000 Subject: [issue35278] [security] directory traversal in tempfile prefix In-Reply-To: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> Message-ID: <1542763230.53.0.788709270274.issue35278@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9875 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 20:35:03 2018 From: report at bugs.python.org (Tomasz Jezierski) Date: Wed, 21 Nov 2018 01:35:03 +0000 Subject: [issue35278] [security] directory traversal in tempfile prefix In-Reply-To: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> Message-ID: <1542764103.23.0.788709270274.issue35278@psf.upfronthosting.co.za> Tomasz Jezierski added the comment: Hello, I have created patch and MR for the Python 3.8 "exception" approach. For the reference here is patch for ruby: https://github.com/ruby/ruby/commit/e9ddf2ba41a0bffe1047e33576affd48808c5d0b Maybe we should consider also validation on suffix as in their solution? ---------- nosy: +thorleon Added file: https://bugs.python.org/file47939/bpo-35278.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 20 23:25:07 2018 From: report at bugs.python.org (Sergei Zobov) Date: Wed, 21 Nov 2018 04:25:07 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542774307.46.0.788709270274.issue35242@psf.upfronthosting.co.za> Sergei Zobov added the comment: Yes, I've missed that the daemonic thread won't work if the parent process finished. The similarities between multiprocessing and threading modules are confusing a bit. Anyway, could I make a patch to fix the problem with the silently ignored exception and the broken semaphore? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 01:24:35 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 21 Nov 2018 06:24:35 +0000 Subject: [issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__ In-Reply-To: <1539668705.97.0.788709270274.issue34995@psf.upfronthosting.co.za> Message-ID: <1542781475.82.0.788709270274.issue34995@psf.upfronthosting.co.za> INADA Naoki added the comment: My personal opinion is: support abstractmethod only when the descriptor is useful for define interface with ABC. In case of cached_property, it's not. It is just a property as interface level. Caching is just an implementation. In case of update_wrapper, it's too generic. A decorated function may be used while define interface, but it's a rare case. So no need to support it. In case of singledispatch, I think it is not used in ABC, like cached_property. But it has shipped in Python already. We shouldn't remove it easily. In case of partialmethod... it's considerable. I don't use ABC much, and I never use partialmethod. So this example is very artificial. class MyABC(abc.ABC): @abstractmethod def set_foo(self, v): pass reset_foo = partialmethod(set_foo, None) When they subclass of MyABC, they need to override both of `set_foo` and `reset_foo`. Otherwise, reset_foo is bound to MyABC.set_foo, not subclass' one. So __isabstractmethod__ support in partialmethod is not just a "commet as a code". On the other hand, this example can be written as: class MyABC(abc.ABC): @abstractmethod def set_foo(self, v): pass @abstractmethod def reset_foo(self): pass Or it can use lazy binding too: class MyABC(abc.ABC): @abstractmethod def set_foo(self, v): pass # No need to override if default implementation is OK def reset_foo(self): self.set_foo(None) I am not sure __isabstractmethod__ support in partialmethod is really useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:15:29 2018 From: report at bugs.python.org (Boris Yang) Date: Wed, 21 Nov 2018 07:15:29 +0000 Subject: [issue35289] wrong result for difflib.SequenceMatcher Message-ID: <1542784529.35.0.788709270274.issue35289@psf.upfronthosting.co.za> New submission from Boris Yang : How to repeat: # -*- coding: UTF-8 -*- from difflib import SequenceMatcher seqMatcher = SequenceMatcher(None, "????", "????") seqMatcher.get_matching_blocks() Expect Result: [Match(a=0, b=3, size=2), Match(a=2, b=0, size=2), Match(a=5, b=5, size=0)] Current Result: [Match(a=0, b=3, size=2), Match(a=5, b=5, size=0)] ---------- messages: 330175 nosy: Boris Yang priority: normal severity: normal status: open title: wrong result for difflib.SequenceMatcher type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:16:16 2018 From: report at bugs.python.org (Boris Yang) Date: Wed, 21 Nov 2018 07:16:16 +0000 Subject: [issue35288] wrong result for difflib.SequenceMatcher Message-ID: <1542784576.57.0.788709270274.issue35288@psf.upfronthosting.co.za> Change by Boris Yang : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:16:33 2018 From: report at bugs.python.org (Boris Yang) Date: Wed, 21 Nov 2018 07:16:33 +0000 Subject: [issue35289] wrong result for difflib.SequenceMatcher In-Reply-To: <1542784529.35.0.788709270274.issue35289@psf.upfronthosting.co.za> Message-ID: <1542784593.68.0.788709270274.issue35289@psf.upfronthosting.co.za> Change by Boris Yang : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:16:49 2018 From: report at bugs.python.org (Boris Yang) Date: Wed, 21 Nov 2018 07:16:49 +0000 Subject: [issue35287] wrong result for difflib.SequenceMatcher Message-ID: <1542784609.96.0.788709270274.issue35287@psf.upfronthosting.co.za> Change by Boris Yang : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:49:25 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 21 Nov 2018 07:49:25 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542786565.94.0.788709270274.issue35221@psf.upfronthosting.co.za> Julien Palard added the comment: Hi Raymond, I'm mentionning I've spotted the issue in my class just to say "it happen that newcomers don't get it, I've seen it". As I've seen it I want to fix it. I don't want to fix it only in my course (it does not scale) I want to fix it for everybody. So what I'm trying to do in this issue (same with https://bugs.python.org/issue35200), is to ease the learning of newcomers *not* taking a course, those only relying on the official tutorial and documentation. I don't have numbers, but I don't think all Python newcomers are taking Python courses, some are relying to tutorials (maybe our tutorial?) and the doc. I just added a sentense in the linked PR (https://github.com/python/cpython/pull/10604/files), as Lisa said it should be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:51:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 07:51:19 +0000 Subject: [issue15245] ast.literal_eval fails on some literals In-Reply-To: <1341346286.65.0.729285382693.issue15245@psf.upfronthosting.co.za> Message-ID: <1542786679.88.0.788709270274.issue15245@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:57:50 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 07:57:50 +0000 Subject: [issue35286] wrong result for difflib.SequenceMatcher Message-ID: <1542787070.56.0.788709270274.issue35286@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The "expected result" listed isn't a valid output for get_matching_blocks() which is documented to return "triples are monotonically increasing in i and j". In your example, the "a" sequence is increasing: 0, 2, 5 but the "b" sequence is not monotonic: 3 0 5. SequenceMatcher.get_matching_blocks() isn't designed to locate swapped blocks from "abcd" to "cdab". ---------- status: -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:58:08 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 07:58:08 +0000 Subject: [issue35286] wrong result for difflib.SequenceMatcher Message-ID: <1542787088.67.0.788709270274.issue35286@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- status: pending -> open Removed message: https://bugs.python.org/msg330178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 02:58:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 07:58:48 +0000 Subject: [issue32892] Remove specific constant AST types in favor of ast.Constant In-Reply-To: <1519204597.27.0.467229070634.issue32892@psf.upfronthosting.co.za> Message-ID: <1542787128.58.0.788709270274.issue32892@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Chameleon has been fixed. Genshi needs more work (seems it has issues with 3.7 too). There are other third-party projects broken after this change, but it is not hard to fix them. Closed this issue. Open new issues for new problems. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:00:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:00:59 +0000 Subject: [issue24828] Segfault when using store-context AST node in a load context In-Reply-To: <1439042614.34.0.045626812152.issue24828@psf.upfronthosting.co.za> Message-ID: <1542787259.43.0.788709270274.issue24828@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:13:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:13:34 +0000 Subject: [issue33416] Add endline and endcolumn to every AST node In-Reply-To: <1525342525.55.0.682650639539.issue33416@psf.upfronthosting.co.za> Message-ID: <1542788014.78.0.788709270274.issue33416@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I like this. This can help to generate more meaningful error messages at compile and run time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:30:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:30:59 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1542789059.82.0.788709270274.issue33211@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Sorry, I forgot about this issue and independently made similar changes in issue34876. Please rebase your PR and determine whether it contains any useful changes in comparison with the current code (maybe new non-duplicated tests or useful refactoring?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:33:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:33:49 +0000 Subject: [issue32894] AST unparsing of infinity numbers In-Reply-To: <1519215659.19.0.467229070634.issue32894@psf.upfronthosting.co.za> Message-ID: <1542789229.21.0.788709270274.issue32894@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:39:07 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:39:07 +0000 Subject: [issue35200] Make the half-open range behaviour easier to teach In-Reply-To: <1541780751.51.0.788709270274.issue35200@psf.upfronthosting.co.za> Message-ID: <1542789547.36.0.788709270274.issue35200@psf.upfronthosting.co.za> Raymond Hettinger added the comment: As a teacher, I think the proposal makes us worst off. It is far easier and more useful at the interactive prompt to use list() rather than print() to show ranges: >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(range(2, 10)) [2, 3, 4, 5, 6, 7, 8, 9] >>> list(range(2, 10, 3)) [2, 5, 8] If you do the same thing with print(), it takes an additional character ("print" vs "list"), it creates a new source of confusion (str vs repr), and it doesn't generalize to other iterators like enumerate(), reversed(), and generators. Also, the various ideas listed for a possible new __str__ are all awkward or mysterious for some inputs (empty ranges, short ranges, etc). FWIW, I teach this topic every week. Presenting with list(range(...)) is less convenient than with the Python 2.7 version, but it works out just fine in practice and nicely sets the stage for covering set(iterable), tuple(iterable), dict.fromkeys(iterable), etc. I'm opposed the this proposal because I think it will create more teaching difficulties than it solves. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:40:16 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:40:16 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542789616.66.0.788709270274.issue35221@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset d936a8f8e0964de1147656f1435532f0170f8b6c by Raymond Hettinger (Julien Palard) in branch 'master': bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) https://github.com/python/cpython/commit/d936a8f8e0964de1147656f1435532f0170f8b6c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:40:21 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 08:40:21 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542789621.25.0.788709270274.issue35221@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:40:28 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 08:40:28 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542789628.05.0.788709270274.issue35221@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:44:56 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:44:56 +0000 Subject: [issue33416] Add endline and endcolumn to every AST node In-Reply-To: <1525342525.55.0.682650639539.issue33416@psf.upfronthosting.co.za> Message-ID: <1542789896.25.0.788709270274.issue33416@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:46:22 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:46:22 +0000 Subject: [issue35273] 'eval' in generator expression behave different in dict from list In-Reply-To: <1542608659.0.0.788709270274.issue35273@psf.upfronthosting.co.za> Message-ID: <1542789982.42.0.788709270274.issue35273@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:47:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:47:50 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1542790070.55.0.788709270274.issue31241@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:48:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:48:36 +0000 Subject: [issue31115] Py3.6 threading/reference counting issues with `numexpr` In-Reply-To: <1501794289.11.0.944319221721.issue31115@psf.upfronthosting.co.za> Message-ID: <1542790116.77.0.788709270274.issue31115@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:48:46 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:48:46 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542790126.41.0.788709270274.issue35221@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 7af2144e558a0268b1aa20bb88046716c89f987d by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10630) https://github.com/python/cpython/commit/7af2144e558a0268b1aa20bb88046716c89f987d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:48:59 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:48:59 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542790139.65.0.788709270274.issue35221@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset d170e594b2736c579d12b96b129a8e58975a9c0a by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10629) https://github.com/python/cpython/commit/d170e594b2736c579d12b96b129a8e58975a9c0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:50:33 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 08:50:33 +0000 Subject: [issue29205] col_offset for AsyncFunctionDef AST nodes is wrong In-Reply-To: <1483874960.49.0.58571949289.issue29205@psf.upfronthosting.co.za> Message-ID: <1542790233.13.0.788709270274.issue29205@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is this issue fixed? Are backports needed? I can't reproduce the issue on master and 3.7, but can reproduce it on 3.6. ---------- nosy: +benjamin.peterson, serhiy.storchaka versions: -Python 3.5, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 03:51:40 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:51:40 +0000 Subject: [issue35221] Enhance venv activate commands readability In-Reply-To: <1542059874.69.0.788709270274.issue35221@psf.upfronthosting.co.za> Message-ID: <1542790300.94.0.788709270274.issue35221@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 04:51:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 09:51:33 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542793893.91.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: Please review PR 10624 of bpo-35134: Create Include/unstable/ subdirectory. It's the second part of my plan :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 05:12:19 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 21 Nov 2018 10:12:19 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542795139.5.0.788709270274.issue35242@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for reporting this. This sounds like an extreme corner case and I'm not sure how easy it will be to fix. For the record, nowadays concurrent.futures should have more graceful behaviour in the face of errors. Though there probably always will be corner cases like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 05:49:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 10:49:52 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot Message-ID: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> New submission from STINNER Victor : It seems like the commit 02e6bf7f2025cddcbde6432f6b6396198ab313f4 (bpo-28604) broke test_c_locale_coercion on FreeBSD CURRENT Shared 3.x: https://buildbot.python.org/all/#/builders/168/builds/247 0:19:33 load avg: 7.69 [401/419/2] test_c_locale_coercion failed -- running: test_decimal (40 sec 626 ms), test_lib2to3 (2 min 3 sec) test_external_target_locale_configuration (test.test_c_locale_coercion.LocaleConfigurationTests) ... ok test_LC_ALL_set_to_C (test.test_c_locale_coercion.LocaleCoercionTests) ... ok test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) ... test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) ... test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) ... test_PYTHONCOERCECLOCALE_set_to_zero (test.test_c_locale_coercion.LocaleCoercionTests) ... ok ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE=None) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE=None) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE=None) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE=None) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE=None) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE='') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE='') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE='') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE='1') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE='1') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE='1') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='1') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='1') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE='true') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE='true') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE='true') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='true') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='true') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE='false') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE='false') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE='false') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='false') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='false') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) (default_locale=True, PYTHONCOERCECLOCALE='warn') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 341, in _check_c_locale_coercion self._check_child_encoding_details(base_var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='C', PYTHONCOERCECLOCALE='warn') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[131 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'c', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='C', PYTHONCOERCECLOCALE='warn') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LANG', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='warn') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[143 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': 'invalid.ascii', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ====================================================================== FAIL: test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) (env_var='LC_CTYPE', nominal_locale='invalid.ascii', PYTHONCOERCECLOCALE='warn') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 356, in _check_c_locale_coercion self._check_child_encoding_details(var_dict, File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_c_locale_coercion.py", line 231, in _check_child_encoding_details self.assertEqual(encoding_details, expected_details) AssertionError: {'fsencoding': 'ascii', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} != {'fsencoding': 'utf-8', 'stdin_info': 'utf-8:surrogateesc[130 chars]: ''} - {'fsencoding': 'ascii', ? ^^^^^ + {'fsencoding': 'utf-8', ? ^^^^^ 'lang': '', 'lc_all': '', 'lc_ctype': 'c.utf-8', 'stderr_info': 'utf-8:backslashreplace', 'stdin_info': 'utf-8:surrogateescape', 'stdout_info': 'utf-8:surrogateescape'} ---------------------------------------------------------------------- Ran 6 tests in 6.205s FAILED (failures=30) test test_c_locale_coercion failed ---------- components: Interpreter Core messages: 330189 nosy: vstinner priority: normal severity: normal status: open title: [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 05:52:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 10:52:24 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542797544.5.0.788709270274.issue35290@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9879 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 06:21:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 11:21:32 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542799292.23.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7c2d5702d11b41dd9a2391e6813fbaef5dbda79a by Victor Stinner in branch 'master': bpo-35290: Add debug info to test_c_locale_coercion (GH-10631) https://github.com/python/cpython/commit/7c2d5702d11b41dd9a2391e6813fbaef5dbda79a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 06:26:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 11:26:12 +0000 Subject: [issue28604] Exception raised by python3.5 when using en_GB locale In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1542799572.9.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like my change introduced a regression: bpo-35290. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 06:51:33 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 21 Nov 2018 11:51:33 +0000 Subject: [issue25439] Add type checks to urllib.request.Request In-Reply-To: <1445247083.91.0.927080887762.issue25439@psf.upfronthosting.co.za> Message-ID: <1542801093.19.0.788709270274.issue25439@psf.upfronthosting.co.za> Sanyam Khurana added the comment: PR is up for a review: https://github.com/python/cpython/pull/10616 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 06:55:03 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 21 Nov 2018 11:55:03 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542801303.42.0.788709270274.issue21314@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Noah, are you working on this? ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:00:28 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 21 Nov 2018 12:00:28 +0000 Subject: [issue20504] cgi.FieldStorage, multipart, missing Content-Length In-Reply-To: <1391463199.17.0.394387661768.issue20504@psf.upfronthosting.co.za> Message-ID: <1542801628.21.0.788709270274.issue20504@psf.upfronthosting.co.za> Change by Pierre Quentel : ---------- nosy: +quentel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:10:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 12:10:03 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1542802203.92.0.788709270274.issue31241@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9880 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:20:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 12:20:29 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1542802829.88.0.788709270274.issue31241@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: For list comprehensions and generator expressions this is definitely a bug. But tuples syntax technically does not include surrounded parentheses. There is also a problem with generator expression passes as a single argument. Generator expression parentheses can be collapsed with function call parentheses: f(a for a in b). PR 10633 makes the following changes: * Fixes position for list comprehensions and generator expressions. * If generator expression parentheses are be collapsed with function call parentheses, the position of the AST node for the generator expression points to the left parenthesis. * For tuples surrounded with parentheses, the position of the AST node points to the left brace. For tuples without parentheses, it points to the position of the first tuple item. I am not sure whether these changes should be backported to maintained versions. ---------- nosy: +benjamin.peterson, brett.cannon, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:27:32 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 21 Nov 2018 12:27:32 +0000 Subject: [issue20504] cgi.FieldStorage, multipart, missing Content-Length In-Reply-To: <1391463199.17.0.394387661768.issue20504@psf.upfronthosting.co.za> Message-ID: <1542803252.24.0.788709270274.issue20504@psf.upfronthosting.co.za> Change by Pierre Quentel : ---------- pull_requests: +9881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:36:47 2018 From: report at bugs.python.org (Sergei Zobov) Date: Wed, 21 Nov 2018 12:36:47 +0000 Subject: [issue35242] multiprocessing.Queue in an inconsistent state and a traceback silently suppressed if put an unpickable object and process's target function is finished In-Reply-To: <1542173181.91.0.788709270274.issue35242@psf.upfronthosting.co.za> Message-ID: <1542803807.46.0.788709270274.issue35242@psf.upfronthosting.co.za> Sergei Zobov added the comment: Thanks for answer, Antoine! I see what you mean, but I'm not sure that it's so extreme corner case. We are speaking about Python and it's easy to create an put an unpickable object into queue. I apologize for the persistence, but I just want make this case more friendly to user. I spent plenty of time to debug it and I think it would be better to prevent someone to do the same things. If it's a difficult to fix, we can at least write a note somewhere in multiprocessing module doc to describe this behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:41:14 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:41:14 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542804074.03.0.788709270274.issue35035@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 361e8683e7340c600b22f4a514b81448ccec66dc by Julien Palard (Zhiming Wang) in branch 'master': bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) https://github.com/python/cpython/commit/361e8683e7340c600b22f4a514b81448ccec66dc ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:41:21 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 12:41:21 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542804081.34.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:41:30 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 12:41:30 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542804090.74.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:45:50 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Wed, 21 Nov 2018 12:45:50 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1542804350.12.0.788709270274.issue35227@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:48:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 12:48:59 +0000 Subject: [issue26415] Excessive peak memory consumption by the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1542804539.32.0.788709270274.issue26415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you mind to create a pull request for reviewing? I can not promise that it will be merged, but it will have a chance. For reference, the article about this patch (on Russian): https://habr.com/post/314062/ . ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:51:30 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:51:30 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542804690.81.0.788709270274.issue35035@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 27c16e33b1acac55641a27faa5a11508ee605adc by Julien Palard (Miss Islington (bot)) in branch '3.6': bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) https://github.com/python/cpython/commit/27c16e33b1acac55641a27faa5a11508ee605adc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 07:54:19 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:54:19 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542804859.97.0.788709270274.issue35035@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 3b7258a5a5fddc6c46f71a89b7c8ce89f4b79641 by Julien Palard (Miss Islington (bot)) in branch '3.7': [3.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) https://github.com/python/cpython/commit/3b7258a5a5fddc6c46f71a89b7c8ce89f4b79641 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 08:06:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 13:06:36 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1542805596.92.0.788709270274.issue17490@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Nick, do you mind to create a PR for new tests? Some additional tests were added since this issue was created. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 08:14:27 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 21 Nov 2018 13:14:27 +0000 Subject: [issue26415] Excessive peak memory consumption by the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1542806067.63.0.788709270274.issue26415@psf.upfronthosting.co.za> Change by Giampaolo Rodola' : ---------- nosy: -giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 08:23:17 2018 From: report at bugs.python.org (Windson Yang) Date: Wed, 21 Nov 2018 13:23:17 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1542806597.21.0.788709270274.issue35131@psf.upfronthosting.co.za> Windson Yang added the comment: I will fix this issue after we have consensus with the future of .pth file in #33944 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 08:24:21 2018 From: report at bugs.python.org (Windson Yang) Date: Wed, 21 Nov 2018 13:24:21 +0000 Subject: [issue35267] reproducible deadlock with multiprocessing.Pool In-Reply-To: <1542416799.14.0.788709270274.issue35267@psf.upfronthosting.co.za> Message-ID: <1542806661.22.0.788709270274.issue35267@psf.upfronthosting.co.za> Windson Yang added the comment: I will work on it if no one wants to create a PR for this next week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 08:26:44 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Wed, 21 Nov 2018 13:26:44 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1542806804.29.0.788709270274.issue35227@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: Adding this API would require to provide a way to set file status like mode, uid, gid, mtime, type, linkname, uname and gname. Adding a new argument to gettarinfo looks weird to me, adding a new method may be better. I will try to propose a working implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 09:23:10 2018 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Nov 2018 14:23:10 +0000 Subject: [issue32894] AST unparsing of infinity numbers In-Reply-To: <1519215659.19.0.467229070634.issue32894@psf.upfronthosting.co.za> Message-ID: <1542810190.05.0.788709270274.issue32894@psf.upfronthosting.co.za> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 09:24:47 2018 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Wed, 21 Nov 2018 14:24:47 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1542810287.15.0.788709270274.issue35227@psf.upfronthosting.co.za> Micha? G?rny added the comment: > Adding this API would require to provide a way to set file status like mode, uid, gid, mtime, type, linkname, uname and gname. That's why I mentioned addfile() -- it takes TarInfo object for that purpose. I suppose the new function should have the same parameters, except it would set size in the TarInfo instance instead of getting it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 09:36:43 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Wed, 21 Nov 2018 14:36:43 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1542811003.48.0.788709270274.issue35227@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: Yes, but in the same way that there is the add method to conveniently build the TarInfo object for the user, shouldn't we provide a new convenience method to TarFile to support this (in addition to modifying TarInfo)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 09:49:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 14:49:23 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542811763.42.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 10:12:33 2018 From: report at bugs.python.org (Jason Madden) Date: Wed, 21 Nov 2018 15:12:33 +0000 Subject: [issue35291] duplicate of memoryview from io.BufferedWriter leaks Message-ID: <1542813152.98.0.788709270274.issue35291@psf.upfronthosting.co.za> New submission from Jason Madden : Using Python 2.7.15, if a BufferedWriter wraps an IO object that duplicates the memoryview passed to the IO object's `write` method, that memoryview leaks. This script demonstrates the problem by leaking a memoryview for each iteration of the loop (if the `flush` is skipped, the leaks are less frequent but still occur): ``` from __future__ import print_function import io import gc def count_memoryview(): result = 0 for x in gc.get_objects(): if type(x) is memoryview: result += 1 return result class FileLike(object): closed = False def writable(self): return True def write(self, data): memoryview(data) # XXX: This causes the problem return len(data) bf = io.BufferedWriter(FileLike()) i = 0 memoryview_count = 0 while True: if i == 0 or i % 100 == 0: # This reports 100 new memoryview objects each time old = memoryview_count new = count_memoryview() print(i, "memoryview", new, "+%s" % (new - old)) memoryview_count = new bf.write(b"test") bf.flush() i += 1 ``` The leak can also be observed using the operating system's memory monitoring tools for the process (seen on both Fedora and macOS). Commenting out the line in `FileLike.write` that makes a duplicate memoryview of the given buffer solves the leak. Deleting the BufferedWriter doesn't appear to reclaim the leaked memoryviews. I can't duplicate this in Python 3.4 or above. Originally reported to gevent in https://github.com/gevent/gevent/issues/1318 Possibly related to Issue 26720 and Issue 15994 ---------- components: IO messages: 330206 nosy: jmadden priority: normal severity: normal status: open title: duplicate of memoryview from io.BufferedWriter leaks versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 10:26:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Nov 2018 15:26:14 +0000 Subject: [issue33416] Add endline and endcolumn to every AST node In-Reply-To: <1525342525.55.0.682650639539.issue33416@psf.upfronthosting.co.za> Message-ID: <1542813974.69.0.788709270274.issue33416@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This may be a duplicate of issue22616. See also issue16795, issue21295, issue33211, issue34876. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 10:33:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 15:33:18 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542814398.73.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset aac1f81eef971876ba5b1673db9ce6620311c469 by Victor Stinner in branch 'master': bpo-35189: Fix eintr_tester.py (GH-10637) https://github.com/python/cpython/commit/aac1f81eef971876ba5b1673db9ce6620311c469 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 11:53:23 2018 From: report at bugs.python.org (Noah Haasis) Date: Wed, 21 Nov 2018 16:53:23 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542819203.92.0.788709270274.issue21314@psf.upfronthosting.co.za> Noah Haasis added the comment: I don?t have the time right now. Feel free to work on it! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 11:54:58 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 21 Nov 2018 16:54:58 +0000 Subject: [issue20504] cgi.FieldStorage, multipart, missing Content-Length In-Reply-To: <1391463199.17.0.394387661768.issue20504@psf.upfronthosting.co.za> Message-ID: <1542819298.82.0.788709270274.issue20504@psf.upfronthosting.co.za> Change by Pierre Quentel : ---------- pull_requests: +9885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 12:12:56 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 21 Nov 2018 17:12:56 +0000 Subject: [issue20504] cgi.FieldStorage, multipart, missing Content-Length In-Reply-To: <1391463199.17.0.394387661768.issue20504@psf.upfronthosting.co.za> Message-ID: <1542820376.56.0.788709270274.issue20504@psf.upfronthosting.co.za> Pierre Quentel added the comment: I have submitted PR #10638 to fix this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 12:19:07 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 17:19:07 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1542820747.96.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: My private test suite for locales: https://github.com/vstinner/misc/blob/master/python/test_all_locales.py Since each platform uses a different locale database, it's hard to write reliable portable and future-proof tests :-( My tests only work on specific Windows, macOS, FreeBSD and Linux versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 12:41:40 2018 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Nov 2018 17:41:40 +0000 Subject: [issue35292] Make SimpleHTTPRequestHandler load mimetypes lazily Message-ID: <1542822100.42.0.788709270274.issue35292@psf.upfronthosting.co.za> New submission from Steve Dower : Importing http.server triggers mimetypes.init(), which can be fairly expensive on Windows (and potentially other platforms?) due to having to enumerate a lot of registry keys. Instead, SimpleHTTPRequestHandler.extensions_map can be a dict with just its default values in lib/http/server.py and the first call to guess_type() can initialize mimetypes if necessary. We should check whether people read from SimpleHTTPRequestHandler.extensions_map directly before calling guess_type(), and decide how quickly we can make the change. My gut feeling is we will be okay to make this in the next release but probably shouldn't backport it. ---------- components: Library (Lib), Windows keywords: easy messages: 330212 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Make SimpleHTTPRequestHandler load mimetypes lazily type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 14:21:45 2018 From: report at bugs.python.org (Aaron Meurer) Date: Wed, 21 Nov 2018 19:21:45 +0000 Subject: [issue33899] Tokenize module does not mirror "end-of-input" is newline behavior In-Reply-To: <1529394112.27.0.56676864532.issue33899@psf.upfronthosting.co.za> Message-ID: <1542828105.96.0.788709270274.issue33899@psf.upfronthosting.co.za> Aaron Meurer added the comment: Is it expected behavior that comments produce NEWLINE if they don't have a newline and don't produce NEWLINE if they do (that is, '# comment' produces NEWLINE but '# comment\n' does not)? ---------- nosy: +asmeurer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 15:02:26 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 21 Nov 2018 20:02:26 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542830546.52.0.788709270274.issue24746@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +9886 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 15:02:29 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 21 Nov 2018 20:02:29 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542830549.5.0.788709270274.issue24746@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +9886, 9887 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 15:05:30 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 21 Nov 2018 20:05:30 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542830730.65.0.788709270274.issue24746@psf.upfronthosting.co.za> Sanyam Khurana added the comment: > Unfortunately I was reminded a few days ago that there is a commit hook that prevents patches containing trailing whitespace from being committed to the repository. Is this still the case? I tried to figure out writing the test case, but I can't wrap my head around showing the trailing whitespace without putting it anywhere in the code. Also, can you have a look at the PR, please? ---------- nosy: +CuriousLearner stage: patch review -> test needed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 15:52:55 2018 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Nov 2018 20:52:55 +0000 Subject: [issue31115] Py3.6 threading/reference counting issues with `numexpr` In-Reply-To: <1501794289.11.0.944319221721.issue31115@psf.upfronthosting.co.za> Message-ID: <1542833575.0.0.788709270274.issue31115@psf.upfronthosting.co.za> Mark Dickinson added the comment: Judging by the current state of https://github.com/pydata/numexpr/issues/252, it does seem as though this is resolved downstream, so probably safe to close here. Robert: feel free to reopen if I misunderstood. ---------- nosy: +mark.dickinson stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:03:03 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 21 Nov 2018 21:03:03 +0000 Subject: [issue26415] Excessive peak memory consumption by the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1542834183.86.0.788709270274.issue26415@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:05:00 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 21 Nov 2018 21:05:00 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542834300.71.0.788709270274.issue35283@psf.upfronthosting.co.za> Brett Cannon added the comment: Care to open a PR to fix this? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:05:16 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 21 Nov 2018 21:05:16 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542834316.02.0.788709270274.issue35283@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:06:00 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 21 Nov 2018 21:06:00 +0000 Subject: [issue35284] Incomplete error handling in Python/compile.c:compiler_call() In-Reply-To: <1542753481.5.0.788709270274.issue35284@psf.upfronthosting.co.za> Message-ID: <1542834360.91.0.788709270274.issue35284@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- title: Incomplete error handling in the compiler's compiler_call() -> Incomplete error handling in Python/compile.c:compiler_call() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:10:07 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:10:07 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542834607.13.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:10:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:10:14 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542834614.11.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9888, 9889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:10:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:10:21 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542834621.12.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9888, 9889, 9890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:27:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:27:11 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings Message-ID: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> New submission from STINNER Victor : The following commands emits a lot of warnings: make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest # adapt PYTHON to point to Python 3.8 compiled in debug mmode Travis CI logs: https://travis-ci.org/python/cpython/jobs/458140641 make: Entering directory `/home/travis/build/python/cpython/Doc' ../python -m venv ./venv (...) The venv has been created in the ./venv directory make[1]: Entering directory `/home/travis/build/python/cpython/Doc' mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D latex_elements.papersize= -q -W -j4 -W . build/doctest /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/babel/localedata.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import MutableMapping /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/jinja2/runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Mapping /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/jinja2/sandbox.py:82: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import MutableSet, MutableMapping, MutableSequence /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/environment/__init__.py:340: RemovedInSphinx30Warning: env.versionchanges() is deprecated. Please use ChangeSetDomain instead. for version, changes in other.versionchanges.items(): /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/environment/__init__.py:341: RemovedInSphinx30Warning: env.versionchanges() is deprecated. Please use ChangeSetDomain instead. self.versionchanges.setdefault(version, []).extend( /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead. result = directive_instance.run() /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) :1: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly formatargspec(*getfullargspec(f)) :1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp obj dead or exiting /home/travis/build/python/cpython/Lib/socket.py:660: ResourceWarning: unclosed self._sock = None ResourceWarning: Enable tracemalloc to get the object allocation traceback make[1]: Leaving directory `/home/travis/build/python/cpython/Doc' make: Leaving directory `/home/travis/build/python/cpython/Doc' The command "if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then $XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest fi " exited with 0. ---------- components: Build messages: 330217 nosy: vstinner priority: normal severity: normal status: open title: make doctest (Sphinx) emits a lot of warnings versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:27:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:27:21 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1542835641.07.0.788709270274.issue35293@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +matrixise, mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:27:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 21:27:51 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542835671.58.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bcda8f1d42a98d9022736dd52d855be8e220fe15 by Victor Stinner in branch 'master': bpo-35081: Add Include/internal/pycore_object.h (GH-10640) https://github.com/python/cpython/commit/bcda8f1d42a98d9022736dd52d855be8e220fe15 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 16:31:32 2018 From: report at bugs.python.org (Dieter Maurer) Date: Wed, 21 Nov 2018 21:31:32 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542835892.56.0.788709270274.issue35283@psf.upfronthosting.co.za> Dieter Maurer added the comment: > Care to open a PR to fix this? I am not familiar with the "github" workflow. The fix is so trivial (add the "isAlive = is_alive" alias to "threading._DummyThread" and replace "isAlive" by "is_alive" in the docstring of "threading.Thread.join" that it does not seem worth to learn the "github" workflow just for this fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:06:35 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 21 Nov 2018 22:06:35 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542837995.31.0.788709270274.issue21314@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- keywords: +patch pull_requests: +9891 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:06:46 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 21 Nov 2018 22:06:46 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542838006.06.0.788709270274.issue21314@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- keywords: +patch, patch pull_requests: +9891, 9892 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:06:55 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 21 Nov 2018 22:06:55 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542838015.07.0.788709270274.issue21314@psf.upfronthosting.co.za> Change by Lysandros Nikolaou : ---------- keywords: +patch, patch, patch pull_requests: +9891, 9892, 9893 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:11:21 2018 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 21 Nov 2018 22:11:21 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1542838281.79.0.788709270274.issue21314@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: -yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:16:38 2018 From: report at bugs.python.org (Tim Peters) Date: Wed, 21 Nov 2018 22:16:38 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542838598.48.0.788709270274.issue24746@psf.upfronthosting.co.za> Tim Peters added the comment: To include trailing whitespace on a line in a doctest, _don't_ use raw strings. Use a regular string, and include add a (one or more) trailing \x20 instead of a space (for example). For example: r""" >>> print("a ") a """ where there's a space at the end of the output line is no good. It's visually impossible to tell what's intended, and the commit hook should reject it. But this works fine (a regular string and an escape code): """ >>> print("a ") a\x20 """ ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:16:48 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 21 Nov 2018 22:16:48 +0000 Subject: [issue28401] Don't support the PEP384 stable ABI in pydebug builds In-Reply-To: <1476034292.17.0.316209799179.issue28401@psf.upfronthosting.co.za> Message-ID: <1542838608.3.0.788709270274.issue28401@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the PR! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:17:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 22:17:14 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542838634.64.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:17:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 22:17:21 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542838641.53.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9894, 9895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:17:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 22:17:27 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542838647.57.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9894, 9895, 9896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:46:34 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 22:46:34 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542840394.02.0.788709270274.issue31146@psf.upfronthosting.co.za> miss-islington added the comment: New changeset df6374e15aadff7eb547fc210c0f4f28bbff7010 by Miss Islington (bot) in branch '3.7': bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) https://github.com/python/cpython/commit/df6374e15aadff7eb547fc210c0f4f28bbff7010 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:46:59 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 22:46:59 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542840419.75.0.788709270274.issue31146@psf.upfronthosting.co.za> miss-islington added the comment: New changeset c487cf9261c61f0db4e5d1df3c83a60384b330db by Miss Islington (bot) in branch '3.6': bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) https://github.com/python/cpython/commit/c487cf9261c61f0db4e5d1df3c83a60384b330db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:47:12 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Nov 2018 22:47:12 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542840432.7.0.788709270274.issue31146@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fcbcebadff46f907b38fcf2d79adb3209c5a205d by Miss Islington (bot) in branch '2.7': bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) https://github.com/python/cpython/commit/fcbcebadff46f907b38fcf2d79adb3209c5a205d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 17:53:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 22:53:46 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542840826.94.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f1d002c1e094922b0f17a820f90ff102d68ab253 by Victor Stinner in branch 'master': bpo-35059: Enhance _PyObject_AssertFailed() (GH-10642) https://github.com/python/cpython/commit/f1d002c1e094922b0f17a820f90ff102d68ab253 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 18:06:12 2018 From: report at bugs.python.org (Julien Palard) Date: Wed, 21 Nov 2018 23:06:12 +0000 Subject: [issue31146] Docs: On non-public translations, language picker fallback to "English" In-Reply-To: <1502206180.29.0.859774070814.issue31146@psf.upfronthosting.co.za> Message-ID: <1542841572.87.0.788709270274.issue31146@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 18:14:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 23:14:02 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542842042.9.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 18:14:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 23:14:06 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542842046.13.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9897, 9898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 18:14:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Nov 2018 23:14:10 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542842050.41.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9897, 9898, 9899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 19:02:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 00:02:59 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542844979.07.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 271753a27aca2e13275f0827080b915fb438107a by Victor Stinner in branch 'master': bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643) https://github.com/python/cpython/commit/271753a27aca2e13275f0827080b915fb438107a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 19:34:05 2018 From: report at bugs.python.org (Simon Ruggier) Date: Thu, 22 Nov 2018 00:34:05 +0000 Subject: [issue20309] Not all method descriptors are callable In-Reply-To: <1390200218.06.0.45732778516.issue20309@psf.upfronthosting.co.za> Message-ID: <1542846845.09.0.788709270274.issue20309@psf.upfronthosting.co.za> Simon Ruggier added the comment: I hit this problem today with what I'd consider a valid use case: I wanted to use a static method as a default argument to a function on the same class. Within the class definition context, automatic unwrapping of the staticmethod object doesn't occur, so the default value ends up not being callable unless the staticmethod object is manually, explicitly unwrapped via __func__. For those who prefer code to prose, I've attached example Python 2/3 code demonstrating what I mean. The workaround is pretty easy, but on the other hand, it also looks like it would also be pretty straightforward to facilitate this use case without forcing the author to learn about this distinction and manually unwrap the static method, and I think it makes sense to do that. ---------- nosy: +sruggier Added file: https://bugs.python.org/file47940/example_use_case.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 20:02:32 2018 From: report at bugs.python.org (Ruslan Dautkhanov) Date: Thu, 22 Nov 2018 01:02:32 +0000 Subject: [issue35294] Race condition involving SocketServer.TCPServer Message-ID: <1542848552.12.0.788709270274.issue35294@psf.upfronthosting.co.za> New submission from Ruslan Dautkhanov : We had a long discussion in https://issues.apache.org/jira/browse/SPARK-26019 regarding a race condition that happens around https://github.com/apache/spark/blob/master/python/pyspark/accumulators.py#L289 The fix I created here - https://github.com/apache/spark/pull/23113/files basically changes bind_and_activate to False in SocketServer.TCPServer.__init__'s call and manually doing self.server_bind() self.server_activate() self.serve_forever() in that thread instead of main thread. We have a fix, but we're not sure if this is a bug in Python with multithreading / handling SocketServer.TCPServer ? Thank you. ---------- components: IO, Library (Lib) messages: 330228 nosy: Ruslan Dautkhanov priority: normal severity: normal status: open title: Race condition involving SocketServer.TCPServer versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 20:03:01 2018 From: report at bugs.python.org (Ruslan Dautkhanov) Date: Thu, 22 Nov 2018 01:03:01 +0000 Subject: [issue35294] Race condition involving SocketServer.TCPServer In-Reply-To: <1542848552.12.0.788709270274.issue35294@psf.upfronthosting.co.za> Message-ID: <1542848581.5.0.788709270274.issue35294@psf.upfronthosting.co.za> Change by Ruslan Dautkhanov : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 20:38:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 01:38:32 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542850712.71.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 20:57:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 01:57:40 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542851860.89.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2ff8fb7639a86757c00a7cbbe7da418fffec3870 by Victor Stinner in branch 'master': bpo-35059: Add _PyObject_CAST() macro (GH-10645) https://github.com/python/cpython/commit/2ff8fb7639a86757c00a7cbbe7da418fffec3870 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 21:04:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 02:04:45 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542852285.43.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 21:14:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 02:14:11 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542852851.01.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 21 21:37:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 02:37:53 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542854273.58.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b37672daf61740fe1ff9d805f6d74bc5ef04012b by Victor Stinner in branch 'master': bpo-35059: Cleanup usage of Python macros (GH-10648) https://github.com/python/cpython/commit/b37672daf61740fe1ff9d805f6d74bc5ef04012b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 01:44:15 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 22 Nov 2018 06:44:15 +0000 Subject: [issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038 In-Reply-To: <1442517940.02.0.585598680273.issue25155@psf.upfronthosting.co.za> Message-ID: <1542869055.51.0.788709270274.issue25155@psf.upfronthosting.co.za> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: This bug is happening for 3.6 too. Please see below, 18:14 $ python --version Python 3.6.3 (upwork) ? ~/workspace/personal/assignment [master|?] 18:16 $ pip install --upgrade pip Exception: Traceback (most recent call last): File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/commands/install.py", line 324, in run requirement_set.prepare_files(finder) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/req/req_set.py", line 487, in _prepare_file req_to_install, finder) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/req/req_set.py", line 428, in _check_skip_installed req_to_install, upgrade_allowed) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement all_candidates = self.find_all_candidates(req.name) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates for page in self._get_pages(url_locations, project_name): File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages page = self._get_page(location) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/index.py", line 683, in _get_page return HTMLPage.get_page(link, session=self.session) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/index.py", line 792, in get_page "Cache-Control": "max-age=600", File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 488, in get return self.request('GET', url, **kwargs) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/download.py", line 386, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 475, in request resp = self.send(prep, **send_kwargs) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 596, in send r = adapter.send(request, **kwargs) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py", line 423, in send timeout=timeout File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 595, in urlopen chunked=chunked) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 363, in _make_request conn.request(method, url, **httplib_request_kw) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1026, in _send_output self.send(msg) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 964, in send self.connect() File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 167, in connect conn = self._new_conn() File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 142, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py", line 85, in create_connection sock.settimeout(timeout) OverflowError: timestamp too large to convert to C _PyTime_t You are using pip version 9.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 02:45:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 07:45:19 +0000 Subject: [issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038 In-Reply-To: <1442517940.02.0.585598680273.issue25155@psf.upfronthosting.co.za> Message-ID: <1542872719.19.0.788709270274.issue25155@psf.upfronthosting.co.za> STINNER Victor added the comment: Hi, """ This bug is happening for 3.6 too. Please see below, (...) File "/home/dtdev/virtual/upwork/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py", line 85, in create_connection sock.settimeout(timeout) OverflowError: timestamp too large to convert to C _PyTime_t """ This error is different: the error occurs on socket.socket.settimeout() and comes from urllib3, not from the Python standard library. You should report this traceback to urllib3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 02:51:16 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 22 Nov 2018 07:51:16 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1542873076.13.0.788709270274.issue35293@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: They are warnings related to third party packages used for doctest and some of them might become incompatible with https://github.com/python/cpython/pull/10596. Related discussion : issue35109 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 02:52:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 07:52:40 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542873160.95.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 02:53:26 2018 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 22 Nov 2018 07:53:26 +0000 Subject: [issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038 In-Reply-To: <1442517940.02.0.585598680273.issue25155@psf.upfronthosting.co.za> Message-ID: <1542873206.81.0.788709270274.issue25155@psf.upfronthosting.co.za> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: Yikes, Sorry for the spam. I should have double checked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 03:00:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 08:00:33 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1542873633.5.0.788709270274.issue35293@psf.upfronthosting.co.za> STINNER Victor added the comment: > They are warnings related to third party packages used for doctest and some of them might become incompatible with https://github.com/python/cpython/pull/10596. Related discussion : issue35109 We should help these packages to be fixed :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 03:37:27 2018 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Nov 2018 08:37:27 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1542875847.67.0.788709270274.issue35293@psf.upfronthosting.co.za> Dong-hee Na added the comment: Looks like they already fixed it. - jinja2: https://github.com/pallets/jinja/commit/31bf9b7e71c3fee3b7866ffdc0f70f4525a490d9 - babel: https://github.com/python-babel/babel/commit/65d6bf39f2a2b4bbbbc02cd1e00c44ce9d7c1c5b We should wait their release :) ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 03:57:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 08:57:13 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542877033.47.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 04:14:11 2018 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Nov 2018 09:14:11 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542878051.29.0.788709270274.issue35283@psf.upfronthosting.co.za> Dong-hee Na added the comment: Hi, Can I work with this issue if no one works on it? ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 04:20:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 09:20:16 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542878416.55.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: Result of the additional debug info, on the FreeBSD CURRENT buildbot: AVAILABLE_TARGETS = ['C.UTF-8'] EXPECTED_C_LOCALE_EQUIVALENTS = ['C', 'invalid.ascii'] EXPECTED_C_LOCALE_STREAM_ENCODING = 'ascii' EXPECTED_C_LOCALE_FS_ENCODING = 'ascii' EXPECT_COERCION_IN_DEFAULT_LOCALE = True _C_UTF8_LOCALES = ('C.UTF-8', 'C.utf8', 'UTF-8') _check_nl_langinfo_CODESET = True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 04:25:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 09:25:32 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542878732.89.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a42de742e7c20eeb64699b5785543fea65b2e8d3 by Victor Stinner in branch 'master': bpo-35059: Cast void* to PyObject* (GH-10650) https://github.com/python/cpython/commit/a42de742e7c20eeb64699b5785543fea65b2e8d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 04:46:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 09:46:23 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1542879983.35.0.788709270274.issue9566@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 05:04:06 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Thu, 22 Nov 2018 10:04:06 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542881046.29.0.788709270274.issue24746@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Thanks for your suggestion, Tim. I've fixed the patch and it is ready for review at https://github.com/python/cpython/pull/10639 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:16:07 2018 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Nov 2018 11:16:07 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542885367.83.0.788709270274.issue35283@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +9906 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:21:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 11:21:35 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542885695.1.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: > AVAILABLE_TARGETS = ['C.UTF-8'] Aha, that's something new in FreeBSD. In FreeBSD 11.2, this locale is invalid. The locale has been added to FreeBSD CURRENT (future FreeBSD 12) at November 4: https://reviews.freebsd.org/D17833 See discussion on freebsd-current: http://freebsd.1045724.x6.nabble.com/C-UTF-8-as-default-locale-td6292359.html So it's unrelated to my change, but it's a bug in test_c_locale_coercion on FreeBSD 12. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:25:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Nov 2018 11:25:16 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542885916.05.0.788709270274.issue35283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: isAlive() is the part of the old API. It is not even documented in Python 3, and can be removed in future. It is better to remove it from docstrings. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:26:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 11:26:59 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542886019.65.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: More FreeBSD commits, "Teach man(1) about C.UTF-8": https://svnweb.freebsd.org/base?view=revision&revision=340128 --- EXPECTED_C_LOCALE_STREAM_ENCODING = 'ascii' EXPECTED_C_LOCALE_FS_ENCODING = 'ascii' I guess that the problem comes from that. But I'm not sure of what is the FS encoding for LC_ALL=C or LC_ALL=C.UTF-8. ---------- title: [FreeBSD] test_c_locale_coercion: fsencoding is ASCII instead of UTF-8 on FreeBSD CURRENT buildbot -> [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:27:44 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Nov 2018 11:27:44 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542886064.85.0.788709270274.issue35283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: And since threads support no longer optional, are there reasons to keep _DummyThread? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:28:20 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Nov 2018 11:28:20 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542886100.93.0.788709270274.issue35283@psf.upfronthosting.co.za> Antoine Pitrou added the comment: If it's not already deprecated, I'd say deprecate it first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:30:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Nov 2018 11:30:31 +0000 Subject: [issue35284] Incomplete error handling in Python/compile.c:compiler_call() In-Reply-To: <1542753481.5.0.788709270274.issue35284@psf.upfronthosting.co.za> Message-ID: <1542886231.81.0.788709270274.issue35284@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:34:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 11:34:23 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1542886463.25.0.788709270274.issue9566@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:35:50 2018 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Nov 2018 11:35:50 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542886550.8.0.788709270274.issue35134@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think the rules for C includes are that `"path/header.h"` looks next to the current file first, whereas `` looks only in include directories. However, given your technique of mostly hiding the new directory name from API consumers, what do you think of calling the new directory "cpython" rather than "unstable"? The idea there would be that the "unstable ABI" eventually become known as "the CPython C API" (since it exposes a lot of CPython implementation details", while the limited API could become known as "the portable cross-implementation Python C API". (I know, I know, you were aiming to avoid further bikeshedding on the name, but "cpython" would namespace things nicely even if a compiler does something weird with header file lookups, and helps make it clearer to CPython contributors that we still need to care about public API stability in that directory, we just don't need to care about cross-implementation portability) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:41:47 2018 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Nov 2018 11:41:47 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542886907.23.0.788709270274.issue35283@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- pull_requests: -9906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 06:43:34 2018 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Nov 2018 11:43:34 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542887014.57.0.788709270274.issue35283@psf.upfronthosting.co.za> Dong-hee Na added the comment: @serhiy.storchaka @pitrou Then should we add the deprecated message for isAlive of class "Thread" first? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:02:34 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Nov 2018 12:02:34 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542888154.54.0.788709270274.issue35283@psf.upfronthosting.co.za> Andrew Svetlov added the comment: The only _DummyThread usage is `threading.current_thread()`: > If the caller's thread of control was not created through the threading > module, a dummy thread object with limited functionality is returned. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:12:44 2018 From: report at bugs.python.org (Marcin Kowalczyk) Date: Thu, 22 Nov 2018 12:12:44 +0000 Subject: [issue35295] Please clarify whether PyUnicode_AsUTF8AndSize() or PyUnicode_AsUTF8String() is preferred Message-ID: <1542888764.29.0.788709270274.issue35295@psf.upfronthosting.co.za> New submission from Marcin Kowalczyk : The documentation is silent whether PyUnicode_AsUTF8AndSize() or PyUnicode_AsUTF8String() is preferred. We are under the assumption that both are acceptable for the given caller, i.e. the caller wants to access just the sequence of UTF-8 code units (e.g. for calling a C++ function which takes std::string_view or std::string as a parameter), and the caller either will copy the UTF-8 code units immediately or is willing to own a temporary object to ensure a lifetime of the UTF-8 code units. File comments in unicodeobject.h about PyUnicode_AsUTF8AndSize() have a warning: *** This API is for interpreter INTERNAL USE ONLY and will likely *** be removed or changed in the future. *** If you need to access the Unicode object as UTF-8 bytes string, *** please use PyUnicode_AsUTF8String() instead. The discrepancy between these comments and the documentation should be fixed. Either the documentation is correct and the comment is outdated, or the comment is correct and the documentation is lacking guidance. It is not even clear which function is better technically: - PyUnicode_AsUTF8String() always allocates the string. PyUnicode_AsUTF8AndSize() does not allocate the string if the unicode object is ASCII-only (this is common) or if PyUnicode_AsUTF8AndSize() was already called before. - If conversion must be performed, then PyUnicode_AsUTF8String() makes a single allocation, while PyUnicode_AsUTF8AndSize() first calls PyUnicode_AsUTF8String() and then copies the string. - If the string is converted multiple times, then PyUnicode_AsUTF8AndSize() caches the result - faster. If the string is converted once, then the result persists as long as the string persists - wastes memory. I see the following possible resolutions: 1a. Declare both functions equally acceptable. Remove comments claiming that PyUnicode_AsUTF8AndSize() should be avoided. 1b. 1a, and change the implementation of PyUnicode_AsUTF8AndSize() to avoid allocating the string twice if it needs to be materialized, so that PyUnicode_AsUTF8AndSize() is never significantly slower than PyUnicode_AsUTF8String(). 2a. Declare PyUnicode_AsUTF8String() preferred. Indicate this in the documentation. 2b. 2a, and provide a public interface to check and access UTF-8 code units without allocating a new string in case this is possible (I think PyUnicode_READY() + PyUnicode_IS_ASCII() + PyUnicode_DATA() + PyUnicode_GET_LENGTH() would work, but they are not documented; or possibly also check if the string has a cached UTF-8 representation without populating that cached representation), so that a combination of the check with PyUnicode_AsUTF8String() is rarely or never significantly slower than PyUnicode_AsUTF8AndSize(). ---------- assignee: docs at python components: Documentation, Interpreter Core, Unicode messages: 330249 nosy: Marcin Kowalczyk, docs at python, ezio.melotti, vstinner priority: normal severity: normal status: open title: Please clarify whether PyUnicode_AsUTF8AndSize() or PyUnicode_AsUTF8String() is preferred type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:21:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 12:21:49 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1542889309.23.0.788709270274.issue9566@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 28f468cb19e3097079b7ce7850e6048de99022fa by Victor Stinner in branch 'master': bpo-9566: Fix compiler warnings in pyexpat.c (GH-10654) https://github.com/python/cpython/commit/28f468cb19e3097079b7ce7850e6048de99022fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:31:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 12:31:22 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1542889882.51.0.788709270274.issue9566@psf.upfronthosting.co.za> STINNER Victor added the comment: There is also: commit cdbcb773f5db24e23fa90e644ec620d54bd08127 Author: Victor Stinner Date: Thu Nov 22 10:25:46 2018 +0100 cjkcodecs: Fix compiler warning (GH-10651) Fixed the following compiler warning in multibytecodec.c: warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Cast Py_ssize_t to unsigned char: the maximum value is checked on the previous line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:47:36 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Thu, 22 Nov 2018 12:47:36 +0000 Subject: [issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace In-Reply-To: <1438133212.76.0.56822320345.issue24746@psf.upfronthosting.co.za> Message-ID: <1542890856.13.0.788709270274.issue24746@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- assignee: -> CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:52:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 12:52:10 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542891130.78.0.788709270274.issue18407@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9908 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:52:52 2018 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 22 Nov 2018 12:52:52 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542891172.75.0.788709270274.issue18407@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:53:44 2018 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Nov 2018 12:53:44 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig In-Reply-To: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> Message-ID: <1542891224.36.0.788709270274.issue35266@psf.upfronthosting.co.za> Nick Coghlan added the comment: I didn't know what was possible when I wrote PEP 432 either - instead, I wrote down an initial concept for what I *wanted*, and then started exploring the code to find out the barriers to achieving that. We know enough now to know that original design concept isn't technically feasible, but that's OK - the general idea was just to get to a point where the startup code is better tested, easier to maintain, and easier to control in an embedding application, and everything outside that is negotiable. The problem with the purely bottom-up approach is that we may end up with something that's better tested and easier to maintain, but find out that it hasn't actually helped us get to a point where we can make the interpreter easier for embedding applications to manage. As far as Unicode goes, it isn't Unicode as a concept that's problematic, it's specifically the CPython Unicode type: that needs hash randomisation configured, and that means we need to have already processed the input settings that can affect the hash seed. And unlike UTF-8 mode, where there's a comparatively limited set of strings to recreate with a different decoding step, there's no escape hatch to let you cleanly recreate all previously created string objects with a different basis for their hash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:54:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 12:54:44 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542891284.19.0.788709270274.issue18407@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 07:58:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 12:58:56 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542891536.69.0.788709270274.issue24658@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:00:10 2018 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Nov 2018 13:00:10 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1542891610.31.0.788709270274.issue17490@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- assignee: -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:04:56 2018 From: report at bugs.python.org (Sanyam Khurana) Date: Thu, 22 Nov 2018 13:04:56 +0000 Subject: [issue24925] Allow doctest to find line number of __test__ strings if formatted as a triple quoted string. In-Reply-To: <1440433204.72.0.951879790885.issue24925@psf.upfronthosting.co.za> Message-ID: <1542891896.22.0.788709270274.issue24925@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Hey R. David Murray, Where do you think the unit test for `doctest` should be placed? Should it be in `test_doctest.py`? ---------- assignee: -> CuriousLearner versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:06:55 2018 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Nov 2018 13:06:55 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542892015.73.0.788709270274.issue35290@psf.upfronthosting.co.za> Nick Coghlan added the comment: Ah, interesting. https://bugs.python.org/issue30672 covered the fact that this test was already weird on FreeBSD, but the current status is that it was expecting BSD variants to act somewhat like Mac OS X, not like Linux. I'm wondering if we may need to make test_c_locale_coercion less opinionated, where for most platforms it's just a "don't segfault" test, and it's only for ones where we're certain about how we expect it to behave (i.e. Linux, Mac OS X, AIX, maybe FreeBSD) that we try to check the specifics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:15:02 2018 From: report at bugs.python.org (Kubilay Kocak) Date: Thu, 22 Nov 2018 13:15:02 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542892502.64.0.788709270274.issue35290@psf.upfronthosting.co.za> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:43:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 13:43:13 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542894193.23.0.788709270274.issue18407@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c48ff73dd60bec5dcbe64bedeff91e6db26d98bc by Victor Stinner in branch 'master': bpo-18407: win32_urandom() uses PY_DWORD_MAX (GH-10656) https://github.com/python/cpython/commit/c48ff73dd60bec5dcbe64bedeff91e6db26d98bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:45:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 13:45:19 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542894319.57.0.788709270274.issue18407@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4d73ae776140a583fdfe8f016d88cc767791e481 by Victor Stinner in branch 'master': bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655) https://github.com/python/cpython/commit/4d73ae776140a583fdfe8f016d88cc767791e481 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 08:51:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 13:51:56 +0000 Subject: [issue18407] Fix compiler warnings in pythoncore for Win64 In-Reply-To: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> Message-ID: <1542894716.64.0.788709270274.issue18407@psf.upfronthosting.co.za> STINNER Victor added the comment: Almost all compiler warnings on 64-bit Windows have been fixed: bpo-9566 tracked most of them. I extract the CryptGenRandom() fix from issue18407-2.diff. I rewrote the ast.c fix differently (use larger type, don't downcast). The patch may still contains relevant changes on Python/dtoa.c and Python/getargs.c, but again, the most critical bugs and warnings have already been fixed. So I suggest to abandon issue18407-2.diff which has been written 5 years ago. Thanks Jeremy Kloth for the report and for the patch! I think that it's now time to close the issue. See bpo-9566 for the few remaining issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:01:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 14:01:57 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542895317.13.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'm wondering if we may need to make test_c_locale_coercion less opinionated, where for most platforms it's just a "don't segfault" test, and it's only for ones where we're certain about how we expect it to behave (i.e. Linux, Mac OS X, AIX, maybe FreeBSD) that we try to check the specifics. For test_embed, I tried to be smart to guess the encodings (ex: hardcode some encodings depending on the platform) and... I gave up. It's very hard when you consider Linux, Windows, macOS, FreeBSD, but also HP-UX and AIX. Each platform has weird cases about encodings... Now the test spawns a Python subprocess to get the encoding. See get_stdio_encoding() and get_filesystem_encoding() in Lib/test/test_embed.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:03:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 14:03:45 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542895425.09.0.788709270274.issue24658@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9a0d7a7648547ffb77144bf2480155f6d7940dea by Victor Stinner in branch 'master': bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) https://github.com/python/cpython/commit/9a0d7a7648547ffb77144bf2480155f6d7940dea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:03:57 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Nov 2018 14:03:57 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542895437.57.0.788709270274.issue24658@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:04:07 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Nov 2018 14:04:07 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542895447.89.0.788709270274.issue24658@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:17:37 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Nov 2018 14:17:37 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542896257.4.0.788709270274.issue24658@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 18f3327d9a99163a658697465eb00c31f86535eb by Miss Islington (bot) in branch '3.7': bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) https://github.com/python/cpython/commit/18f3327d9a99163a658697465eb00c31f86535eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:25:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 14:25:13 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542896713.95.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think the rules for C includes are that `"path/header.h"` looks next to the current file first, whereas `` looks only in include directories. Oh ok, thanks. > However, given your technique of mostly hiding the new directory name from API consumers, what do you think of calling the new directory "cpython" rather than "unstable"? I'm not comfortable with "CPython" name. For me, everything the "CPython C API" is the concatenation of all files in Include/ but also in subdirectories. Right now, it's unclear what is the "Python" API ("portable" API, without implemenetation details) vs the "CPython API" (implementation details). "unstable" comes from the PEP 384: "Defining a Stable ABI". IMHO what is not in the "Stable ABI" is the "Unstable ABI". By extension, APIs excluded by Py_LIMITED_API make the "unstable API". >From my point of view, "CPython API" would be more internal/ + unstable/ APIs. > The idea there would be that the "unstable ABI" eventually become known as "the CPython C API" (since it exposes a lot of CPython implementation details", while the limited API could become known as "the portable cross-implementation Python C API". Everybody seems to be confused by what is the "Python C API"... I see even more confusion if we have a "CPython C API". Do you see? "CPython" vs "Python", "Python C" vs "CPython"... IMHO "unstable" is more explicit :-) It means: "don't touch this" :-D ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:25:28 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Nov 2018 14:25:28 +0000 Subject: [issue24658] open().write() fails on 2 GB+ data (OS X) In-Reply-To: <1437188368.42.0.0977367912313.issue24658@psf.upfronthosting.co.za> Message-ID: <1542896728.35.0.788709270274.issue24658@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 0c15e508baec7e542933db2b31ea950a646cd968 by Miss Islington (bot) in branch '3.6': bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) https://github.com/python/cpython/commit/0c15e508baec7e542933db2b31ea950a646cd968 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:35:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 14:35:20 +0000 Subject: [issue35266] Add _PyPreConfig and rework _PyCoreConfig and _PyMainInterpreterConfig In-Reply-To: <1542379446.44.0.788709270274.issue35266@psf.upfronthosting.co.za> Message-ID: <1542897320.85.0.788709270274.issue35266@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, my split is incomplete. From a high level point of view, the initialization should be done in these steps: 1) select memory allocator, config made of C char* (bytes) and int types 2) select encodings, add wchar_t* (Unicode) strings to the config 3) compute the "path configuration" (used to initialize importlib and sys.path) 4) apply the config to Python Step (3) should be optional. Currently, the path configuration can be set in _PyCoreConfig to avoid the need "calculate" it (operation which access the filesystem). Technically, we may have to use wchar_t* in (1), since Windows uses wmain() which gets argv as wchar_t** (and environment variables as wchar_t* as well). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 09:38:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 14:38:42 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542897522.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 10:09:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 15:09:11 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542899351.47.0.788709270274.issue9263@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9914 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 10:11:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 15:11:19 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542899479.37.0.788709270274.issue35239@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a5194115733f6ca8fc1ddbee43eabbde536900e6 by Victor Stinner in branch '3.7': Revert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660) https://github.com/python/cpython/commit/a5194115733f6ca8fc1ddbee43eabbde536900e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 10:12:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 15:12:08 +0000 Subject: [issue35239] _PySys_EndInit() doesn't copy main interpreter configuration In-Reply-To: <1542150512.39.0.788709270274.issue35239@psf.upfronthosting.co.za> Message-ID: <1542899528.62.0.788709270274.issue35239@psf.upfronthosting.co.za> STINNER Victor added the comment: I has been decided to not backport the change to Python 3.7: see PR 10532 discusssion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 10:33:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 15:33:01 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542900781.4.0.788709270274.issue9263@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b by Victor Stinner in branch 'master': bpo-9263: Fix _PyObject_Dump() for freed object (#10661) https://github.com/python/cpython/commit/2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 10:37:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 15:37:23 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542901043.55.0.788709270274.issue9263@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:15:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:15:41 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542903341.27.0.788709270274.issue9263@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 95036ea25d47f0081bda2ba96ea327f3375cb6a4 by Victor Stinner in branch '3.7': [3.7] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) https://github.com/python/cpython/commit/95036ea25d47f0081bda2ba96ea327f3375cb6a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:20:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:20:14 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542903614.64.0.788709270274.issue9263@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:27:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:27:53 +0000 Subject: [issue35206] [WIP] Add a new experimental _Py_CAPI2 API In-Reply-To: <1541813853.84.0.788709270274.issue35206@psf.upfronthosting.co.za> Message-ID: <1542904073.37.0.788709270274.issue35206@psf.upfronthosting.co.za> STINNER Victor added the comment: According to discussions on python-dev, a PEP will be needed first. Moreover, I prefer to make some progress on https://bugs.python.org/issue35134 before. I close the issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:31:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:31:05 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context In-Reply-To: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> Message-ID: <1542904265.54.0.788709270274.issue35265@psf.upfronthosting.co.za> STINNER Victor added the comment: Honestly, I'm not convinced that the change is worth it. It looks like a giant complication for a very specific use case, whereas the current _PyMem_SetDefaultAllocator() solution "works". I close the issue. Moreover, bpo-35266 conflicts with issue, and bpo-35266 looks more important than this issue, since it impacts the future public API and remove redundancy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:31:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:31:12 +0000 Subject: [issue35265] Internal C API: pass the memory allocator in a context In-Reply-To: <1542378345.74.0.788709270274.issue35265@psf.upfronthosting.co.za> Message-ID: <1542904272.9.0.788709270274.issue35265@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 11:40:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 16:40:57 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1542904857.77.0.788709270274.issue9263@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c9b3fc6b59b625c36c31ad437253e7140938af1a by Victor Stinner in branch '3.6': bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) (GH-10663) https://github.com/python/cpython/commit/c9b3fc6b59b625c36c31ad437253e7140938af1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:12:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:12:45 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1542906765.74.0.788709270274.issue35177@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9917 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:33:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:33:21 +0000 Subject: [issue35296] Install Include/internal/ header files Message-ID: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> New submission from STINNER Victor : For some very specific use cases (ex: debuggers), it can be interesting to access the internal API of CPython. I propose to install the internal API: Include/internal/*.h header files. Attached PR implements this idea. ---------- components: Interpreter Core messages: 330271 nosy: eric.snow, nascheme, ncoghlan, vstinner priority: normal severity: normal status: open title: Install Include/internal/ header files versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:38:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:38:41 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1542908321.04.0.788709270274.issue35177@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 3bb183d7fb83ad6a84ec13dea90f95d67be35c69 by Victor Stinner in branch 'master': bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664) https://github.com/python/cpython/commit/3bb183d7fb83ad6a84ec13dea90f95d67be35c69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:39:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:39:41 +0000 Subject: [issue35177] Add missing dependencies between AST/parser header files In-Reply-To: <1541513321.28.0.788709270274.issue35177@psf.upfronthosting.co.za> Message-ID: <1542908381.98.0.788709270274.issue35177@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I fixed the "Yield warning" again. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:43:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:43:05 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1542908585.93.0.788709270274.issue35296@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9918 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:44:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:44:22 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542908662.81.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9919 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:48:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:48:25 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1542908905.93.0.788709270274.issue35296@psf.upfronthosting.co.za> STINNER Victor added the comment: Example of debuggers: vmprof or faulthandler (now part of the stdlib). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 12:56:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 17:56:08 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1542909368.53.0.788709270274.issue35296@psf.upfronthosting.co.za> STINNER Victor added the comment: TODO: Update the Windows installer: https://github.com/python/cpython/pull/10624#issuecomment-441090519 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 14:05:47 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 22 Nov 2018 19:05:47 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542913547.02.0.788709270274.issue35134@psf.upfronthosting.co.za> Brett Cannon added the comment: The "unstable" name bugs me as it suggests we might change it without notice which isn't true at all. It's more a limited versus broad API. So maybe rename the directory "broad"? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 14:26:33 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 22 Nov 2018 19:26:33 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542914793.15.0.788709270274.issue35283@psf.upfronthosting.co.za> Brett Cannon added the comment: I guess the question is whether any other Python implementation is threadless? E.g. is MicroPython? If it even has threads then I agree about deprecating the module. But if MicroPython does support threads we should keep the module. That would mean updating all references of isAlive() to is_alive() and adding the name alias since that name aliasing still exists in 'master' right now (probably for Python 2 porting support): https://github.com/python/cpython/blob/3bb183d7fb83ad6a84ec13dea90f95d67be35c69/Lib/threading.py#L1094 @dmaurer totally understand about time restraints, but do realize even "trivial" fixes like this would still take at least an hour to do a proper job so there's no guarantee someone will get around to fixing this. But if you do change your mind and want to give it a try, then https://devguide.python.org/ is there to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 14:34:42 2018 From: report at bugs.python.org (pmpp) Date: Thu, 22 Nov 2018 19:34:42 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542915282.92.0.788709270274.issue35283@psf.upfronthosting.co.za> pmpp added the comment: > I guess the question is whether any other Python implementation is threadless? emscripten python ( cpython on asm.js or webassembly ) is threadless ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 14:37:00 2018 From: report at bugs.python.org (pmpp) Date: Thu, 22 Nov 2018 19:37:00 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542915420.67.0.788709270274.issue35283@psf.upfronthosting.co.za> pmpp added the comment: about micropython, only unix port have thread basic implementation and garbage collector messes with EINTR actually so it is not very useable. unix port is only one on many, and is the less interesting port apart from running quick simulations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 15:11:08 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Nov 2018 20:11:08 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542917468.89.0.788709270274.issue35283@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Well, to satisfy everybody we need to: 1. Implement `isAlive` for dummy thread 2. Add a deprecation warning for both Thread.isAlive and _DummyThread.isAlive 3. Remove isAlive in future Python release (3.8 for the deprecation, 3.8+2 for removal). 4. Backporting the property down to 3.7 and 3.6 doesn't hurt, let's do it Did I miss something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 16:24:28 2018 From: report at bugs.python.org (Julien Palard) Date: Thu, 22 Nov 2018 21:24:28 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542921868.5.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by Julien Palard : ---------- pull_requests: +9920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 16:25:02 2018 From: report at bugs.python.org (Zsolt Cserna) Date: Thu, 22 Nov 2018 21:25:02 +0000 Subject: [issue35297] untokenize documentation is not correct Message-ID: <1542921902.22.0.788709270274.issue35297@psf.upfronthosting.co.za> New submission from Zsolt Cserna : untokenize documentation (https://docs.python.org/3/library/tokenize.html#tokenize.untokenize) states the following: """ Converts tokens back into Python source code. The iterable must return sequences with at least two elements, the token type and the token string. Any additional sequence elements are ignored. """ This last sentence is clearly not true because here: https://github.com/python/cpython/blob/master/Lib/tokenize.py#L242 The code checks for the length of the input token there, and the code behaves differently, in terms of whitespace, when an iterator of 2-tuples are given and when there are more elements in the tuple. When there are more elements in the tuple, the function renders whitespaces as the same as they were present in the original source. So this code: tokenize.untokenize(tokenize.tokenize(source.readline)) And this: tokenize.untokenize([x[:2] for x in tokenize.tokenize(source.readline)]) Have different results. I don't know that it is a documentation issue or a bug in the module itself, so I created this bugreport to seek for assistance in this regard. ---------- assignee: docs at python components: Documentation messages: 330281 nosy: csernazs, docs at python priority: normal severity: normal status: open title: untokenize documentation is not correct versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 16:25:34 2018 From: report at bugs.python.org (Zsolt Cserna) Date: Thu, 22 Nov 2018 21:25:34 +0000 Subject: [issue35297] untokenize documentation is not correct In-Reply-To: <1542921902.22.0.788709270274.issue35297@psf.upfronthosting.co.za> Message-ID: <1542921934.96.0.788709270274.issue35297@psf.upfronthosting.co.za> Change by Zsolt Cserna : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 16:49:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 21:49:31 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542923371.0.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Brett: > The "unstable" name bugs me as it suggests we might change it without notice which isn't true at all. It's more a limited versus broad API. So maybe rename the directory "broad"? Brett: Nick proposed "Include\cpython", do you prefer this name? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 16:53:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 21:53:48 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542923628.3.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Another proposal: Include\impl\ as in "implementation details". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:12:56 2018 From: report at bugs.python.org (Utkarsh Gupta) Date: Thu, 22 Nov 2018 22:12:56 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1542924776.31.0.788709270274.issue30951@psf.upfronthosting.co.za> Change by Utkarsh Gupta : ---------- keywords: +patch pull_requests: +9921 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:18:09 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Nov 2018 22:18:09 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542925089.19.0.788709270274.issue35035@psf.upfronthosting.co.za> miss-islington added the comment: New changeset daa34b84e9f6680a4012d5138068236ccdd2d1bd by Miss Islington (bot) (Julien Palard) in branch '2.7': [2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) (GH-10667) https://github.com/python/cpython/commit/daa34b84e9f6680a4012d5138068236ccdd2d1bd ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:22:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Nov 2018 22:22:08 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542925328.89.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a poll on discuss.python.org for the name of the new subdirectory :-) https://discuss.python.org/t/poll-what-is-your-favorite-name-for-the-new-include-subdirectory/477 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:28:51 2018 From: report at bugs.python.org (Julien Palard) Date: Thu, 22 Nov 2018 22:28:51 +0000 Subject: [issue35083] Fix documentation for __instancecheck__ In-Reply-To: <1540671281.62.0.788709270274.issue35083@psf.upfronthosting.co.za> Message-ID: <1542925731.93.0.788709270274.issue35083@psf.upfronthosting.co.za> Julien Palard added the comment: Currently [1] there's no concensus about: - Is this a documentation issue and we should document the optimisation? - Is the optimisation over-zealeous? [1]: https://mail.python.org/pipermail/python-ideas/2018-October/054342.html ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:29:08 2018 From: report at bugs.python.org (Julien Palard) Date: Thu, 22 Nov 2018 22:29:08 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1542925748.26.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:38:54 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 22 Nov 2018 22:38:54 +0000 Subject: [issue33416] Add endline and endcolumn to every AST node In-Reply-To: <1525342525.55.0.682650639539.issue33416@psf.upfronthosting.co.za> Message-ID: <1542926333.99.0.788709270274.issue33416@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: issue22616 is a bit different (proposing line/column ranges instead of just endline/endcolumn). I am happy to close this one in favor of issue22616 if we agree that we will go with endline/endcolumn. I can't guarantee, but likely I will work on this during winter holidays, unless there are some objections, or unless someone will do this before :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 17:41:40 2018 From: report at bugs.python.org (Utkarsh Gupta) Date: Thu, 22 Nov 2018 22:41:40 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1542926500.6.0.788709270274.issue30951@psf.upfronthosting.co.za> Change by Utkarsh Gupta : ---------- nosy: +utkarsh2102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 18:55:13 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 22 Nov 2018 23:55:13 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1542930913.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Change by G?ry : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 19:00:21 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 23 Nov 2018 00:00:21 +0000 Subject: [issue32305] Namespace packages have inconsistent __file__ and __spec__.origin In-Reply-To: <1513180121.5.0.213398074469.issue32305@psf.upfronthosting.co.za> Message-ID: <1542931221.39.0.788709270274.issue32305@psf.upfronthosting.co.za> G?ry added the comment: @barry You gave 2 reasons for changing __spec__.origin and __file__ for namespace packages. Your 1st reason: > I don't particularly like that its origin is "namespace". That's an odd special case that's unhelpful to test against (what if you import a non-namespace package from the directory "namespace"?) As far as I know, a non-namespace package always has an __init__.py file, so if it is imported from a directory named "namespace" it has a __spec__.origin and __file__ attributes equal to "path/to/package/namespace/__init__.py". So I don?t see the problem here with having a "namespace" origin for namespace package specs. In addition, PEP 420 that introduced implicit namespace packages in Python 3.3 clearly stated that having no __file__ attribute was intended for namespace packages, and more generally was left a the discretion of the module?s loader and no more limited to built-in modules (https://www.python.org/dev/peps/pep-0420/#module-reprs): > Previously, module reprs were hard coded based on assumptions about a module's __file__ attribute. If this attribute existed and was a string, it was assumed to be a file system path, and the module object's repr would include this in its value. The only exception was that PEP 302 reserved missing __file__ attributes to built-in modules, and in CPython, this assumption was baked into the module object's implementation. Because of this restriction, some modules contained contrived __file__ values that did not reflect file system paths, and which could cause unexpected problems later (e.g. os.path.join() on a non-path __file__ would return gibberish). > This PEP relaxes this constraint, and leaves the setting of __file__ to the purview of the loader producing the module. Loaders may opt to leave __file__ unset if no file system path is appropriate. Loaders may also set additional reserved attributes on the module if useful. This means that the definitive way to determine the origin of a module is to check its __loader__ attribute. > For example, namespace packages as described in this PEP will have no __file__ attribute because no corresponding file exists. Your 2nd reason: > This is especially bad because the documentation for __spec__.origin implies a correlation to __file__, and says: > "Name of the place from which the module is loaded, e.g. ?builtin? for built-in modules and the filename for modules loaded from source. Normally ?origin? should be set, but it may be None (the default) which indicates it is unspecified." I agree here, so why not updating the documentation instead of changing the implementation which followed PEP 420? ---------- nosy: +eric.snow, maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 19:14:54 2018 From: report at bugs.python.org (gilado) Date: Fri, 23 Nov 2018 00:14:54 +0000 Subject: [issue35298] Segfault in _PyObject_GenericGetAttrWithDict Message-ID: <1542932094.03.0.788709270274.issue35298@psf.upfronthosting.co.za> New submission from gilado : Running pulseeffects, it crashes occasionally. I have yet to find a cause, it just happens. I decided to run it under gdb to catch the crash. It worked for a few days before crashing. $ GDK_DPI_SCALE=0.6 gdb -args /usr/bin/python3 /usr/bin/pulseeffects gdb: Symbol `acs_map' has different size in shared object, consider re-linking GNU gdb (GDB) 7.8-1pclos2014 (PCLinuxOS release 2014) ... ... 13:57:26.125 - PulseEffects - CRITICAL - PM - context operation failed! 13:57:29.779 - PulseEffects - CRITICAL - PM - context operation failed! 13:57:30.391 - PulseEffects - CRITICAL - PM - context operation failed! [New LWP 27696] Program received signal SIGSEGV, Segmentation fault. [Switching to LWP 27696] 0x00007ffff73bcae6 in ?? () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff73bcae6 in () at /lib64/libc.so.6 #1 0x00007ffff29f8e08 in () at /usr/lib64/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so #2 0x00007ffff79baf1e in _PyObject_GenericGetAttrWithDict () at /usr/lib64/libpython3.6m.so.1.0 #3 0x00007ffff7a2b6b0 in _PyEval_EvalFrameDefault () at /usr/lib64/libpython3.6m.so.1.0 #4 0x00007ffff7a271df in () at /usr/lib64/libpython3.6m.so.1.0 #5 0x00007ffff7a2fce0 in _PyFunction_FastCallDict () at /usr/lib64/libpython3.6m.so.1.0 #6 0x00007ffff79719fe in _PyObject_FastCallDict () at /usr/lib64/libpython3.6m.so.1.0 #7 0x00007ffff7971c0d in _PyObject_Call_Prepend () at /usr/lib64/libpython3.6m.so.1.0 #8 0x00007ffff79717c8 in PyObject_Call () at /usr/lib64/libpython3.6m.so.1.0 #9 0x00007ffff29f433d in () at /usr/lib64/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so #10 0x00007ffff3f73dcf in ffi_closure_unix64_inner () at /usr/lib64/libffi.so.6 #11 0x00007ffff3f74148 in ffi_closure_unix64 () at /usr/lib64/libffi.so.6 #12 0x00007fffde2abaf5 in () at /usr/lib64/libpulse.so.0 #13 0x00007fffddf27ce1 in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #14 0x00007fffddf28033 in pa_pdispatch_run () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #15 0x00007fffde2aaa9e in () at /usr/lib64/libpulse.so.0 #16 0x00007fffddf2ab4f in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #17 0x00007fffddf2d5db in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #18 0x00007fffddf2d979 in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #19 0x00007fffddf2e1df in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #20 0x00007fffde2bea58 in pa_mainloop_dispatch () at /usr/lib64/libpulse.so.0 #21 0x00007fffde2bee1e in pa_mainloop_iterate () at /usr/lib64/libpulse.so.0 #22 0x00007fffde2beea0 in pa_mainloop_run () at /usr/lib64/libpulse.so.0 #23 0x00007fffde2cc786 in () at /usr/lib64/libpulse.so.0 #24 0x00007fffddf3db48 in () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so #25 0x00007ffff76ed62e in () at /lib64/libpthread.so.0 #26 0x00007ffff7421def in clone () at /lib64/libc.so.6 (gdb) Seems to be a python bug not validating a data pointer. A similar bug was fixed here https://bugs.python.org/issue12149 reviewing the code https://github.com/python/cpython/blob/master/Objects/object.c I think line 981 mentioned in the bug description is now line 1235 f = descr->ob_type->tp_descr_get; Which now is protected inside an if (descr != NULL). So they fixed it here. Further just below that both 'f' and 'descr' are used like this if (f != NULL && PyDescr_IsData(descr)) { res = f(descr, obj, (PyObject *)obj->ob_type); The problem now seem to be further below (line 1279) where the code is if (f != NULL) { res = f(descr, obj, (PyObject *)Py_TYPE(obj)); The problem is that they forget to check that descr is valid. ---------- components: Interpreter Core messages: 330289 nosy: gilado priority: normal severity: normal status: open title: Segfault in _PyObject_GenericGetAttrWithDict type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 19:19:07 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 00:19:07 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542932347.8.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 19:49:25 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 23 Nov 2018 00:49:25 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542934165.2.0.788709270274.issue29877@psf.upfronthosting.co.za> INADA Naoki added the comment: I am not sure PR 4856 is enhancement or bugfix. But I think it's worth enough to backport to 3.6 and 3.7. It caused a real UX problem. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 21:17:56 2018 From: report at bugs.python.org (Ethan Smith) Date: Fri, 23 Nov 2018 02:17:56 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1542939476.56.0.788709270274.issue33211@psf.upfronthosting.co.za> Ethan Smith added the comment: This has been fixed, so the issue can be closed I believe. FWIW I didn't see anything useful to salvage from my PR that wasn't already tested by your tests Serhiy. ---------- pull_requests: +9923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 21:24:00 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 23 Nov 2018 02:24:00 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1542939840.57.0.788709270274.issue33211@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 21:52:38 2018 From: report at bugs.python.org (Danish Prakash) Date: Fri, 23 Nov 2018 02:52:38 +0000 Subject: [issue35292] Make SimpleHTTPRequestHandler load mimetypes lazily In-Reply-To: <1542822100.42.0.788709270274.issue35292@psf.upfronthosting.co.za> Message-ID: <1542941558.74.0.788709270274.issue35292@psf.upfronthosting.co.za> Danish Prakash added the comment: I would like to work on this if you have not already started, Steve. > We should check whether people read from SimpleHTTPRequestHandler.extensions_map directly before calling guess_type(), and decide how quickly we can make the change. Are you implying we make the change based on whether someone use SimpleHTTPRequestHandler.extensions_map before calling guess_type()? Could you please elaborate that a bit, thanks. ---------- nosy: +danishprakash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 21:55:58 2018 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Nov 2018 02:55:58 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1542941758.28.0.788709270274.issue35283@psf.upfronthosting.co.za> Dong-hee Na added the comment: @asvetlov I agree with asvetlov :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 21:59:07 2018 From: report at bugs.python.org (Danish Prakash) Date: Fri, 23 Nov 2018 02:59:07 +0000 Subject: [issue20582] socket.getnameinfo() does not document flags In-Reply-To: <1392042265.22.0.885252016144.issue20582@psf.upfronthosting.co.za> Message-ID: <1542941947.32.0.788709270274.issue20582@psf.upfronthosting.co.za> Danish Prakash added the comment: I would like to work on this if nobody else has. ---------- nosy: +danishprakash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 22:02:43 2018 From: report at bugs.python.org (Danish Prakash) Date: Fri, 23 Nov 2018 03:02:43 +0000 Subject: [issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542942163.2.0.788709270274.issue34812@psf.upfronthosting.co.za> Danish Prakash added the comment: Sorry for bumping this thread but Victor, could you please share your inputs on this if you have the time for it, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 22:04:29 2018 From: report at bugs.python.org (Jeremy Kloth) Date: Fri, 23 Nov 2018 03:04:29 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542942269.35.0.788709270274.issue35134@psf.upfronthosting.co.za> Jeremy Kloth added the comment: As a heavy user of the non-limited Python C API, I would like to offer my suggestions for consideration. (I'm not allowed to post in discourse) First off, to me, 'unstable' comes off quite negative, i.e. risky or erratic. Brett's suggestion of 'broad' is, well, seemingly too "broad" :) In no particular order, some ideas: - 'extended' or 'extra'; as opposed to limited (from the macro) - 'volatile'; synonym for 'unstable' but with the benefit of being a C concept. I like this one as the APIs covered by this include would have access to the "volatile" object details. Things like borrowed references, direct array access or even the structure fields of the objects themselves. - 'crunchy'; Monty Python reference, "If we took the bones out, it wouldn't be crunchy, would it?" https://en.wikipedia.org/wiki/Crunchy_Frog ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 22 22:17:01 2018 From: report at bugs.python.org (Danish Prakash) Date: Fri, 23 Nov 2018 03:17:01 +0000 Subject: [issue31823] Opaque default value for close_fds argument in Popen.__init__ In-Reply-To: <1508445256.4.0.213398074469.issue31823@psf.upfronthosting.co.za> Message-ID: <1542943021.97.0.788709270274.issue31823@psf.upfronthosting.co.za> Danish Prakash added the comment: I'd like to work on this. I get that the 3.7+ doc still has the irrelevant change from 3.6 which needs to be removed but I'm not sure what's wrong with the 3.6 doc. > The signature is indeed awkward for 3.6, ---------- nosy: +danishprakash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 00:13:27 2018 From: report at bugs.python.org (Tal Einat) Date: Fri, 23 Nov 2018 05:13:27 +0000 Subject: [issue31823] Opaque default value for close_fds argument in Popen.__init__ In-Reply-To: <1508445256.4.0.213398074469.issue31823@psf.upfronthosting.co.za> Message-ID: <1542950007.01.0.788709270274.issue31823@psf.upfronthosting.co.za> Tal Einat added the comment: Danish, see Martin's previous comment (msg314413): "... the signature at [the 3.6 docs] should not show close_fds=True, because that is not necessarily the default on Windows." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 01:31:25 2018 From: report at bugs.python.org (Jorge Ramos) Date: Fri, 23 Nov 2018 06:31:25 +0000 Subject: [issue35299] LGHT0091: Duplicate symbol 'File:include_pyconfig.h' found Message-ID: <1542954685.4.0.788709270274.issue35299@psf.upfronthosting.co.za> New submission from Jorge Ramos : Build of Python 3.6.7 fails with error "LGHT0091: Duplicate symbol 'File:include_pyconfig.h' found" I am using Windows 10 64bit. Steps to reproduce this error: 1) Install Visual Studio 2017 (With the python development and native dev tools) (I have also installed NVIDIA CUDA Toolkit but I don't think this matters) 2) Download source code from Python to folder E:\RepoGit\3.6 (this is the download folder) 3) Open a command prompt, navigate to "E:\RepoGit" and run "PCBuild\build.bat -p x64" 4) Close the command prompt 5) Copy file pyconfig.h file from E:\RepoGit\3.6\PC and paste it to E:\RepoGit\3.6\include. Also, create an environment variable called "LIB" that contains the folder "E:\RepoGiT\3.6\PCbuild\amd64" (this folder was created at step 3) 6) Open a command prompt and run "Tools\msi\buildrelease.bat -x64" NOTE1: if step 5 is skipped, the overall build does not fail, but the PGInstrument x64 Interpreter fails in distutils with error "E:\RepoGiT\3.6\include\Python.h(8): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory", as shown in message https://bugs.python.org/msg329247 of issue https://bugs.python.org/issue35157 NOTE2: if pyconfig.h in step 5 is copied but the environment variable is not created, the PGInstrument x64 Interpreter fails in distutils with error "LINK : fatal error LNK1104: cannot open file 'python36.lib'", and the overall build fails with the same error shown in the title of this Issue. NOTE3: If all the steps are run, the PGInstrument x64 Interpreter succeeds in its tests but the overall build fails with the error shown in the title of this issue. All the verbose of this compilation is included in the file attached. ---------- components: Build, Windows files: LIBenRepogiT.txt messages: 330299 nosy: neyuru, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: LGHT0091: Duplicate symbol 'File:include_pyconfig.h' found type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file47941/LIBenRepogiT.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 01:40:05 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Nov 2018 06:40:05 +0000 Subject: [issue35286] wrong result for difflib.SequenceMatcher Message-ID: <1542955205.21.0.788709270274.issue35286@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 03:58:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Nov 2018 08:58:28 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1542963508.14.0.788709270274.issue30951@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: co_names contains not only names of global variables. It contains also local names in the class scope, attribute names, names of imported modules, etc. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 04:45:35 2018 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Nov 2018 09:45:35 +0000 Subject: [issue35052] Coverity scan: copy/paste error in Lib/xml/dom/minidom.py In-Reply-To: <1540308654.33.0.788709270274.issue35052@psf.upfronthosting.co.za> Message-ID: <1542966335.2.0.788709270274.issue35052@psf.upfronthosting.co.za> Petr Viktorin added the comment: Ah, XML is such an overengineered format! I usually live with the standard HTML entities – but it turns out you can define your own! Here's a reproducer which shows how to do that. ---------- nosy: +petr.viktorin Added file: https://bugs.python.org/file47942/reproducer.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 05:29:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 10:29:36 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542968976.28.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : Added file: https://bugs.python.org/file47943/2018-11-22_17-38-master-3bb183d7fb83-patch-10669.json.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 05:48:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 10:48:06 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542970086.15.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 05:53:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 10:53:58 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542970438.83.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 05:55:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 10:55:42 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542970542.73.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote a pull request to replace static inline functions with C macros: PR 10669. I ran a benchmark on speed.python.org server using the "performance" benchmark suite: http://pyperformance.readthedocs.io/ I understand that from the benchmark results that converting macros to static inline functions has no significant impact on performances. Two benchmarks are 1.06x and 1.07x faster but it can be explained by the PGO compilation which is not reliable. One benchmark is way slower, but it seems like the benchmark has an issue. If you look at the 3 latest run on speed.python.org, I see: * 38.2 us (Sept 24) * 43.5 us (Nov 21) * 43.7 us (Nov 22) I don't think that any change in _pickle or pickle explains this significant slowdown. IMHO it's just that the benchmark is not reliable :-/ We have a performance timeline on the last 5 years, and this benchmark doesn't have a straight line, we can see that the result is a little bit random :-/ -- speed.python.org runs Ubuntu 16.04 with gcc 5.4.0. The result are the two attached (compressed) JSON files: * 2018-11-22_17-38-master-3bb183d7fb83-patch-10669.json.gz: reference, Python using C macros * 2018-11-22_17-38-master-3bb183d7fb83.json.gz: static inline, current master branch Comparison ignoring difference smaller than -5% and +5%, macros are the reference: vstinner at apu$ python3 -m perf compare_to --table -G --min-speed=5 macros.json.gz inline.json.gz +--------------+---------+------------------------------+ | Benchmark | macros | inline | +==============+=========+==============================+ | regex_dna | 288 ms | 269 ms: 1.07x faster (-7%) | +--------------+---------+------------------------------+ | crypto_pyaes | 236 ms | 223 ms: 1.06x faster (-5%) | +--------------+---------+------------------------------+ | pickle_dict | 37.8 us | 43.7 us: 1.16x slower (+16%) | +--------------+---------+------------------------------+ Not significant (54): (...) Raw comparison, full data, macros are the reference: vstinner at apu$ python3 -m perf compare_to --table -G macros.json.gz inline.json.gz +-------------------------+----------+------------------------------+ | Benchmark | macros | inline | +=========================+==========+==============================+ | regex_dna | 288 ms | 269 ms: 1.07x faster (-7%) | +-------------------------+----------+------------------------------+ | crypto_pyaes | 236 ms | 223 ms: 1.06x faster (-5%) | +-------------------------+----------+------------------------------+ | nqueens | 199 ms | 195 ms: 1.02x faster (-2%) | +-------------------------+----------+------------------------------+ | raytrace | 1.01 sec | 984 ms: 1.02x faster (-2%) | +-------------------------+----------+------------------------------+ | chaos | 224 ms | 221 ms: 1.02x faster (-2%) | +-------------------------+----------+------------------------------+ | logging_simple | 21.2 us | 20.9 us: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | unpack_sequence | 117 ns | 116 ns: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | spectral_norm | 247 ms | 244 ms: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | regex_v8 | 41.8 ms | 41.4 ms: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | pickle | 19.9 us | 19.7 us: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | logging_format | 24.0 us | 23.8 us: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | scimark_sparse_mat_mult | 9.06 ms | 8.99 ms: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | pathlib | 42.1 ms | 41.8 ms: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | meteor_contest | 188 ms | 187 ms: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | unpickle_pure_python | 704 us | 700 us: 1.01x faster (-1%) | +-------------------------+----------+------------------------------+ | python_startup | 12.0 ms | 12.0 ms: 1.00x faster (-0%) | +-------------------------+----------+------------------------------+ | python_startup_no_site | 7.91 ms | 7.94 ms: 1.00x slower (+0%) | +-------------------------+----------+------------------------------+ | sympy_integrate | 35.0 ms | 35.3 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | pidigits | 283 ms | 285 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | hexiom | 17.3 ms | 17.4 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | sympy_str | 403 ms | 407 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | mako | 31.9 ms | 32.2 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | django_template | 293 ms | 296 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | tornado_http | 368 ms | 372 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | sqlalchemy_declarative | 287 ms | 290 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | html5lib | 190 ms | 192 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | xml_etree_iterparse | 181 ms | 183 ms: 1.01x slower (+1%) | +-------------------------+----------+------------------------------+ | 2to3 | 601 ms | 610 ms: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | unpickle_list | 6.49 us | 6.60 us: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | scimark_monte_carlo | 210 ms | 214 ms: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | sympy_sum | 198 ms | 202 ms: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | telco | 14.8 ms | 15.1 ms: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | fannkuch | 855 ms | 874 ms: 1.02x slower (+2%) | +-------------------------+----------+------------------------------+ | sympy_expand | 857 ms | 883 ms: 1.03x slower (+3%) | +-------------------------+----------+------------------------------+ | scimark_lu | 298 ms | 307 ms: 1.03x slower (+3%) | +-------------------------+----------+------------------------------+ | xml_etree_generate | 207 ms | 213 ms: 1.03x slower (+3%) | +-------------------------+----------+------------------------------+ | float | 210 ms | 216 ms: 1.03x slower (+3%) | +-------------------------+----------+------------------------------+ | xml_etree_process | 173 ms | 180 ms: 1.04x slower (+4%) | +-------------------------+----------+------------------------------+ | scimark_sor | 357 ms | 373 ms: 1.05x slower (+5%) | +-------------------------+----------+------------------------------+ | json_dumps | 25.8 ms | 27.0 ms: 1.05x slower (+5%) | +-------------------------+----------+------------------------------+ | pickle_dict | 37.8 us | 43.7 us: 1.16x slower (+16%) | +-------------------------+----------+------------------------------+ Not significant (16): regex_effbot; go; json_loads; xml_etree_parse; dulwich_log; nbody; regex_compile; scimark_fft; pickle_pure_python; unpickle; pickle_list; sqlite_synth; richards; logging_silent; deltablue; sqlalchemy_imperative ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:23:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:23:01 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1542972181.49.0.788709270274.issue34523@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:23:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:23:01 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542972181.58.0.663665092547.issue35290@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:27:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:27:29 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542972449.24.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I found the bug: it is related to the commit 905f1ace5f7424e314ca7bed997868a2a3044839 of bpo-34523. Python now uses ASCII for the filesystem encoding if the internal "force ASCII" mode is enabled in Py_DecodeLocale/Py_EncodeLocale. FreeBSD CURRENT introduced a new C.UTF-8 locale which is used by C locale coercion (PEP 538). _PyCoreConfig_Read() now uses ASCII for the filesystem encoding if the "force ASCII" mode is enable (to ensure that encodings are consistent everywhere Python). Problem: The LC_CTYPE now uses UTF-8 (thanks to C locale coercion) whereas Python uses ASCII for the filesystem encoding since the "force ASCII" is still enabled. I wrote PR 10672 to reset the "force ASCII" mode. I tested manually my fix on the FreeBSD CURRENT buildbot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:30:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:30:42 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542972642.84.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 984061eeb49c54fee901b92e5d3dde1c7a25cfa1 by Victor Stinner in branch 'master': bpo-35081: Add new internal headers to Makefile (GH-10670) https://github.com/python/cpython/commit/984061eeb49c54fee901b92e5d3dde1c7a25cfa1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:34:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:34:38 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542972878.2.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e89607c0fc8d6edbf19c06ba42ff0f00e6c4273f by Victor Stinner in branch 'master': bpo-35059: NEWS entry for macros converted to inline funcs (GH-10671) https://github.com/python/cpython/commit/e89607c0fc8d6edbf19c06ba42ff0f00e6c4273f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:38:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:38:30 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542973110.85.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I also modified Python 3.7 to respect the "force ASCII" mode in bpo-34403, commit 21220bbe65108f5a763ead24a6b572f80d84c9e2. Hopefully, this change is not part of the latest Python 3.7.1 bugfix release. By the way, the bug only impacts FreeBSD CURRENT users (after Nov 4, after C.UTF-8 has been added) who have no locale set (LC_CTYPE is "C", ex: python3 running in an empty environment) and explicitly disable the UTF-8 mode... Well, I guess that very few users (I mean no one) are impacted :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:44:49 2018 From: report at bugs.python.org (Vidar Fauske) Date: Fri, 23 Nov 2018 11:44:49 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1542973489.22.0.788709270274.issue31512@psf.upfronthosting.co.za> Vidar Fauske added the comment: The PR has been sitting for a while now with all previous concerns addressed. There has been a few pings on the PR without anything new happening, so I thought I would ping this issue as well: are there any other concerns about this PR, or anything else that is preventing it from being merged? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:48:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 11:48:30 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542973710.76.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: The bug is that sys.getfilesystemencoding() should be the locale encoding. On FreeBSD CURRENT, Python uses ASCII for the filesystem encoding, whereas the locale encoding is UTF-8. CURRENT-amd64% env -i ./python -X utf8=0 -c 'import locale, sys; print(sys.getfilesystemencoding(), locale.getpreferredencoding())' ascii UTF-8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:50:20 2018 From: report at bugs.python.org (bolorsociedad) Date: Fri, 23 Nov 2018 11:50:20 +0000 Subject: [issue35300] Bug with memoization and mutable objects Message-ID: <1542973820.71.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by bolorsociedad : ---------- components: Library (Lib) nosy: bolorsociedad priority: normal severity: normal status: open title: Bug with memoization and mutable objects type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 06:53:18 2018 From: report at bugs.python.org (bolorsociedad) Date: Fri, 23 Nov 2018 11:53:18 +0000 Subject: [issue35300] Bug with memoization and mutable objects Message-ID: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> New submission from bolorsociedad : The decorator functools.lru_cache seems to not work properly when the function to be memoized returns a mutable object. For instance: >>> import functools >>> @functools.lru_cache() ... def f(x): ... return [x, x + 1] ... >>> a = f(4) >>> print(a) [4, 5] >>> a[0] = 0 >>> f(4) [0, 5] When the returned mutable object is modified, the cache is modified as well. In my opinion, functools.lru_cache should store a deep copy of the returned object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:04:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:04:29 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542974669.32.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: I ran a coarse benchmark on the debug mode using PR 10669: I ran the full Python test suite. => I don't see any significant impact on performance. * C macros: PR 10669 * static inline functions: commit 3bb183d7fb83ad6a84ec13dea90f95d67be35c69 (PR 10669 parent) git clean -fdx # remove *all* untracked files ./configure --with-pydebug && make ./python -m test -j0 -r --randseed=2411717 Result: * C macros: 3 min 22 sec * static inline functions: 3 min 26 sec (+4 sec, +2%) I used my laptop to run the benchmark: Fedora 29 with GCC 8.2.1. I was still using the laptop to run other tasks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:08:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:08:31 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1542974911.63.0.788709270274.issue34523@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 by Victor Stinner in branch 'master': bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) https://github.com/python/cpython/commit/353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:08:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:08:31 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542974911.76.0.702299269573.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 by Victor Stinner in branch 'master': bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) https://github.com/python/cpython/commit/353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:12:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:12:00 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1542975120.13.0.788709270274.issue34523@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:12:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:12:00 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542975120.26.0.663665092547.issue35290@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:15:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:15:29 +0000 Subject: [issue35300] Bug with memoization and mutable objects In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1542975329.95.0.788709270274.issue35300@psf.upfronthosting.co.za> STINNER Victor added the comment: > When the returned mutable object is modified, the cache is modified as well. In my opinion, functools.lru_cache should store a deep copy of the returned object. It would be inefficient to deep copy the mutable result and can defeat the purpose of the cache... I would rather to add a note to the documentation to explain to either not return mutable objects or to not modify them :-) https://docs.python.org/dev/library/functools.html#functools.lru_cache ---------- nosy: +rhettinger, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:17:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:17:33 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542975453.08.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: Unexpected cool effect of static inline functions (copy of my email): https://mail.python.org/pipermail/python-dev/2018-November/155747.html Le jeu. 15 nov. 2018 ? 01:06, Gregory P. Smith a ?crit : > I expect the largest visible impact may be that a profiler may now attribute CPU cycles takes by these code snippets to the function from the .h file rather than directly to the functions the macro expanded in in the past due to additional debug symbol info attribution. Just more data. Consider that a win. Oh. That's very interesting. I just tried gdb and I confirm that gdb understands well inlined function. When I debug Python, gdb moves into Py_INCREF() or Py_DECREF() when I use "next". I also tried perf record/perf report: if I annotate a function (assembler code of the function), perf shows me the C code of inlined Py_INCREF and Py_DECREF! That's nice! Victor ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:18:21 2018 From: report at bugs.python.org (bolorsociedad) Date: Fri, 23 Nov 2018 12:18:21 +0000 Subject: [issue35300] Bug with memoization and mutable objects In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1542975501.58.0.788709270274.issue35300@psf.upfronthosting.co.za> bolorsociedad added the comment: I understand it may be inefficient sometimes. Perhaps it would be nice to add an argument to lru_cache to specify that we want to deep copy? Something like def lru_cache(..., deepcopy=False): ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:32:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:32:53 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542976373.57.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: Stefan Behnel wrote: https://mail.python.org/pipermail/python-dev/2018-November/155759.html """ It's also slower to compile, given that function inlining happens at a much later point in the compiler pipeline than macro expansion. The C compiler won't even get to see macros in fact, whereas whether to inline a function or not is a dedicated decision during the optimisation phase based on metrics collected in earlier stages. For something as ubiquitous as Py_INCREF/Py_DECREF, it might even be visible in the compilation times. """ I ran a benchmark on the compilation time using PR 10669: there is no significant slowdown (+4 seconds, 6% slower, in the worst case). I ran a benchmark on my laptop: * Fedora 29 * Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz: 4 physical cores (8 threads) * GCC 8.2.1 * MAKEFLAGS=-j9 Result in release mode: * git clean -fdx; ./configure; time make # -03 * C macros: 1m12,158s * static inline functions: 1m16,294s (+4.136s, +6%) Result in debug mode: * git clean -fdx; ./configure --with-pydebug; time make # -Og * C macros: 0m39,727s * static inline functions: 0m40,423s (+0.696s, +2%) I only used "real" time (I ignored user and sys times). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:37:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:37:45 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1542976665.36.0.788709270274.issue34523@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 by Victor Stinner in branch '3.7': bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673) https://github.com/python/cpython/commit/f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:37:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:37:45 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542976665.48.0.702299269573.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 by Victor Stinner in branch '3.7': bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673) https://github.com/python/cpython/commit/f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:38:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:38:21 +0000 Subject: [issue35290] [FreeBSD] test_c_locale_coercion doesn't support new C.UTF-8 locale of FreeBSD CURRENT In-Reply-To: <1542797392.41.0.788709270274.issue35290@psf.upfronthosting.co.za> Message-ID: <1542976701.86.0.788709270274.issue35290@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested my 3.7 and master fixes: they fix test_c_locale_coercion on the FreeBSD CURRENT buildbot. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 07:49:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 12:49:31 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542977371.06.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: "PyObject* PyObject_INIT(PyObject *op, PyTypeObject *typeobj)" and "PyVarObject* PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size)" Don't cast their argument to PyObject*/PyVarObject* which can introduce new warnings when upgrading from Python 3.7 to Python 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:00:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 13:00:20 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542978020.98.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: I ran my benchmarks, I close the PR 10669 (replace static inline functions with macros). You should still be able to use it as patch: https://github.com/python/cpython/pull/10669.patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:08:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 13:08:28 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542978508.97.0.788709270274.issue35059@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:21:11 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 13:21:11 +0000 Subject: [issue35292] Make SimpleHTTPRequestHandler load mimetypes lazily In-Reply-To: <1542822100.42.0.788709270274.issue35292@psf.upfronthosting.co.za> Message-ID: <1542979271.92.0.788709270274.issue35292@psf.upfronthosting.co.za> Steve Dower added the comment: You're welcome to it - I deliberately left it for someone else to work on, though I'm happy to review and merge. The visible change of making this lazy is that if someone reads from the dict, it'll be missing system-specified content types (until we lazily fill it in guess_type() ). Nobody is meant to read from it - it's public for people to *add* custom overrides - so this should be okay, but a little bit of GitHub research to find out if anyone does wouldn't hurt. Then we can at least warn them that it's changing before they run into their own bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:27:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 13:27:41 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542979661.55.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b509d52083e156f97d6bd36f2f894a052e960f03 by Victor Stinner in branch 'master': bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674) https://github.com/python/cpython/commit/b509d52083e156f97d6bd36f2f894a052e960f03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:39:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 13:39:42 +0000 Subject: [issue35134] Add a new Include/unstable/ subdirectory for the "unstable" API In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542980382.75.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Jeremy Kloth: > First off, to me, 'unstable' comes off quite negative, i.e. risky or erratic. Ok, the 3rd people who dislike my "unstable" name, so it sounds really bad :-) Jeremy Kloth: > 'volatile'; synonym for 'unstable' but with the benefit of being a C concept. I don't think that it's true that the "#ifndef Py_LIMITED_API" is unstable or volatile. Most of this API didn't change much in the last 10 years. So sorry, "unstable" was really a bad name. Brett Cannon: > It's more a limited versus broad API. So maybe rename the directory "broad"? Jeremy Kloth: > - 'extended' or 'extra'; as opposed to limited (from the macro) The name by itself doesn't explain why an API should be in Include/ or Include//. What is extra or not? Jeremy Kloth: > - 'crunchy'; Monty Python reference, "If we took the bones out, it wouldn't be crunchy, would it?" https://en.wikipedia.org/wiki/Crunchy_Frog Sorry, I dislike humor in an API. An API has to make sense :-( -- Ok, after I read all proposition, I now prefer "cpython". Extract of my updated PR which gives the rationale: Include/.h should be the "portable Python API", whereas Include/cpython/.h should be the "CPython API": CPython implementation details. It now makes sense to me what should go to Include/ and what should go to Include/cpython/. Obviously, Include/cpython/ is incomplete. It's only the public flavor of the "CPython API". There is also the private CPython internal API in Include/internal/. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 08:44:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 13:44:16 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542980656.73.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Add a new Include/unstable/ subdirectory for the "unstable" API -> Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 09:01:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 14:01:48 +0000 Subject: [issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542981708.57.0.788709270274.issue34812@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9931 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 09:03:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 14:03:59 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542981839.41.0.788709270274.issue34812@psf.upfronthosting.co.za> STINNER Victor added the comment: I tried to explain how to fix the bug, but nobody came up with a working change 2 months, so I wrote the PR myself. It's an important security issue, since the function is used by multiprocessing and distutils modules to spawn new child processes. ---------- components: -Tests keywords: -easy title: [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag -> [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 09:05:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 14:05:17 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542981917.99.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4ac5328affa37bdfc5847dfdb2a41bad772e7270 by Victor Stinner in branch 'master': bpo-35081: add NEWS entry for new Include/internal/pycore_*.h files (GH-10666) https://github.com/python/cpython/commit/4ac5328affa37bdfc5847dfdb2a41bad772e7270 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 09:21:13 2018 From: report at bugs.python.org (Jonathan) Date: Fri, 23 Nov 2018 14:21:13 +0000 Subject: [issue35301] python.exe crashes - lzma? Message-ID: <1542982873.09.0.788709270274.issue35301@psf.upfronthosting.co.za> New submission from Jonathan : Python 3.6.3 on Windows 7 64 bit. I keep getting intermittent crashes of Python.exe with my project. The error is below and as best I can see seems to be indicating the issue with the LZMA module. All I'm doing is using it to compress web-pages (typically XML ones). Problem is, I can't replicate it. When I try and run the process again, the page that previously crashed it now works. I've had this happen three times so far (out of about 150,000 pages downloaded and compressed). My use of LZMA is quite simply: from lzma import compress compress(page_content, preset=5) The pages it has crashed on so far (but which work fine now): http://www.geoportal.rlp.de/mapbender/php/wms.php?inspire=1&layer_id=35833&request=GetCapabilities&service=WMS&version=1.3.0 https://maps.runnymede.gov.uk/geoserver/planning/lp_ancient_woodland/wms?request=GetCapabilities&service=WMS&version=1.3.0 http://serviziogc.regione.fvg.it/geoserver/GEOLOGIA/wms?request=GetCapabilities&service=WMS&version=1.3.0 I took a mini dump (attached) and full dump using Process Explorer. The full dump is 100MB compressed (1GB uncompressed). ---- Problem signature: Problem Event Name: APPCRASH Application Name: python.exe Application Version: 3.6.3150.1013 Application Timestamp: 59d3d3a3 Fault Module Name: _lzma.pyd Fault Module Version: 3.6.3150.1013 Fault Module Timestamp: 59d3d343 Exception Code: c0000005 Exception Offset: 000000000002e368 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 2057 Additional Information 1: d00b Additional Information 2: d00be1cd6ce69f4b081e66c649a14f90 Additional Information 3: 8c17 Additional Information 4: 8c17b9c4b6a39b7e31bf71b3b1374f1b ---------- files: python-mini.7z messages: 330327 nosy: jonathan-lp priority: normal severity: normal status: open title: python.exe crashes - lzma? type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47944/python-mini.7z _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 09:56:34 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 14:56:34 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1542984994.95.0.788709270274.issue34977@psf.upfronthosting.co.za> Change by Steve Dower : ---------- pull_requests: +9932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:08:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:08:11 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542985691.44.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: I close the issue, it seems like all sub-tasks have been completed! Summary of the change: * Header files of Include/internal/ are now all prefixed by "pycore_" and the directory has been added to the header search path. For example, #include "pycore_pystate.h" is now used in C code, instead of #include "internal/pystate.h". * All "#ifdef Py_BUILD_CORE" code has been moved from Include/*.h to Include/internal/*.h (except of the _PyTuple_ITEMS() macro) * I created many new header files in Include/internal/ * _json and _locale modules are now built with Py_BUILD_CORE define * _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() have been removed from the public C API and moved to the internal API There are other issues to track following steps: * bpo-35296: Install Include/internal/ header files * bpo-35258: Fix -Wmissing-prototypes warnings * bpo-35134: Create Include/cpython/ subdirectory * bpo-35059: Convert macros to static inline functions ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:14:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:14:49 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542986089.51.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: > Drawbacks: Require a specific type can introduce compiler warnings if the caller doesn't pass the proper type (PyObject* or PyVarObject*). _Py_NewReference() and _Py_ForgetReference() seem to be properly used, but not PyObject_INIT() and PyObject_INIT_VAR(). I worked around this issue by adding a macro to cast the argument and declare the static inline function with a different name. Example: static inline void _Py_INCREF(PyObject *op) { _Py_INC_REFTOTAL; op->ob_refcnt++; } #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:26:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:26:57 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542986817.5.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: I close the issue, it seems like all subtasks have been completed. Summary of the issue: * The following macros have been converted to static inline functions: - Py_INCREF(), Py_DECREF() - Py_XINCREF(), Py_XDECREF() - PyObject_INIT(), PyObject_INIT_VAR() - _Py_NewReference(), _Py_ForgetReference() - _Py_Dealloc() - _PyObject_GC_TRACK(), _PyObject_GC_UNTRACK() * There is no significant impact on performance: * I ran performance benchmark on Python compiled in release mode * I ran the Python test suite on Python compiled in debug mode * I measured the compilation time in release an debug mode * It has been decided to use "static inline" to declare inline function (write directly "static inline", no macro). * It has been decided to no use __attribute__((always_inline)) nor __forceinline (ask the compiler to always inline). -- Benjamin Peterson would "like to see Py_LOCAL_INLINE removed, too, fwiw", but it's part of the public C API. It would require a deprecation period. I'm not interested to touch the public C API. Benjamin: please open a new issue if you still want to remove it :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:28:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:28:47 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542986927.61.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Nick Coghlan, Steve Dower and Paul Moore and me prefer "cpython" name, so let's go with that one! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:30:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:30:16 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1542987016.12.0.788709270274.issue35296@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f653fd4d950ac092719b6152e38d77c62b443125 by Victor Stinner in branch 'master': bpo-35296: make install now installs the internal API (GH-10665) https://github.com/python/cpython/commit/f653fd4d950ac092719b6152e38d77c62b443125 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:41:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:41:27 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1542987687.76.0.788709270274.issue35296@psf.upfronthosting.co.za> STINNER Victor added the comment: I decided to merge my PR because I started to *remove* functions from the public C API to move them to the CPython internal API: _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() are two examples from bpo-35081. So some people might want even more to use the internal API. The main issue with this API is the requirement to use the same compiler with the same compilation options, especially to access atomic variables. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:42:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:42:03 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1542987723.91.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: In bpo-35296, I modified "make install" to also install Include/internal/. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:46:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:46:14 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542987974.84.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b409ffa848b280c1db1b4f450bfae14f263099ac by Victor Stinner (nierob) in branch 'master': bpo-35189: Retry fnctl calls on EINTR (GH-10413) https://github.com/python/cpython/commit/b409ffa848b280c1db1b4f450bfae14f263099ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 10:48:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 15:48:22 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542988102.51.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:00:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:00:04 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542988804.82.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e421106b9e4d780c083113e4180d58d68acc69ab by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/ subdirectory (GH-10624) https://github.com/python/cpython/commit/e421106b9e4d780c083113e4180d58d68acc69ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:17:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:17:57 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542989877.95.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:43:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:43:46 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542991426.65.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:47:07 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:47:07 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1542991627.16.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Number lines containing Py_LIMITED_API in Include/ dir: 13:pyerrors.h 12:abstract.h 11:pylifecycle.h 11:dictobject.h 10:pystate.h 8:longobject.h 7:modsupport.h 7:ceval.h 7:bytesobject.h 6:pythonrun.h 5:warnings.h 5:tupleobject.h 5:methodobject.h 5:complexobject.h ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:48:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:48:41 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542991721.13.0.788709270274.issue35059@psf.upfronthosting.co.za> STINNER Victor added the comment: Advantages of inline functions over C macros: https://mail.python.org/pipermail/python-dev/2018-November/155805.html There are multiple advantages: * Better development and debugging experience: tools understand inlined functions much better than C macros: gdb, Linux perf, etc. * Better API: arguments now have a type and the function has a return type. In practice, some macros still cast their argument to PyObject* to not introduce new compiler warnings in Python 3.8. For example, even if Py_INCREF() is documented (*) as a function expecting PyObject*, it accepts any pointer type (PyTupleObject*, PyUnicodeObject*, etc.). Technically, it also accepts PyObject** which is a bug, but that's a different story ;-) * Much better code, just plain regular C. C macros are ugly: "do { ... } while (0)" workaround, additional parenthesis around each argument, strange "expr1, expr2" syntax of "macro expression" which returns a value (inline function just uses regular "return" and ";" at the end of instructions), strange indentation, etc. * No more "macro pitfals": https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html * Local variables no longer need a magic name to avoid risk of name conflict, and have a clearly defined scope. Py_DECREF() and _Py_XINCREF() no longer need a local variable since it's argument already has a clearly defined type: PyObject*. I introduced a new variable in _Py_Dealloc() to fix a possible race condition. Previously, the variable was probably avoided because it's tricky use variables in macros. * #ifdef can now be used inside the inline function: it makes the code easier to understand. * etc. Are you aware that Python had macros like: #define _Py_REF_DEBUG_COMMA , #define _Py_CHECK_REFCNT(OP) /* a semicolon */; I let you judge the quality of this macro: #define _Py_NewReference(op) ( \ _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \ _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ Py_REFCNT(op) = 1) Is it an expression? Can it be used in "if (test) _Py_NewReference(op);"? It doesn't use the "do { ... } while (0)" protection against macro pitfals. (*) Py_INCREF doc: https://docs.python.org/dev/c-api/refcounting.html#c.Py_INCREF ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:53:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:53:16 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542991996.72.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 56742f1eb05401a27499af0ccdcb4e4214859fd1 by Victor Stinner in branch '3.7': [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) https://github.com/python/cpython/commit/56742f1eb05401a27499af0ccdcb4e4214859fd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:54:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:54:23 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542992063.18.0.788709270274.issue34812@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9de363271519e0616f4a7b59427057c4810d3acc by Victor Stinner in branch 'master': bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) https://github.com/python/cpython/commit/9de363271519e0616f4a7b59427057c4810d3acc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:54:38 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 16:54:38 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542992078.0.0.788709270274.issue34812@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:57:01 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Fri, 23 Nov 2018 16:57:01 +0000 Subject: [issue35220] delete "how do I emulate os.kill" section in Windows FAQ In-Reply-To: <1542055518.86.0.788709270274.issue35220@psf.upfronthosting.co.za> Message-ID: <1542992221.8.0.788709270274.issue35220@psf.upfronthosting.co.za> Mathieu Dupuy added the comment: My PR has been merged, thanks ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 11:59:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 16:59:42 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542992382.48.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:06:58 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:06:58 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542992818.36.0.788709270274.issue29877@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1d817e4c8259f49602eefe9729743f6d9d748e8d by Miss Islington (bot) (Dustin Spicuzza) in branch 'master': bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) https://github.com/python/cpython/commit/1d817e4c8259f49602eefe9729743f6d9d748e8d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:07:06 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:07:06 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542992826.95.0.788709270274.issue29877@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:07:17 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:07:17 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542992837.4.0.788709270274.issue29877@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:09:47 2018 From: report at bugs.python.org (Mathieu Dupuy) Date: Fri, 23 Nov 2018 17:09:47 +0000 Subject: [issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers) In-Reply-To: <1411660131.7.0.581562777837.issue22496@psf.upfronthosting.co.za> Message-ID: <1542992987.52.0.788709270274.issue22496@psf.upfronthosting.co.za> Mathieu Dupuy added the comment: A lot of time has passed and things have changed significantly. We now live in a mostly python3-world (which doesn't have the bug) and Python2 has less than two years before beeing put to sleep. If nobody opposes, I offer to close this issue that I opened first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:10:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 17:10:22 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542993022.39.0.788709270274.issue34812@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9940 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:13:35 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:13:35 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542993215.94.0.788709270274.issue34812@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 01e579949ab546cd4cdd0d6d18e3ef41ce94f46e by Miss Islington (bot) in branch '3.7': bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) https://github.com/python/cpython/commit/01e579949ab546cd4cdd0d6d18e3ef41ce94f46e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:41:58 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:41:58 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542994918.76.0.788709270274.issue29877@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 903a3e8d67b61594c0fa17fb201769ca924b38f8 by Miss Islington (bot) in branch '3.7': bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) https://github.com/python/cpython/commit/903a3e8d67b61594c0fa17fb201769ca924b38f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:53:21 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 17:53:21 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1542995601.06.0.788709270274.issue29877@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 879f5f3d9c1f5b66e2a080c712e2323e9c03d558 by Miss Islington (bot) in branch '3.6': bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) https://github.com/python/cpython/commit/879f5f3d9c1f5b66e2a080c712e2323e9c03d558 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 12:55:59 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 17:55:59 +0000 Subject: [issue35299] LGHT0091: Duplicate symbol 'File:include_pyconfig.h' found In-Reply-To: <1542954685.4.0.788709270274.issue35299@psf.upfronthosting.co.za> Message-ID: <1542995759.24.0.788709270274.issue35299@psf.upfronthosting.co.za> Steve Dower added the comment: I'm going to declare that this is a bug in distutils not correctly setting INCLUDE and LIB values when building in a source directory. When this is fixed, there will be no need to copy pyconfig.h anywhere, and the installer build will be fine. (And it should be noted that we don't rely on 100% pass rate of the test suite when training for PGO - the point is to exercise as many code paths as possible. The test suite has shown to be as good as any other generic workload, and is easily available in our repo.) ---------- components: +Distutils, Tests -Build nosy: +dstufft, eric.araujo versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:00:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 18:00:18 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542996018.65.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset eef813b1091f4baaaa7411aa58d2746a9761ee99 by Victor Stinner in branch '3.6': [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) (GH-10685) https://github.com/python/cpython/commit/eef813b1091f4baaaa7411aa58d2746a9761ee99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:01:41 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 18:01:41 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1542996101.76.0.788709270274.issue31512@psf.upfronthosting.co.za> Steve Dower added the comment: Thanks for the ping (I don't see GitHub notifications - I get 1000s per day and it's not feasible to read them). I left one more comment on the PR, but then it's good to go! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:01:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 18:01:48 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1542996108.61.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Aapo Samuli Keskimolo for the bug report and thanks Nierob for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:02:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 18:02:28 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542996148.36.0.788709270274.issue34812@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset cc0e0a2214d6515cf6ba4c7b164902a87e321b45 by Victor Stinner in branch '3.6': bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) (GH-10688) https://github.com/python/cpython/commit/cc0e0a2214d6515cf6ba4c7b164902a87e321b45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:03:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 18:03:21 +0000 Subject: [issue34812] [Security] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag In-Reply-To: <1537978023.88.0.545547206417.issue34812@psf.upfronthosting.co.za> Message-ID: <1542996201.55.0.788709270274.issue34812@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, the bug is now fixed in Python 3.6, 3.7 and master branches ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:20:10 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 18:20:10 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1542997210.25.0.788709270274.issue35059@psf.upfronthosting.co.za> Steve Dower added the comment: Could we have used function overloading to handle the different types? Rather than reintroducing the macro for the sake of the cast? ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:30:53 2018 From: report at bugs.python.org (Neil Booth) Date: Fri, 23 Nov 2018 18:30:53 +0000 Subject: [issue35302] create_connection with local_addr misses valid socket bindings Message-ID: <1542997853.2.0.788709270274.issue35302@psf.upfronthosting.co.za> New submission from Neil Booth : I run a machine with IPv4 and IPv6 interfaces on MacOSX Mojave. I try to loop.create_connection() to a remote machine whose domain resolves to an IPv6 address only, with a local_addr domain name argument that resolves to two local addresses: an IPv4 one first and an IPv6 one second. The loop https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L927-L943 that loops through the local addresses, IPv4 then IPv6, successfully binds the IPv4 laddr_info to the IPv6 socket successfully (something I find surprising) and then the connection attempt fails with OSError(65, 'No route to host'), at which point the sockets is closed and the IPv6 laddr_info is never tried and the connection attempt fails. If I reverse the order of the loop so that the IPv6 laddr_info is tried first then the connection succeeds. I suggest either all laddr_info bindings should be tried for each outer loop of infos, rather than just 1, or that those of a different socket "type" (IPv4 vs IPv6) should be skipped in the inner loop before attempting a binding. ---------- components: asyncio messages: 330354 nosy: asvetlov, kyuupichan, yselivanov priority: normal severity: normal status: open title: create_connection with local_addr misses valid socket bindings type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:36:38 2018 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 23 Nov 2018 18:36:38 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() Message-ID: <1542998198.28.0.788709270274.issue35303@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- components: Extension Modules nosy: ZackerySpytz priority: normal severity: normal status: open title: A reference leak in _operator.c's methodcaller_repr() versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:37:23 2018 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 23 Nov 2018 18:37:23 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() Message-ID: <1542998243.18.0.788709270274.issue35303@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +9941 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 13:38:30 2018 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 23 Nov 2018 18:38:30 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() Message-ID: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> New submission from Zackery Spytz : The attached PR fixes a reference leak in _operator.c's methodcaller_repr(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:26:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Nov 2018 19:26:54 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543001214.43.0.788709270274.issue35303@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5b83ef71d3060e1651d3680e805f13a1049c7d6d by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) https://github.com/python/cpython/commit/5b83ef71d3060e1651d3680e805f13a1049c7d6d ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:27:05 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 19:27:05 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543001225.38.0.788709270274.issue35303@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:27:13 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 19:27:13 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543001233.87.0.788709270274.issue35303@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:35:08 2018 From: report at bugs.python.org (liugang) Date: Fri, 23 Nov 2018 19:35:08 +0000 Subject: [issue35304] The return of truncate(size=None) (file io) is unexpected Message-ID: <1543001708.41.0.788709270274.issue35304@psf.upfronthosting.co.za> New submission from liugang : -- run in Windows 10 1 - f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # output 5 (xxx\r\n) x = f.truncate() print(x) # output 13 (xxx\r\nyyy\r\nzzz), why it is 13, not 5? 2 - f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # output 5 (xxx\r\n) f.seek(f.tell()) x = f.truncate() print(x) # output 5 ---------- components: IO messages: 330357 nosy: liugang93 priority: normal severity: normal status: open title: The return of truncate(size=None) (file io) is unexpected type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:44:37 2018 From: report at bugs.python.org (liugang) Date: Fri, 23 Nov 2018 19:44:37 +0000 Subject: [issue35304] The return of truncate(size=None) (file io) is unexpected In-Reply-To: <1543001708.41.0.788709270274.issue35304@psf.upfronthosting.co.za> Message-ID: <1543002277.59.0.788709270274.issue35304@psf.upfronthosting.co.za> liugang added the comment: # Run in Windows 10 # Code snippet 1 f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # 5 x = f.truncate() print(x) # 13 - why it is 13, not 5? # Code snippet 2 f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # 5 f.seek(f.tell()) x = f.truncate() print(x) # 5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:57:16 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 19:57:16 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1543003036.46.0.788709270274.issue34977@psf.upfronthosting.co.za> Steve Dower added the comment: If anyone would like to try this out early, here's some instructions for a build I just made. Enable sideloading apps on your machine (see https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development - may already be done, sideload or developer mode should do) In a regular (non-admin) PowerShell prompt in a temporary directory, run these commands: iwr "https://dev.azure.com/Python/8e426817-76c0-4b99-ba9e-a48a1e4bd5db/_apis/build/builds/34540/artifacts?artifactName=appx&api-version=5.0-preview.5&%24format=zip" -outfile python37.zip Expand-Archive .\python37.zip . Add-AppxPackage appx\python.msix (The first may take a while as it downloads approx. 80MB. I'm intending to leave the test suite out of the final package, which should bring it down closer to 40MB.) Now play with it: $> python.exe $> python3.exe $> python3.7.exe $> pip.exe $> pip3.exe $> pip3.7.exe $> idle.exe $> idle3.exe $> idle3.7.exe (Or press Win+S and search for new entries) To remove it: Remove-AppxPackage (Get-AppxPackage *Python.3.7) (delete the downloaded files) Right now, the py.exe launcher can't find it, nor can any tools that rely on enumerating the registry - directly requesting the reg keys will return the right values though. VS Code seems to pick it up just fine though, I guess because it's on PATH. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:58:11 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 19:58:11 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543003091.46.0.788709270274.issue35303@psf.upfronthosting.co.za> miss-islington added the comment: New changeset bc665b42ba3a372bc60451583bfaff41d8e1993d by Miss Islington (bot) in branch '3.7': bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) https://github.com/python/cpython/commit/bc665b42ba3a372bc60451583bfaff41d8e1993d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:58:22 2018 From: report at bugs.python.org (Lihu) Date: Fri, 23 Nov 2018 19:58:22 +0000 Subject: [issue35281] Allow access to unittest.TestSuite tests In-Reply-To: <1542655549.43.0.788709270274.issue35281@psf.upfronthosting.co.za> Message-ID: <1543003102.64.0.788709270274.issue35281@psf.upfronthosting.co.za> Lihu added the comment: Sorry, I guess some context might be helpful. I'm writing a program that links unittest-based tests with a third-party test tracking/reporting system. Said third-party software has a concept of test suites/cases that doesn't align 1:1 with unittest, so I need to manipulate the unittest objects a bit to get them to connect smoothly. `list(test_suite)` is a bit clunky for me, since I'm already copying said list in order to do my manipulation. So I end up with expressions like: ``` my_cases = list(my_custom_generator(list(test_suite))) ``` Certainly not the end of the world, and it works just fine, but it's redundant and I need to do it a lot. I realize that `list(iterator)` is an increasingly common idiom in python 3, but I thought I'd throw this usecase out there for your consideration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 14:58:27 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Nov 2018 19:58:27 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543003107.49.0.788709270274.issue35303@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 8c70c08f0fb5795904442e95a2987ea18aed2899 by Miss Islington (bot) in branch '3.6': bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) https://github.com/python/cpython/commit/8c70c08f0fb5795904442e95a2987ea18aed2899 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 15:08:36 2018 From: report at bugs.python.org (=?utf-8?b?0KDQvtC80LDQvSDQlNC+0L3Rh9C10L3QutC+?=) Date: Fri, 23 Nov 2018 20:08:36 +0000 Subject: [issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used In-Reply-To: <1359599707.26.0.771342463799.issue17088@psf.upfronthosting.co.za> Message-ID: <1543003716.69.0.788709270274.issue17088@psf.upfronthosting.co.za> Change by ????? ???????? : ---------- nosy: +SpecLad _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 17:18:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Nov 2018 22:18:08 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1542997210.25.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Could we have used function overloading to handle the different types? Rather than reintroducing the macro for the sake of the cast? Sorry, I don't know what is function overloading. Is it a C++ thing? Py_INCREF() must accept any type based on PyObject. At least, this issue shouldn't make the situation worse :-) Please open a new issue if you have a solution for this problem. I am now curious since I tried many things and I failed to find anything working for all cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 17:18:53 2018 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Nov 2018 22:18:53 +0000 Subject: [issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime() In-Reply-To: <1540478010.12.0.788709270274.issue35066@psf.upfronthosting.co.za> Message-ID: <1543011533.86.0.788709270274.issue35066@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9944 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 17:30:11 2018 From: report at bugs.python.org (Michael Saah) Date: Fri, 23 Nov 2018 22:30:11 +0000 Subject: [issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime() In-Reply-To: <1540580876.27.0.788709270274.issue35066@psf.upfronthosting.co.za> Message-ID: Michael Saah added the comment: Summary to accompany my patch: Modules/_datetimemodule.c and Lib/datetime.py do not behave identically. Specifically, the strftime functions do not match when passed a format string terminated with a '%'. The C function performs an explicit check for this condition, and raises a ValueError on it. The Py version does not perform this check. Both pass the format string (after doing substitutions for %z, %Z, and %f tags) to the system strftime or wcfstime, depending on platform. These live within the python time module. The time module wrapper function does not perform this check. This situation leads to a scenario in which, for example, "%D %" passed to datetime.strftime (with the C extension included) raises a value error. The same string passed to time.strftime returns "mm/dd/yy %", at least on OSX. Furthermore, if Python is built without the C module, "mm/dd/yy %" is returned when datetime.strftime is called. To summarise, there are two problems: (1) datetime does not comply with PEP-399, and (2) a higher-order module raises an exception on a case that the (exposed) lower-order module has no problem with, causing a mismatch in behavior between datetime.strftime and time.strftime. This PR attempts to fix this problem by removing the case check from the datetime C module. This solves both (1) and (2). There was much talk on the issue thread about there existing a test case for time.strftime that documented a platform-dependent failure on a dangling '%'. I wish to note that my patch does not touch the time module at all, it only removes a seemingly unnecessary check in the datetime C module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 18:13:41 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Nov 2018 23:13:41 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1543014821.58.0.788709270274.issue35059@psf.upfronthosting.co.za> Steve Dower added the comment: Ah, you're right, it's only C++. My bad. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 18:14:45 2018 From: report at bugs.python.org (Ismail Donmez) Date: Fri, 23 Nov 2018 23:14:45 +0000 Subject: [issue28247] Add an option to zipapp to produce a Windows executable In-Reply-To: <1474552529.42.0.627404378819.issue28247@psf.upfronthosting.co.za> Message-ID: <1543014885.6.0.788709270274.issue28247@psf.upfronthosting.co.za> Ismail Donmez added the comment: The documentation helped a lot, so thanks for that! But it misses the final crucial step: copy /b zastub.exe+app.pyz app.exe The documentation talks about prepending the zastub.exe to the zip file but never mentions how, which is very confusing. ---------- nosy: +donmez _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 19:31:23 2018 From: report at bugs.python.org (Martin Panter) Date: Sat, 24 Nov 2018 00:31:23 +0000 Subject: [issue12215] TextIOWrapper: issues with interlaced read-write In-Reply-To: <1306759084.05.0.928785750761.issue12215@psf.upfronthosting.co.za> Message-ID: <1543019483.62.0.788709270274.issue12215@psf.upfronthosting.co.za> Martin Panter added the comment: For the record, the more recent bug I mentioned was a complaint from 2015 (one and a half years before Victor?s comment). Even if it is not worth supporting writing after reading, the problem could be documented. ---------- resolution: out of date -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 20:11:07 2018 From: report at bugs.python.org (Martin Panter) Date: Sat, 24 Nov 2018 01:11:07 +0000 Subject: [issue35304] The return of truncate(size=None) (file io) is unexpected In-Reply-To: <1543001708.41.0.788709270274.issue35304@psf.upfronthosting.co.za> Message-ID: <1543021867.06.0.788709270274.issue35304@psf.upfronthosting.co.za> Martin Panter added the comment: This is the same as Issue 26158. Truncating text files is not clearly documented for a start, and truncating after reading doesn?t seem to be considered much in the implementations. Your question is answered at . Your code calls the C implementation of ?io.TextIOWrapper.truncate?. This implementation does not consider that there are 8 unread bytes in a buffer, so it truncates the file at the end of the buffer (5 read + 8 unread = 13 bytes). ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> File truncate() not defaulting to current position as documented _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 20:16:45 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 24 Nov 2018 01:16:45 +0000 Subject: [issue35300] Bug with memoization and mutable objects In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543022205.18.0.788709270274.issue35300@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur with Victor. The proposed API change defeats the purpose of the cache. By design, the intent of the cache is to reuse the previously computed value. I can add something like this to the docs: """In general, the LRU cache should only be used when you want to reuse previously computed values. Accordingly, it doesn't make sense to cache functions with side-effects, functions that need to create distinct mutable objects on each call, or impure functions such as time() or random().""" ---------- assignee: -> rhettinger components: +Documentation -Library (Lib) type: behavior -> versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 20:19:45 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 24 Nov 2018 01:19:45 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543022385.12.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- title: Bug with memoization and mutable objects -> Document what functions are suitable for use with the lru_cache _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 20:36:03 2018 From: report at bugs.python.org (INADA Naoki) Date: Sat, 24 Nov 2018 01:36:03 +0000 Subject: [issue35295] Please clarify whether PyUnicode_AsUTF8AndSize() or PyUnicode_AsUTF8String() is preferred In-Reply-To: <1542888764.29.0.788709270274.issue35295@psf.upfronthosting.co.za> Message-ID: <1543023363.42.0.788709270274.issue35295@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 20:37:57 2018 From: report at bugs.python.org (INADA Naoki) Date: Sat, 24 Nov 2018 01:37:57 +0000 Subject: [issue29877] compileall hangs when accessing urandom even if number of workers is 1 In-Reply-To: <1490162236.47.0.103711647228.issue29877@psf.upfronthosting.co.za> Message-ID: <1543023477.68.0.788709270274.issue29877@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 23 23:36:41 2018 From: report at bugs.python.org (Henrik Bengtsson) Date: Sat, 24 Nov 2018 04:36:41 +0000 Subject: [issue35305] subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux) Message-ID: <1543034201.31.0.788709270274.issue35305@psf.upfronthosting.co.za> New submission from Henrik Bengtsson : (originally posted to https://mail.python.org/pipermail/python-list/2018-November/738209.html) I ran into an interesting problem where calling 'subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE)' hangs and never returns. $ python Python 2.7.9 (default, Apr 23 2015, 22:07:47) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> p = subprocess.Popen(['/sbin/ldconfig', '-p'], stdout=subprocess.PIPE) ^CTraceback (most recent call last): File "", line 1, in File "/opt/Python/Python-2.7.9/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/opt/Python/Python-2.7.9/lib/python2.7/subprocess.py", line 1316, in _execute_child data = _eintr_retry_call(os.read, errpipe_read, 1048576) File "/opt/Python/Python-2.7.9/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call return func(*args) KeyboardInterrupt >>> Note how I have to send a user interrupt to break out of 'subprocess.Popen()'. TROUBLESHOOTING: First, it's interesting to note that the following works: >>> import subprocess >>> p = subprocess.Popen(['/sbin/ldconfig -p'], stdout=subprocess.PIPE, shell=True) >>> out,err = p.communicate() >>> len(out) 102460 >>> which I believe is the same as: >>> import subprocess >>> p = subprocess.Popen(['sh', '-c', '/sbin/ldconfig -p'], stdout=subprocess.PIPE) >>> out,err = p.communicate() >>> len(out) 102460 >>> which also works. Second, calling: >>> import subprocess >>> p = subprocess.Popen(['/sbin/ldconfig', '-p']) 1562 libs found in cache `/etc/ld.so.cache' libzmq.so.1 (libc6,x86-64) => /usr/lib64/libzmq.so.1 libz.so.1 (libc6,x86-64) => /lib64/libz.so.1 [ ... all 102,460 bytes of ldconfig -p output ...] ld-linux-x86-64.so.2 (libc6,x86-64) => /lib64/ld-linux-x86-64.so.2 >>> also works, so the PIPE is my main suspect. Finally, if I do: >>> import subprocess >>> p = subprocess.Popen(['/sbin/ldconfig', '-p'], stdout=subprocess.PIPE) [ manually pkill -INT ldconfig' ] >>> out,err = p.communicate() >>> len(out) 65536 >>> then I notice that it reads exactly 65,536=2^16 bytes (out of 102,460 bytes). I suspect this is related to the default buffer-size limit of pipes set by the Linux kernel. Using `strace` on the latter Python process, reveals: [...] open("/opt/Python/Python-2.7.9/lib/python2.7/lib-dynload/cStringIO.so", O_RDONLY) = 6 read(6, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\32\0\0\0\0\0\0"..., 832) = 832 fstat(6, {st_mode=S_IFREG|0755, st_size=49556, ...}) = 0 mmap(NULL, 2115000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 6, 0) = 0x2ad3ca6e7000 mprotect(0x2ad3ca6eb000, 2093056, PROT_NONE) = 0 mmap(0x2ad3ca8ea000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 6, 0x3000) = 0x2ad3ca8ea000 close(6) = 0 close(5) = 0 close(4) = 0 getrlimit(RLIMIT_NOFILE, {rlim_cur=64*1024, rlim_max=64*1024}) = 0 close(3) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad3ca8ec000 write(1, "1\n", 21) = 2 pipe([3, 4]) = 0 fcntl(3, F_GETFD) = 0 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 pipe([5, 6]) = 0 fcntl(5, F_GETFD) = 0 fcntl(5, F_SETFD, FD_CLOEXEC) = 0 fcntl(6, F_GETFD) = 0 fcntl(6, F_SETFD, FD_CLOEXEC) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2ad3c972adf0) = 239074 close(6) = 0 mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad3ca8ed000 read(5, and 'strace' on the stalled 'ldconfig' process reveals: $ strace -p $(pgrep ldconfig) Process 239074 attached - interrupt to quit write(1, "ibgconfmm-2.6.so.1 (libc6,x86-64"..., 4096 RH 6.6 0:- 1:-* 2:-- That latter 'write()' contains the bytes after position 65,536, i.e. bytes 65,537 and beyond (not shown, but verified after careful inspection). MY CONCLUSION: To me, this looks like a deadlock in Popen() itself - is that correct? SESSION INFORMATION: All of the above is with Python 2.7.9 (installed from EPEL), but I can also reproduce it with Python 2.7.15 installed from source. What is also useful to know, is that I'm observing this on a legacy RHEL 6 system *with a customized kernel* part of the Scyld ClusterWare (https://www.penguincomputing.com/products/software/scyld-clusterware/) that *cannot* be updated: $ uname -a Linux n6 2.6.32-504.12.2.el6.664g0000.x86_64 #1 SMP Wed Mar 11 14:20:51 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux I appreciate any suggestions to further troubleshoot this and ideally resolve it. The reason for this being an important issue is that 'find_library()' of ctypes.util performs the above stalling 'Popen(['/sbin/ldconfig', '-p'])' call that was introduced in Python (>= 2.7.13). This happens for instance whenever we try to create a new virtual environment using 'virtualenv'. In other words, the solution is *not* really to change the code to use, say, the shell=True approach. ---------- components: ctypes messages: 330370 nosy: Henrik Bengtsson priority: normal severity: normal status: open title: subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux) versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 00:55:59 2018 From: report at bugs.python.org (jimbo1qaz_ via Gmail) Date: Sat, 24 Nov 2018 05:55:59 +0000 Subject: [issue35306] OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists Message-ID: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> New submission from jimbo1qaz_ via Gmail : I'm writing a program taking paths from user input through CLI. `path` is a pathlib.Path(). Since Windows doesn't expand asterisks, I check if the path doesn't exist. If so I expand using Path().glob(path). Unfortunately on Windows, if `path` (type: Path) contains asterisks, checking `path.exists()` or `path.is_dir()` raises WinError 123. Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from pathlib import Path >>> Path('*').exists() Traceback (most recent call last): File "", line 1, in File "C:\Users\jimbo1qaz\Miniconda3\envs\python37\lib\pathlib.py", line 1318, in exists self.stat() File "C:\Users\jimbo1qaz\Miniconda3\envs\python37\lib\pathlib.py", line 1140, in stat return self._accessor.stat(self) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '*' >>> Path('*').is_dir() Traceback (most recent call last): File "", line 1, in File "C:\Users\jimbo1qaz\Miniconda3\envs\python37\lib\pathlib.py", line 1330, in is_dir return S_ISDIR(self.stat().st_mode) File "C:\Users\jimbo1qaz\Miniconda3\envs\python37\lib\pathlib.py", line 1140, in stat return self._accessor.stat(self) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '*' I also reproduced on Miniconda 3.6.6, 3.7.0, and official Python 3.7.1. According to https://bugs.python.org/issue29827 , os.path.exists() (not Path.exists() ) returns False on any OSError. ----------------- On Linux, checking paths with null bytes (a less common occurrence) raises a different error: >>> import pathlib >>> pathlib.Path("\x00").exists() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/pathlib.py", line 1336, in exists self.stat() File "/usr/lib/python3.6/pathlib.py", line 1158, in stat return self._accessor.stat(self) File "/usr/lib/python3.6/pathlib.py", line 387, in wrapped return strfunc(str(pathobj), *args) ValueError: embedded null byte ---------- components: Library (Lib) messages: 330371 nosy: jimbo1qaz_ priority: normal severity: normal status: open title: OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 03:53:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Nov 2018 08:53:15 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1543049595.64.0.788709270274.issue34160@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am working on adding a canonization support (issue13611 for ElementTree and perhaps separate issue for minidom), but prefer to keep this issue open for the case if this task turns out to be too difficult. Ned, what module is used in your tests for serialization? minidom or ElementTree? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 04:35:12 2018 From: report at bugs.python.org (Jonathan) Date: Sat, 24 Nov 2018 09:35:12 +0000 Subject: [issue35301] python.exe crashes - lzma? In-Reply-To: <1542982873.09.0.788709270274.issue35301@psf.upfronthosting.co.za> Message-ID: <1543052112.96.0.788709270274.issue35301@psf.upfronthosting.co.za> Jonathan added the comment: In total my python.exe process crashed 6 times with the exact same error, compressing about 60,000 pages, so about 1 in 10,000 failed. However, I have ran the same process monthly for the last several months and it has never done that before despite processing mostly the same sites and compressing similar quantities of pages. The code is completely unchanged from last month. Upon reflection, the only thing that has changed since then is that I am now running BOINC (https://boinc.berkeley.edu/) in the background on the machine. So I have just re-ran the entire process with BOINC suspended. Not a single crash! It seems that somehow BOINC and Python are interacting to cause Python to crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 04:36:10 2018 From: report at bugs.python.org (Paul Moore) Date: Sat, 24 Nov 2018 09:36:10 +0000 Subject: [issue28247] Add an option to zipapp to produce a Windows executable In-Reply-To: <1474552529.42.0.627404378819.issue28247@psf.upfronthosting.co.za> Message-ID: <1543052170.14.0.788709270274.issue28247@psf.upfronthosting.co.za> Paul Moore added the comment: While I can see your point, I'm a little skeptical that anyone who's able to write C source code and compile it can't work out how to combine two binary files... :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 05:01:06 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 24 Nov 2018 10:01:06 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1543053666.39.0.788709270274.issue34160@psf.upfronthosting.co.za> Ned Batchelder added the comment: I happen to use xml.dom.minidom, though I didn't mean this to be, "fix Ned's personal problem" :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 05:11:50 2018 From: report at bugs.python.org (HolgerFrey) Date: Sat, 24 Nov 2018 10:11:50 +0000 Subject: [issue35307] Command line help example is missing "--prompt" option Message-ID: <1543054310.5.0.788709270274.issue35307@psf.upfronthosting.co.za> New submission from HolgerFrey : In the documentation of the command line options of the "vent" module, the option "--prompt" is missing: Current text: > [...] > > The command, if run with -h, will show the available options: > > usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] > [--upgrade] [--without-pip] > ENV_DIR [ENV_DIR ...] > > [...] The prompt option is also missing in the rest of the example output output of python3 -m venv -h: > python3 -m venv -h > usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] > [--upgrade] [--without-pip] [--prompt PROMPT] > ENV_DIR [ENV_DIR ...] > [...] ---------- assignee: docs at python components: Documentation messages: 330376 nosy: daftwullie, docs at python priority: normal severity: normal status: open title: Command line help example is missing "--prompt" option type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 10:26:41 2018 From: report at bugs.python.org (Zhiming Wang) Date: Sat, 24 Nov 2018 15:26:41 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected Message-ID: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> New submission from Zhiming Wang : This is a regression in Python 3.7: $ BROWSER=w3m python3.6 -c 'import sys; import webbrowser; print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)' 3.6.7 (default, Nov 24 2018, 09:47:01) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] ['w3m', 'MacOSX', 'chrome', 'firefox', 'safari', 'w3m'] $ BROWSER=w3m python3.7 -c 'import sys; import webbrowser; print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)' 3.7.1 (default, Nov 24 2018, 09:35:18) [Clang 10.0.0 (clang-1000.11.45.5)] ['MacOSX', 'chrome', 'firefox', 'safari', 'w3m', 'w3m'] Note how Python 3.7.1 webbrowser decides to choose MacOSX as the default although BROWSER is explicitly set to w3m. (The above code does not run on Python 3.7.0 due to bpo-31014). This is because of misinterpretation of the `preferred` kwarg when bpo-31014 was fixed. See https://github.com/python/cpython/commit/25b804a9c21c735ce322877f105ebab2539ccfc1#diff-546766353a40839aa72374ecca5b0925R566. Browsers in BROWSER should be registered as `preferred=True` instead. ---------- components: Library (Lib) messages: 330377 nosy: zmwangx priority: normal severity: normal status: open title: webbrowser regression: BROWSER env var not respected type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 10:29:58 2018 From: report at bugs.python.org (Zhiming Wang) Date: Sat, 24 Nov 2018 15:29:58 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543073398.37.0.788709270274.issue35308@psf.upfronthosting.co.za> Change by Zhiming Wang : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 10:36:53 2018 From: report at bugs.python.org (Zhiming Wang) Date: Sat, 24 Nov 2018 15:36:53 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543073813.58.0.788709270274.issue35308@psf.upfronthosting.co.za> Change by Zhiming Wang : ---------- keywords: +patch pull_requests: +9946 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 12:11:36 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 24 Nov 2018 17:11:36 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1536176195.07.0.56676864532.issue34589@psf.upfronthosting.co.za> Message-ID: <1543079496.26.0.788709270274.issue34589@psf.upfronthosting.co.za> Nick Coghlan added the comment: If I've understood https://bugs.python.org/issue35290 and its resolution in https://github.com/python/cpython/commit/f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 correctly, that's a concrete example of why I consider the early coercion approach that avoids any kind of redecoding dance significantly more robust against issues arising from future changes in the CPython startup sequence. I'm away for AWS Re:Invent until Dec 2, but after I get back, I'll finally sit down and take one last pass over this to see if I can come up with a version that Victor is actually willing to review and approve. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 15:16:14 2018 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 24 Nov 2018 20:16:14 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?b?4oaSIGNwYXRo?= Message-ID: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> New submission from Jakub Wilk : It should be "capath", not "cpath", in this warning: DeprecationWarning: cafile, cpath and cadefault are deprecated, use a custom context instead. ---------- components: Library (Lib) messages: 330379 nosy: jwilk priority: normal severity: normal status: open title: Typo in urllib.request warning: cpath ? cpath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 15:16:36 2018 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 24 Nov 2018 20:16:36 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543090596.5.0.788709270274.issue35309@psf.upfronthosting.co.za> Change by Jakub Wilk : ---------- title: Typo in urllib.request warning: cpath ? cpath -> Typo in urllib.request warning: cpath ? capath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 16:47:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 24 Nov 2018 21:47:13 +0000 Subject: [issue25083] Python can sometimes create incorrect .pyc files In-Reply-To: <1442143572.78.0.211523310189.issue25083@psf.upfronthosting.co.za> Message-ID: <1543096033.05.0.788709270274.issue25083@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 18:34:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Sat, 24 Nov 2018 23:34:24 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1543079496.26.0.788709270274.issue34589@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: C locale coercion is just one parameter used to select the Python filesystem enconding. There are many others which are read later during Python initialization, and they are inter-dependent. https://github.com/python/cpython/blob/7f4ba4afd47f21f61de9035544809fc67d136f35/Include/coreconfig.h#L69 I don't see which problem you are trying to solve here. For me, PYTHONCOERCECLOCALE environment variable must be ignored when -I or -E is used, for security reasons and to get more deterministic behavior. So I am opposed to read/enable C locale coercion earlier. That's also why PYTHONMALLOC only change the memory allocator late in the Python initialisation, whereas it would be simpler to read/apply the option earlier. For the FreeBSD CURRENT bug, I recently modified Python to use ASCII if "force ASCII" mode is enabled. I made this change for... HP-UX! On FreeBSD, the filesystem encoding was already ASCII in practice (FreeBSD uses Latin1 but announes ASCII!?). I am not surprised to see bugs on specific configuration with special option (disable UTF-8 mode) :-) I am fixing Unicode bugs on weird cased before 3.0 and we are still not done! Recently I fixed a bug in localeconv() when LC_MONETARY uses a different encoding than LC_CTYPE... Such config sounds like a bad choice, but well, it "works" on Python2... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 19:59:11 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 25 Nov 2018 00:59:11 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543107551.77.0.788709270274.issue35300@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The proposed addition looks good to me. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 22:06:48 2018 From: report at bugs.python.org (John Hiatt) Date: Sun, 25 Nov 2018 03:06:48 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543115208.03.0.788709270274.issue35309@psf.upfronthosting.co.za> John Hiatt added the comment: I fixed this. Can you help me get it into the official repository? ---------- nosy: +hiaji _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 24 22:21:03 2018 From: report at bugs.python.org (Martin Panter) Date: Sun, 25 Nov 2018 03:21:03 +0000 Subject: [issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API In-Reply-To: <1542306291.56.0.788709270274.issue35259@psf.upfronthosting.co.za> Message-ID: <1543116063.41.0.788709270274.issue35259@psf.upfronthosting.co.za> Martin Panter added the comment: I added the Py_FinalizeEx API in Issue 5319, but was relying on input from others about dealing with Py_LIMITED_API. After reading the documentation , I now see that the function would be considered part of the limited API because its documentation doesn?t say otherwise. So Arthur?s resolution is correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 02:51:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Nov 2018 07:51:22 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543132282.04.0.788709270274.issue32035@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4bb186d7e253ad4def875305e06690181e923dfd by Serhiy Storchaka in branch 'master': bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) https://github.com/python/cpython/commit/4bb186d7e253ad4def875305e06690181e923dfd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 02:51:48 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 07:51:48 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543132308.35.0.788709270274.issue32035@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 02:52:02 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 07:52:02 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543132322.37.0.788709270274.issue32035@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 04:29:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Nov 2018 09:29:41 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1543138181.3.0.788709270274.issue31241@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am not sure what parts of this PR should be backported if either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 04:30:49 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 09:30:49 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543138249.48.0.788709270274.issue32035@psf.upfronthosting.co.za> miss-islington added the comment: New changeset af009fbcdb00fffced653792eb7af6b72f2521e3 by Miss Islington (bot) in branch '3.6': bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) https://github.com/python/cpython/commit/af009fbcdb00fffced653792eb7af6b72f2521e3 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 04:30:49 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 09:30:49 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543138249.48.0.788709270274.issue32035@psf.upfronthosting.co.za> miss-islington added the comment: New changeset af009fbcdb00fffced653792eb7af6b72f2521e3 by Miss Islington (bot) in branch '3.6': bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) https://github.com/python/cpython/commit/af009fbcdb00fffced653792eb7af6b72f2521e3 ---------- nosy: +miss-islington, miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 04:30:49 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 09:30:49 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543138249.66.0.788709270274.issue32035@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 89a3087d40feed3ca78033319389437bb4b5bcd7 by Miss Islington (bot) in branch '3.7': bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) https://github.com/python/cpython/commit/89a3087d40feed3ca78033319389437bb4b5bcd7 ---------- nosy: +miss-islington, miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 05:16:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Nov 2018 10:16:20 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1543140980.57.0.788709270274.issue32035@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 06:51:04 2018 From: report at bugs.python.org (Roundup Robot) Date: Sun, 25 Nov 2018 11:51:04 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1543146664.24.0.788709270274.issue35148@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 08:19:06 2018 From: report at bugs.python.org (Brian Maissy) Date: Sun, 25 Nov 2018 13:19:06 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed Message-ID: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> New submission from Brian Maissy : If a call to select.select() was interrupted by a signal and the select syscall set an errno of EINTR, then under PEP 475 the select call should be re-executed. If, however, there is a signal handler which takes enough time that the select's timeout expires, select() is not retried, and the rlist is returned as-is (with fds in it which are not ready for reading). Under this condition, either select() should be re-run with a timeout of 0, or the fd lists should be emptied before returning. Example code which reproduces the problem attached. ---------- files: select_eintr.py messages: 330388 nosy: Brian Maissy priority: normal severity: normal status: open title: select which was interrupted by EINTR isn't re-run if the timeout has passed type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47945/select_eintr.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 08:22:50 2018 From: report at bugs.python.org (Brian Maissy) Date: Sun, 25 Nov 2018 13:22:50 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543152170.01.0.788709270274.issue35310@psf.upfronthosting.co.za> Brian Maissy added the comment: I believe the offending line in the source is this break statement: https://github.com/python/cpython/blob/master/Modules/selectmodule.c#L339 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 08:34:21 2018 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Sun, 25 Nov 2018 13:34:21 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543152861.71.0.788709270274.issue35309@psf.upfronthosting.co.za> Bo?tjan Mejak added the comment: Created a PR based on this issue. See: https://github.com/python/cpython/pull/10699 ---------- nosy: +PedanticHacker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 08:35:15 2018 From: report at bugs.python.org (Mike Pagel) Date: Sun, 25 Nov 2018 13:35:15 +0000 Subject: [issue35148] cannot activate a venv environment on a Swiss German windows In-Reply-To: <1541176783.96.0.788709270274.issue35148@psf.upfronthosting.co.za> Message-ID: <1543152915.69.0.788709270274.issue35148@psf.upfronthosting.co.za> Change by Mike Pagel : ---------- nosy: +mpagel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 09:46:24 2018 From: report at bugs.python.org (Oran Avraham) Date: Sun, 25 Nov 2018 14:46:24 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543157184.75.0.788709270274.issue35310@psf.upfronthosting.co.za> Change by Oran Avraham : ---------- keywords: +patch pull_requests: +9951 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 13:31:21 2018 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Sun, 25 Nov 2018 18:31:21 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543170680.99.0.788709270274.issue35309@psf.upfronthosting.co.za> Change by Bo?tjan Mejak : ---------- keywords: +patch pull_requests: +9952 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 13:32:52 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 18:32:52 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543170772.65.0.788709270274.issue35309@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 158695817d736df8b18682866033c87e46252309 by Benjamin Peterson (Bo?tjan Mejak) in branch 'master': closes bpo-35309: cpath should be capath (GH-10699) https://github.com/python/cpython/commit/158695817d736df8b18682866033c87e46252309 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 13:33:07 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 18:33:07 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543170787.44.0.788709270274.issue35309@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 13:33:15 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Nov 2018 18:33:15 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543170795.59.0.788709270274.issue35309@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9954 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 14:47:29 2018 From: report at bugs.python.org (Robert Pollak) Date: Sun, 25 Nov 2018 19:47:29 +0000 Subject: [issue35145] sqlite3: optionally autoconvert table_info's DATETIME fields In-Reply-To: <1541160984.12.0.788709270274.issue35145@psf.upfronthosting.co.za> Message-ID: <1543175249.38.0.788709270274.issue35145@psf.upfronthosting.co.za> Robert Pollak added the comment: So my workaround is of course ``` table = pd.read_sql_query('select * from table', con) column_type = pd.read_sql_query('PRAGMA table_info("table")', con)['type'] datetimes = table.columns[column_type == 'DATETIME'] table.loc[:, datetimes] = table.loc[:, datetimes].apply(pd.to_datetime) ``` I would be interested in creating a pull request for the `detect_types=CONVERT_DATETIME` argument that I described. Is there any chance to get that merged? I currently see 541 open cpython pull requests labeled "awaiting review" :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 15:32:24 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 25 Nov 2018 20:32:24 +0000 Subject: [issue35306] OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1543177944.5.0.788709270274.issue35306@psf.upfronthosting.co.za> Eryk Sun added the comment: Path.exists should ignore all OSError exceptions, as os.path.exists does. Barring that, I suppose for Windows we could add EINVAL to IGNORED_ERROS. The problem with ValueError was already addressed in issue 33721. ---------- components: +Windows nosy: +eryksun, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 15:50:50 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 20:50:50 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543179050.47.0.788709270274.issue35309@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 8c1592e53a8981451f59050198da34a584160b4e by Benjamin Peterson (Miss Islington (bot)) in branch '3.6': closes bpo-35309: cpath should be capath (GH-10702) https://github.com/python/cpython/commit/8c1592e53a8981451f59050198da34a584160b4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 15:51:04 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 20:51:04 +0000 Subject: =?utf-8?q?=5Bissue35309=5D_Typo_in_urllib=2Erequest_warning=3A_cpath_?= =?utf-8?q?=E2=86=92_capath?= In-Reply-To: <1543090574.86.0.788709270274.issue35309@psf.upfronthosting.co.za> Message-ID: <1543179064.93.0.788709270274.issue35309@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 6a528ccb4c09933c434be1011b2f5e148170d3a1 by Benjamin Peterson (Miss Islington (bot)) in branch '3.7': closes bpo-35309: cpath should be capath (GH-10701) https://github.com/python/cpython/commit/6a528ccb4c09933c434be1011b2f5e148170d3a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:02:05 2018 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 25 Nov 2018 22:02:05 +0000 Subject: [issue35311] exception unpickling error causes `multiprocessing.Pool` to hang forever Message-ID: <1543183325.55.0.788709270274.issue35311@psf.upfronthosting.co.za> New submission from Anthony Sottile : ``` import multiprocessing class E(Exception): def __init__(self, a1, a2): Exception.__init__(self, '{}{}'.format(a1, a2)) def f(_): raise E(1, 2) multiprocessing.Pool(1).map(f, (1,)) ``` Running this causes a hang: ``` $ python3.7 t2.py Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.7/multiprocessing/pool.py", line 496, in _handle_results task = get() File "/usr/lib/python3.7/multiprocessing/contrnection.py", line 251, in recv return _ForkingPickler.loads(buf.getbuffer()) TypeError: __init__() missing 1 required positional argument: 'a2' ``` Upon eventual `^C` ``` ^CTraceback (most recent call last): Process ForkPoolWorker-1: File "t2.py", line 10, in multiprocessing.Pool(1).map(f, (1,)) File "/usr/lib/python3.7/multiprocessing/pool.py", line 290, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/lib/python3.7/multiprocessing/pool.py", line 677, in get self.wait(timeout) File "/usr/lib/python3.7/multiprocessing/pool.py", line 674, in wait Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.7/multiprocessing/pool.py", line 110, in worker task = get() File "/usr/lib/python3.7/multiprocessing/queues.py", line 352, in get res = self._reader.recv_bytes() File "/usr/lib/python3.7/multiprocessing/connection.py", line 216, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/lib/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes buf = self._recv(4) File "/usr/lib/python3.7/multiprocessing/connection.py", line 379, in _recv chunk = read(handle, remaining) KeyboardInterrupt self._event.wait(timeout) File "/usr/lib/python3.7/threading.py", line 552, in wait signaled = self._cond.wait(timeout) File "/usr/lib/python3.7/threading.py", line 296, in wait waiter.acquire() KeyboardInterrupt Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/util.py", line 265, in _run_finalizers finalizer() File "/usr/lib/python3.7/multiprocessing/util.py", line 189, in __call__ res = self._callback(*self._args, **self._kwargs) File "/usr/lib/python3.7/multiprocessing/pool.py", line 611, in _terminate_pool "Cannot have cache with result_hander not alive") AssertionError: Cannot have cache with result_hander not alive ``` (I've also tried this against master at 158695817d736df8b18682866033c87e46252309) ---------- components: Library (Lib) messages: 330397 nosy: Anthony Sottile priority: normal severity: normal status: open title: exception unpickling error causes `multiprocessing.Pool` to hang forever versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:07:36 2018 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 25 Nov 2018 22:07:36 +0000 Subject: [issue35311] exception unpickling error causes `multiprocessing.Pool` to hang forever In-Reply-To: <1543183325.55.0.788709270274.issue35311@psf.upfronthosting.co.za> Message-ID: <1543183656.09.0.788709270274.issue35311@psf.upfronthosting.co.za> Anthony Sottile added the comment: `concurrent.futures` is affected as well: ``` import concurrent.futures class E(Exception): def __init__(self, a1, a2): Exception.__init__(self, '{}{}'.format(a1, a2)) def f(_): raise E(1, 2) with concurrent.futures.ProcessPoolExecutor(2) as exe: for _ in exe.map(f, (1,)): pass ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:17:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 25 Nov 2018 22:17:29 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1543184249.85.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:30:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 25 Nov 2018 22:30:35 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1543185035.55.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8ac6539d85b481fc6b5e9145446b07e591b2caba by Victor Stinner in branch 'master': bpo-35081: Add _PyTuple_CAST() (GH-10704) https://github.com/python/cpython/commit/8ac6539d85b481fc6b5e9145446b07e591b2caba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:31:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 25 Nov 2018 22:31:51 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1543185111.85.0.788709270274.issue35081@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 17:56:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Sun, 25 Nov 2018 22:56:20 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1543186580.58.0.788709270274.issue35081@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ec13b9322d95a651606219469fc7b7e9c977f248 by Victor Stinner in branch 'master': bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705) https://github.com/python/cpython/commit/ec13b9322d95a651606219469fc7b7e9c977f248 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 19:19:19 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 00:19:19 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543191559.02.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +9957 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 19:24:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 00:24:55 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543191895.09.0.788709270274.issue35300@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f0e0f2008d160cdd7e5bc02ea61c43f8c7b2b82f by Miss Islington (bot) (Raymond Hettinger) in branch 'master': bpo-35300: Add usage note to the lru_cache() docs (GH-10707) https://github.com/python/cpython/commit/f0e0f2008d160cdd7e5bc02ea61c43f8c7b2b82f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 19:25:06 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 00:25:06 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543191906.32.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 19:25:16 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 00:25:16 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543191916.85.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 20:00:44 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 01:00:44 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543194044.73.0.788709270274.issue35300@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset c7074007272f257a0efab76f03e6b400c30a51b4 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708) https://github.com/python/cpython/commit/c7074007272f257a0efab76f03e6b400c30a51b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 20:01:11 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 01:01:11 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543194071.94.0.788709270274.issue35300@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 6c12091ca67e8ec2960652ef7a763d0de772f799 by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10709) https://github.com/python/cpython/commit/6c12091ca67e8ec2960652ef7a763d0de772f799 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 20:01:31 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 01:01:31 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543194091.97.0.788709270274.issue35300@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 23:03:58 2018 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 26 Nov 2018 04:03:58 +0000 Subject: [issue35312] lib2to3.pgen2.parser.ParseError is not roundtrip pickleable Message-ID: <1543205038.25.0.788709270274.issue35312@psf.upfronthosting.co.za> New submission from Anthony Sottile : related to https://bugs.python.org/issue35311 encountered here: https://gitlab.com/pycqa/flake8/issues/473 minimal reproduction: class TestPickleableException(unittest.TestCase): def test_ParseError(self): err = ParseError('msg', 2, None, (1, 'context')) err2 = pickle.loads(pickle.dumps(err)) self.assertEqual(vars(err), vars(err2)) ====================================================================== ERROR: test_ParseError (lib2to3.tests.test_parser.TestPickleableException) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/asottile/workspace/cpython/Lib/lib2to3/tests/test_parser.py", line 628, in test_ParseError err2 = pickle.loads(pickle.dumps(err)) TypeError: __init__() missing 3 required positional arguments: 'type', 'value', and 'context' ---------- components: Library (Lib) messages: 330404 nosy: Anthony Sottile priority: normal severity: normal status: open title: lib2to3.pgen2.parser.ParseError is not roundtrip pickleable versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 23:06:05 2018 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 26 Nov 2018 04:06:05 +0000 Subject: [issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable In-Reply-To: <1543205038.25.0.788709270274.issue35312@psf.upfronthosting.co.za> Message-ID: <1543205165.33.0.788709270274.issue35312@psf.upfronthosting.co.za> Change by Anthony Sottile : ---------- title: lib2to3.pgen2.parser.ParseError is not roundtrip pickleable -> lib2to3.pgen2.parse.ParseError is not roundtrip pickleable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 25 23:09:35 2018 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 26 Nov 2018 04:09:35 +0000 Subject: [issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable In-Reply-To: <1543205038.25.0.788709270274.issue35312@psf.upfronthosting.co.za> Message-ID: <1543205375.18.0.788709270274.issue35312@psf.upfronthosting.co.za> Change by Anthony Sottile : ---------- keywords: +patch pull_requests: +9960 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 01:28:43 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 26 Nov 2018 06:28:43 +0000 Subject: [issue35307] Command line help example is missing "--prompt" option In-Reply-To: <1543054310.5.0.788709270274.issue35307@psf.upfronthosting.co.za> Message-ID: <1543213723.05.0.788709270274.issue35307@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks for the report. Would you like to propose a PR for this? I think this is an easy issue where the new help string for --help needs to be updated at https://github.com/python/cpython/blob/master/Doc/using/venv-create.inc ---------- nosy: +vinay.sajip, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 02:41:09 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 26 Nov 2018 07:41:09 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment Message-ID: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> New submission from Karthikeyan Singaravelan : I noticed GCC related test always failing in Travis but it's optional and builds were always green. It's consistent and related to test_embed. It seems that the tests are ran from a virtual environment for GCC that causes some difference in the prefix for the new tests added in test_embed. With virtual environment prefix points to virtual environment path and not to /usr/local. Other tests are ran with built CPython and not with virtual environment hence tests pass. To reproduce this build CPython and activate a virtual environment to run test_embed under the virtual environment. I thought to file it anyway as reference and I don't know if the tests need to be fixed or Travis config. Sample failure in Travis : https://travis-ci.org/tirkarthi/cpython/builds/459615265 cpython git:(test_embed_travis) ./python.exe -m venv test_venv cpython git:(test_embed_travis) ./test_venv/bin/python -m test --fail-env-changed -v test.test_embed == CPython 3.8.0a0 (heads/master:f0e0f2008d, Nov 26 2018, 11:08:07) [Clang 7.0.2 (clang-700.1.81)] == Darwin-14.4.0-x86_64-i386-64bit little-endian == cwd: /Users/karthikeyansingaravelan/stuff/python/cpython/build/test_python_11655 == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 2.40 [1/1] test.test_embed test_bpo20891 (test.test_embed.EmbeddingTests) ... ok test_forced_io_encoding (test.test_embed.EmbeddingTests) ... ok test_initialize_pymain (test.test_embed.EmbeddingTests) ... ok test_initialize_twice (test.test_embed.EmbeddingTests) ... ok test_pre_initialization_api (test.test_embed.EmbeddingTests) ... ok test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) ... ok test_subinterps_different_ids (test.test_embed.EmbeddingTests) ... ok test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ... ok test_subinterps_main (test.test_embed.EmbeddingTests) ... ok test_init_default_config (test.test_embed.InitConfigTests) ... FAIL test_init_dev_mode (test.test_embed.InitConfigTests) ... FAIL test_init_env (test.test_embed.InitConfigTests) ... FAIL test_init_from_config (test.test_embed.InitConfigTests) ... FAIL test_init_global_config (test.test_embed.InitConfigTests) ... FAIL test_init_isolated (test.test_embed.InitConfigTests) ... FAIL ====================================================================== FAIL: test_init_default_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 488, in test_init_default_config self.check_config("init_default_config", {}) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[248 chars] 0, 'coerce_c_locale': 0, 'coerce_c_locale_war[722 chars]': 0} != {'ins[248 chars] 0, 'filesystem_encoding': 'utf-8', 'filesyste[824 chars]': 0} {'_check_hash_pycs_mode': 'default', '_frozen': 0, '_install_importlib': 1, 'allocator': None, 'argv': [], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 0, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_path_env': None, 'optimization_level': 0, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': None, 'program_name': './_testembed', 'pycache_prefix': None, 'quiet': 0, 'show_alloc_count': 0, 'show_ref_count': 0, 'site_import': 1, 'stdio_encoding': 'utf-8', 'stdio_errors': 'strict', 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'utf8_mode': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_dev_mode (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 586, in test_init_dev_mode self.check_config("init_dev_mode", config) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[251 chars] 0, 'coerce_c_locale': 0, 'coerce_c_locale_war[722 chars]': 0} != {'ins[251 chars] 0, 'filesystem_encoding': 'utf-8', 'filesyste[824 chars]': 0} {'_check_hash_pycs_mode': 'default', '_frozen': 0, '_install_importlib': 1, 'allocator': 'debug', 'argv': [], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 1, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 1, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_path_env': None, 'optimization_level': 0, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': None, 'program_name': './_testembed', 'pycache_prefix': None, 'quiet': 0, 'show_alloc_count': 0, 'show_ref_count': 0, 'site_import': 1, 'stdio_encoding': 'utf-8', 'stdio_errors': 'strict', 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'utf8_mode': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_env (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 578, in test_init_env self.check_config("init_env", config) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[259 chars] 1, 'coerce_c_locale': 0, 'coerce_c_locale_war[743 chars]': 0} != {'ins[259 chars] 1, 'filesystem_encoding': 'utf-8', 'filesyste[845 chars]': 0} {'_check_hash_pycs_mode': 'default', '_frozen': 0, '_install_importlib': 1, 'allocator': 'malloc_debug', 'argv': [], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 0, 'bytes_warning': 0, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 1, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 1, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 42, 'home': None, 'import_time': 1, 'inspect': 1, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 1, 'module_search_path_env': None, 'optimization_level': 2, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': None, 'program_name': './_testembed', 'pycache_prefix': 'env_pycache_prefix', 'quiet': 0, 'show_alloc_count': 0, 'show_ref_count': 0, 'site_import': 1, 'stdio_encoding': 'iso8859-1', 'stdio_errors': 'replace', 'tracemalloc': 2, 'use_environment': 1, 'use_hash_seed': 1, 'user_site_directory': 0, 'utf8_mode': 1, 'verbose': 1, 'warnoptions': [], 'write_bytecode': 0, 'xoptions': []} ====================================================================== FAIL: test_init_from_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 553, in test_init_from_config self.check_config("init_from_config", config) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[260 chars] 1, 'coerce_c_locale': 0, 'coerce_c_locale_war[859 chars]': 1} != {'ins[260 chars] 1, 'filesystem_encoding': 'utf-8', 'filesyste[961 chars]': 1} {'_check_hash_pycs_mode': 'always', '_frozen': 1, '_install_importlib': 1, 'allocator': 'malloc_debug', 'argv': ['-c', 'pass'], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 0, 'bytes_warning': 1, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 1, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 123, 'home': None, 'import_time': 1, 'inspect': 1, 'install_signal_handlers': 0, 'interactive': 1, 'isolated': 0, 'malloc_stats': 1, 'module_search_path_env': None, 'optimization_level': 2, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': 'conf_program', 'program_name': './conf_program_name', 'pycache_prefix': 'conf_pycache_prefix', 'quiet': 1, 'show_alloc_count': 1, 'show_ref_count': 1, 'site_import': 0, 'stdio_encoding': 'iso8859-1', 'stdio_errors': 'replace', 'tracemalloc': 2, 'use_environment': 1, 'use_hash_seed': 1, 'user_site_directory': 0, 'utf8_mode': 1, 'verbose': 1, 'warnoptions': ['default', 'error::ResourceWarning'], 'write_bytecode': 0, 'xoptions': ['core_xoption1=3', 'core_xoption2=', 'core_xoption3']} ====================================================================== FAIL: test_init_global_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 511, in test_init_global_config self.check_config("init_global_config", config) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[248 chars] 0, 'coerce_c_locale': 0, 'coerce_c_locale_war[730 chars]': 1} != {'ins[248 chars] 0, 'filesystem_encoding': 'utf-8', 'filesyste[832 chars]': 1} {'_check_hash_pycs_mode': 'default', '_frozen': 1, '_install_importlib': 1, 'allocator': None, 'argv': [], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 0, 'bytes_warning': 1, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 0, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 1, 'install_signal_handlers': 1, 'interactive': 1, 'isolated': 0, 'malloc_stats': 0, 'module_search_path_env': None, 'optimization_level': 2, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': None, 'program_name': './globalvar', 'pycache_prefix': None, 'quiet': 1, 'show_alloc_count': 0, 'show_ref_count': 0, 'site_import': 0, 'stdio_encoding': 'utf-8', 'stdio_errors': 'surrogateescape', 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 0, 'utf8_mode': 1, 'verbose': 1, 'warnoptions': [], 'write_bytecode': 0, 'xoptions': []} ====================================================================== FAIL: test_init_isolated (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 594, in test_init_isolated self.check_config("init_isolated", config) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 483, in check_config self.check_core_config(config, expected, env) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_embed.py", line 450, in check_core_config self.assertEqual(core_config, expected) AssertionError: {'ins[248 chars] 0, 'coerce_c_locale': 0, 'coerce_c_locale_war[722 chars]': 0} != {'ins[248 chars] 0, 'filesystem_encoding': 'utf-8', 'filesyste[824 chars]': 0} {'_check_hash_pycs_mode': 'default', '_frozen': 0, '_install_importlib': 1, 'allocator': None, 'argv': [], 'base_exec_prefix': '/usr/local', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'coerce_c_locale': 0, 'coerce_c_locale_warn': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/usr/local', + 'exec_prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'faulthandler': 0, 'filesystem_encoding': 'utf-8', 'filesystem_errors': 'surrogateescape', 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 1, 'malloc_stats': 0, 'module_search_path_env': None, 'optimization_level': 0, 'parser_debug': 0, - 'prefix': '/usr/local', + 'prefix': '/Users/karthikeyansingaravelan/stuff/python/cpython/test_venv', 'program': None, 'program_name': './_testembed', 'pycache_prefix': None, 'quiet': 0, 'show_alloc_count': 0, 'show_ref_count': 0, 'site_import': 1, 'stdio_encoding': 'utf-8', 'stdio_errors': 'strict', 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'utf8_mode': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ---------------------------------------------------------------------- Ran 15 tests in 11.761s FAILED (failures=6) test test.test_embed failed test.test_embed failed == Tests result: FAILURE == 1 test failed: test.test_embed Total duration: 11 sec 931 ms Tests result: FAILURE ---------- components: Tests messages: 330406 nosy: pablogsal, vstinner, xtreak priority: normal severity: normal status: open title: test_embed fails in travis CI when tests are executed from a virtual environment versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 03:39:10 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 26 Nov 2018 08:39:10 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1543221550.57.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by Julien Palard : ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 04:14:21 2018 From: report at bugs.python.org (Roundup Robot) Date: Mon, 26 Nov 2018 09:14:21 +0000 Subject: [issue35307] Command line help example is missing "--prompt" option In-Reply-To: <1543054310.5.0.788709270274.issue35307@psf.upfronthosting.co.za> Message-ID: <1543223661.88.0.788709270274.issue35307@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +9961 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 04:41:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 09:41:37 +0000 Subject: [issue34212] Cygwin link failure with builtin modules since issue30860 In-Reply-To: <1532452252.87.0.56676864532.issue34212@psf.upfronthosting.co.za> Message-ID: <1543225297.65.0.788709270274.issue34212@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 04:57:36 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 26 Nov 2018 09:57:36 +0000 Subject: [issue35305] subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux) In-Reply-To: <1543034201.31.0.788709270274.issue35305@psf.upfronthosting.co.za> Message-ID: <1543226256.83.0.788709270274.issue35305@psf.upfronthosting.co.za> INADA Naoki added the comment: > What is also useful to know, is that I'm observing this on a legacy RHEL 6 system *with a customized kernel* part of the Scyld ClusterWare (https://www.penguincomputing.com/products/software/scyld-clusterware/) that *cannot* be updated: Do you mean this trouble is happened only on the system? Or can this trouble be reproducible on normal Linux kernel? --- I think there are no bug in Python. See this part of your strace ``` pipe([5, 6]) = 0 fcntl(5, F_GETFD) = 0 fcntl(5, F_SETFD, FD_CLOEXEC) = 0 fcntl(6, F_GETFD) = 0 fcntl(6, F_SETFD, FD_CLOEXEC) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2ad3c972adf0) = 239074 close(6) = 0 mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad3ca8ed000 read(5, ``` Python creates pipe [5, 6], and set FD_CLOEXEC flag to them. When `exec` in child process succeeded, these FDs must be closed by Linux kernel. Then, `read(5,` in parent process must not be blocked. It must return 0 soon. So I think there are some bug in your kernel, relating to CLOEXEC. I am not interested in this issue much because 2.6.32 is too old to me and I never used "Scyld ClusterWare". Maybe, you can consult with the company. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:08:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:08:36 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543226916.96.0.788709270274.issue35313@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9962 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:10:01 2018 From: report at bugs.python.org (Kevin Funk) Date: Mon, 26 Nov 2018 10:10:01 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1543227001.52.0.788709270274.issue8978@psf.upfronthosting.co.za> Kevin Funk added the comment: I just ran into this, under Python 3.6. IMHO, the error message should be improved, even when the mode was not passed explicitly. Can someone reopen this? ---------- nosy: +kfunk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:11:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:11:33 +0000 Subject: [issue35305] subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux) In-Reply-To: <1543034201.31.0.788709270274.issue35305@psf.upfronthosting.co.za> Message-ID: <1543227093.78.0.788709270274.issue35305@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:12:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:12:01 +0000 Subject: [issue35305] subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux) In-Reply-To: <1543034201.31.0.788709270274.issue35305@psf.upfronthosting.co.za> Message-ID: <1543227121.24.0.788709270274.issue35305@psf.upfronthosting.co.za> STINNER Victor added the comment: Are you able to reproduce the issue with Python 3? Can you please also try http://pypi.org/project/subprocess32/? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:14:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:14:45 +0000 Subject: [issue35300] Document what functions are suitable for use with the lru_cache In-Reply-To: <1542973998.98.0.788709270274.issue35300@psf.upfronthosting.co.za> Message-ID: <1543227285.17.0.788709270274.issue35300@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Raymond, I concur that updating the doc is the proper fix :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:16:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:16:17 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1543227377.84.0.788709270274.issue8978@psf.upfronthosting.co.za> STINNER Victor added the comment: > I just ran into this, under Python 3.6. How did you install Python? What is your OS? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:17:48 2018 From: report at bugs.python.org (Martin Panter) Date: Mon, 26 Nov 2018 10:17:48 +0000 Subject: [issue14418] Document differences in SocketServer between Python 2.6 and 2.7 In-Reply-To: <1332795225.64.0.202093290254.issue14418@psf.upfronthosting.co.za> Message-ID: <1543227468.43.0.788709270274.issue14418@psf.upfronthosting.co.za> Martin Panter added the comment: Regarding the first point, ?finish? is no longer called after an exception. This was apparently changed in 2.7.4 (see Issue 14574), but Geoffrey was referring to older documentation. Regarding the second point, about ECONNRESET vs graceful shutdown, this seems to be due to the ?shutdown? call added to in ?TCPServer.close_request? in Issue 6267. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:24:16 2018 From: report at bugs.python.org (Kevin Funk) Date: Mon, 26 Nov 2018 10:24:16 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1543227856.56.0.788709270274.issue8978@psf.upfronthosting.co.za> Kevin Funk added the comment: It's Python 3.6 from CentOS 6. In my particular case I'm lacking the lzma module. But for figuring that out I had to add the explicit modes to the `tarfile.open` calls in my Python script. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:31:23 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 26 Nov 2018 10:31:23 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1543228283.85.0.788709270274.issue35227@psf.upfronthosting.co.za> Change by R?mi Lapeyre : ---------- keywords: +patch pull_requests: +9963 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:32:46 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 26 Nov 2018 10:32:46 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1543228366.89.0.788709270274.issue35227@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: Hi @mgorny, the changeset in PR 10714 should do what you are looking for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:35:32 2018 From: report at bugs.python.org (Kevin Funk) Date: Mon, 26 Nov 2018 10:35:32 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1543228532.23.0.788709270274.issue8978@psf.upfronthosting.co.za> Kevin Funk added the comment: (Sorry: I just noticed the Python 3.6 I'm using is /not/ from distro packages. The issue remains, though, the Python exception could be more descriptive.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:54:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 10:54:16 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543229656.63.0.788709270274.issue35313@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a6537fb7c2f7a007b4ab616c4617afd56d18347d by Victor Stinner in branch 'master': bpo-35313: Fix test_embed when run from venv (GH-10713) https://github.com/python/cpython/commit/a6537fb7c2f7a007b4ab616c4617afd56d18347d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 05:58:12 2018 From: report at bugs.python.org (Cyker Way) Date: Mon, 26 Nov 2018 10:58:12 +0000 Subject: [issue35314] fnmatch failed with leading caret (^) Message-ID: <1543229892.22.0.788709270274.issue35314@psf.upfronthosting.co.za> New submission from Cyker Way : In short, `fnmatch.fnmatch` doesn't match shell result. To test this, create a dir with 2 files: `a.py` and `b.py`. Then `ls [!b].py` and `ls [^b].py` will both show `a.py`. However, `fnmatch.fnmatch('a.py', '[!b].py')` returns `True` but `fnmatch.fnmatch('a.py', '[^b].py')` returns `False`. Problem seems to come from an escaped caret: https://github.com/python/cpython/blob/master/Lib/fnmatch.py#L124 I don't see why caret and exclamation mark are different from `man bash`: > ...If the first character following the [ is a ! or a ^ then any character not enclosed is matched... Could someone please confirm it's a bug or intended behavior? ---------- components: Library (Lib) messages: 330417 nosy: cykerway priority: normal severity: normal status: open title: fnmatch failed with leading caret (^) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:03:31 2018 From: report at bugs.python.org (Ruchi kumari) Date: Mon, 26 Nov 2018 11:03:31 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 Message-ID: <1543230211.24.0.788709270274.issue35315@psf.upfronthosting.co.za> New submission from Ruchi kumari : Regularly getting segmentation fault (core dumped) while trying to install Python3.5.2. Also seeing the following warning while doing ./configure configure: WARNING: linux/random.h: present but cannot be compiled configure: WARNING: linux/random.h: check for missing prerequisite headers? configure: WARNING: linux/random.h: see the Autoconf documentation configure: WARNING: linux/random.h: section "Present But Cannot Be Compiled" configure: WARNING: linux/random.h: proceeding with the compiler's result ---------- messages: 330418 nosy: Ruchi kumari priority: normal severity: normal status: open title: Error (Segmentation fault - core dumped) while installing Python3.5.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:06:34 2018 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Nov 2018 11:06:34 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 In-Reply-To: <1543230211.24.0.788709270274.issue35315@psf.upfronthosting.co.za> Message-ID: <1543230394.92.0.788709270274.issue35315@psf.upfronthosting.co.za> Christian Heimes added the comment: Python 3.5.2 is no longer supported. The latset 3.5 release is https://www.python.org/downloads/release/python-356/. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:08:50 2018 From: report at bugs.python.org (Ruchi kumari) Date: Mon, 26 Nov 2018 11:08:50 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 In-Reply-To: <1543230394.92.0.788709270274.issue35315@psf.upfronthosting.co.za> Message-ID: Ruchi kumari added the comment: Does Python3.5.6 has inbuilt installed modules like requests etc. On Mon, Nov 26, 2018, 16:36 Christian Heimes > Christian Heimes added the comment: > > Python 3.5.2 is no longer supported. The latset 3.5 release is > https://www.python.org/downloads/release/python-356/. > > ---------- > nosy: +christian.heimes > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:16:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 11:16:38 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543230998.11.0.788709270274.issue35313@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:17:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 11:17:20 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543231040.69.0.788709270274.issue35313@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:18:48 2018 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Nov 2018 11:18:48 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 In-Reply-To: <1543230211.24.0.788709270274.issue35315@psf.upfronthosting.co.za> Message-ID: <1543231128.02.0.788709270274.issue35315@psf.upfronthosting.co.za> Christian Heimes added the comment: No, requests is developed and shipped by a different team. No version of Python from python.org has requests pre-installed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:35:33 2018 From: report at bugs.python.org (Ruchi kumari) Date: Mon, 26 Nov 2018 11:35:33 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 In-Reply-To: <1543231128.02.0.788709270274.issue35315@psf.upfronthosting.co.za> Message-ID: Ruchi kumari added the comment: What about modules like urllib3 etc. On Mon, Nov 26, 2018, 16:48 Christian Heimes > Christian Heimes added the comment: > > No, requests is developed and shipped by a different team. No version of > Python from python.org has requests pre-installed. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:37:36 2018 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Nov 2018 11:37:36 +0000 Subject: [issue35315] Error (Segmentation fault - core dumped) while installing Python3.5.2 In-Reply-To: <1543230211.24.0.788709270274.issue35315@psf.upfronthosting.co.za> Message-ID: <1543232256.45.0.788709270274.issue35315@psf.upfronthosting.co.za> Christian Heimes added the comment: bugs.python.org is a bug tracker, not a support forum. Please use the Python mailing list https://www.python.org/community/lists/. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:37:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 11:37:37 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543232257.47.0.788709270274.issue35313@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f0b366a8d7e0f12d4448f570e990de414f4afca7 by Victor Stinner in branch 'master': bpo-35313: Cleanup test_embed.py (GH-10716) https://github.com/python/cpython/commit/f0b366a8d7e0f12d4448f570e990de414f4afca7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:38:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 11:38:04 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543232284.45.0.788709270274.issue35313@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks for the bug report, it should now be fixed :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 06:42:09 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 11:42:09 +0000 Subject: [issue35313] test_embed fails in travis CI when tests are executed from a virtual environment In-Reply-To: <1543218068.72.0.788709270274.issue35313@psf.upfronthosting.co.za> Message-ID: <1543232529.21.0.788709270274.issue35313@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e88553c3742507ba83590ecca44ae7f134f38410 by Victor Stinner in branch '3.7': bpo-35313: Fix test_embed when run from venv (GH-10713) (GH-10715) https://github.com/python/cpython/commit/e88553c3742507ba83590ecca44ae7f134f38410 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:01:11 2018 From: report at bugs.python.org (Mark Lawrence) Date: Mon, 26 Nov 2018 12:01:11 +0000 Subject: [issue14418] Document differences in SocketServer between Python 2.6 and 2.7 In-Reply-To: <1332795225.64.0.202093290254.issue14418@psf.upfronthosting.co.za> Message-ID: <1543233671.16.0.788709270274.issue14418@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:05:59 2018 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Mon, 26 Nov 2018 12:05:59 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1543233959.31.0.788709270274.issue35227@psf.upfronthosting.co.za> Micha? G?rny added the comment: Thanks a lot! I've left a few comments based on eyeball review. I'm going to test it later today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:23:32 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 12:23:32 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543235012.96.0.788709270274.issue34100@psf.upfronthosting.co.za> miss-islington added the comment: New changeset c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 by Miss Islington (bot) (INADA Naoki) in branch 'master': bpo-34100: Merge constants recursively (GH-8341) https://github.com/python/cpython/commit/c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:24:08 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 26 Nov 2018 12:24:08 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543235048.83.0.788709270274.issue34100@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:26:00 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 26 Nov 2018 12:26:00 +0000 Subject: [issue35314] fnmatch failed with leading caret (^) In-Reply-To: <1543229892.22.0.788709270274.issue35314@psf.upfronthosting.co.za> Message-ID: <1543235160.83.0.788709270274.issue35314@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:40:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 12:40:03 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543236003.87.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 59423e3ddd736387cef8f7632c71954c1859bed0 by Victor Stinner in branch 'master': bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) https://github.com/python/cpython/commit/59423e3ddd736387cef8f7632c71954c1859bed0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:40:18 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 12:40:18 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543236018.3.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 07:45:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 12:45:29 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543236329.7.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 08:10:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 13:10:15 +0000 Subject: [issue35314] fnmatch failed with leading caret (^) In-Reply-To: <1543229892.22.0.788709270274.issue35314@psf.upfronthosting.co.za> Message-ID: <1543237815.5.0.788709270274.issue35314@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: '^' is not considered as a special character in shell-style wildcards. Use '!' for negating the character set: '[!b].py'. https://docs.python.org/3/library/fnmatch.html `man bash` describes the behavior of Bash, not Python. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 08:17:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 13:17:06 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543238226.76.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6f5fa1b4be735159e964906ab608dc467476e47c by Victor Stinner in branch '3.7': bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) https://github.com/python/cpython/commit/6f5fa1b4be735159e964906ab608dc467476e47c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 09:11:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 14:11:47 +0000 Subject: [issue35316] test_eintr fails randomly on macOS Message-ID: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> New submission from STINNER Victor : test_sleep() of test_eintr fails on VSTS/macOS. select.select() sleeps 200 ms, the process is supposed to get a signal every 100 ms, but the test says that the signal handler was not called during the test. All tests pass, the issue seems to be specific to macOS. Maybe select() cannot be interrupted by SIGALRM on macOS? https://dev.azure.com/Python/cpython/_build/results?buildId=34604&view=logs 2018-11-26T12:51:16.6867210Z FAIL: test_sleep (__main__.TimeEINTRTest) 2018-11-26T12:51:16.6868140Z ---------------------------------------------------------------------- 2018-11-26T12:51:16.6868300Z Traceback (most recent call last): 2018-11-26T12:51:16.6868450Z File "/Users/vsts/agent/2.142.1/work/1/s/Lib/test/eintrdata/eintr_tester.py", line 73, in tearDown 2018-11-26T12:51:16.6868570Z self.assertGreater(self.signals, 0) 2018-11-26T12:51:16.6869080Z AssertionError: 0 not greater than 0 2018-11-26T12:49:29.9119300Z os.uname: posix.uname_result(sysname='Darwin', nodename='Mac-329.local', release='17.7.0', version='Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64', machine='x86_64') I added the check (which fails) last week, ensure that the signal handler has been called at least once: * bpo-35189 * commit aac1f81eef971876ba5b1673db9ce6620311c469 ---------- components: Tests, macOS messages: 330432 nosy: ned.deily, pablogsal, ronaldoussoren, vstinner priority: normal severity: normal status: open title: test_eintr fails randomly on macOS versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 09:16:34 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 14:16:34 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543241794.53.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 09:22:20 2018 From: report at bugs.python.org (Tom Dalton) Date: Mon, 26 Nov 2018 14:22:20 +0000 Subject: [issue23078] unittest.mock patch autospec doesn't work on staticmethods In-Reply-To: <1418892323.1.0.910322233262.issue23078@psf.upfronthosting.co.za> Message-ID: <1543242140.56.0.788709270274.issue23078@psf.upfronthosting.co.za> Tom Dalton added the comment: I've just come across this too, so would be great if the patch can be progressed. ---------- nosy: +tom.dalton.fanduel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 09:46:50 2018 From: report at bugs.python.org (Tom Dalton) Date: Mon, 26 Nov 2018 14:46:50 +0000 Subject: [issue23078] unittest.mock patch autospec doesn't work on staticmethods In-Reply-To: <1418892323.1.0.910322233262.issue23078@psf.upfronthosting.co.za> Message-ID: <1543243610.43.0.788709270274.issue23078@psf.upfronthosting.co.za> Tom Dalton added the comment: Here's a minimal example so my comment is not totally vacuous: ``` import unittest from unittest import mock class Foo: @classmethod def bar(cls, baz): pass class TestFoo(unittest.TestCase): def test_bar(self): with unittest.mock.patch.object(Foo, "bar", autospec=True): Foo.bar() ``` -> ``` ~/? python -m unittest example.py E ====================================================================== ERROR: test_bar (example.TestFoo) ---------------------------------------------------------------------- Traceback (most recent call last): File "example.py", line 14, in test_bar Foo.bar() TypeError: 'NonCallableMagicMock' object is not callable ---------------------------------------------------------------------- Ran 1 test in 0.001s ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 09:53:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 14:53:28 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone Message-ID: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> New submission from STINNER Victor : The two following tests fail on glibc-2.28.9000-19.fc30.x86_64 on Fedora Rawhide depending on the timezone. Australia/Lord_Howe: ok EDT4: fail EST+05EDT,M3.2.0,M11.1.0: ok Europe/Kiev: ok Europe/Minsk: ok MSK-03: fail MST+07MDT,M4.1.0,M10.5.0: ok STD-1DST,M3.2.0,M11.1.0: ok STD-1DST,M4.1.0,M10.1.0: ok UTC: fail sh-4.4# TZ=UTC ./python -m test test_email -m 'test_localtime_daylight_*' -v == CPython 3.7.1 (default, Nov 26 2018, 15:33:31) [GCC 8.2.1 20181105 (Red Hat 8.2.1-5)] == Linux-4.19.2-301.fc29.x86_64-x86_64-with-fedora-30-Rawhide little-endian == cwd: /builddir/Python-3.7.1/build/test_python_9582 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 0.33 [1/1] test_email test_localtime_daylight_false_dst_false (test.test_email.test_utils.LocaltimeTests) ... ok test_localtime_daylight_false_dst_true (test.test_email.test_utils.LocaltimeTests) ... ERROR test_localtime_daylight_true_dst_false (test.test_email.test_utils.LocaltimeTests) ... ok test_localtime_daylight_true_dst_true (test.test_email.test_utils.LocaltimeTests) ... ERROR ====================================================================== ERROR: test_localtime_daylight_false_dst_true (test.test_email.test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/Python-3.7.1/Lib/test/test_email/test_utils.py", line 88, in test_localtime_daylight_false_dst_true t1 = utils.localtime(t0, isdst=1) File "/builddir/Python-3.7.1/Lib/email/utils.py", line 361, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range ====================================================================== ERROR: test_localtime_daylight_true_dst_true (test.test_email.test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/Python-3.7.1/Lib/test/test_email/test_utils.py", line 81, in test_localtime_daylight_true_dst_true t1 = utils.localtime(t0, isdst=1) File "/builddir/Python-3.7.1/Lib/email/utils.py", line 361, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range ---------------------------------------------------------------------- Ran 4 tests in 0.007s FAILED (errors=2) test test_email failed test_email failed == Tests result: FAILURE == 1 test failed: test_email Total duration: 259 ms Tests result: FAILURE sh-4.4# rpm -q glibc glibc-2.28.9000-19.fc30.x86_64 sh-4.4# cat /etc/fedora-release Fedora release 30 (Rawhide) sh-4.4# date lun. nov. 26 14:53:14 UTC 2018 ---------- components: Tests, email messages: 330435 nosy: barry, r.david.murray, vstinner priority: normal severity: normal status: open title: test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:02:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:02:13 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543244533.38.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: mktime_bug.py: script to reproduce the bug. ---------- Added file: https://bugs.python.org/file47946/mktime_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:04:41 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 26 Nov 2018 15:04:41 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543244681.79.0.788709270274.issue35317@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I remember some related issues raised in the past about the same test failing on freebsd machines : issue31628 and issue15750 (some more detail on msg168747) ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:20:57 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 26 Nov 2018 15:20:57 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543245657.9.0.788709270274.issue35317@psf.upfronthosting.co.za> Miro Hron?ok added the comment: I found a C reproducer and reported to Fedora glibc tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1653340 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:26:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:26:01 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543245961.96.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: Miro Hron?ok: > I found a C reproducer and reported to Fedora glibc tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1653340 Nice, I wrote almost the same one :-) See attached mktime_bug.c: $ gcc mktime_bug.c -o mktime_bug $ ./mktime_bug TZ=CET: mktime() -> 1331506860, errno=0 TZ=UTC: mktime() -> 1331514060, errno=0 $ ./mktime_bug TZ=CET: mktime() -> 1331506860, errno=0 TZ=UTC: mktime() -> -1, errno=75 ---------- nosy: -hroncok Added file: https://bugs.python.org/file47947/mktime_bug.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:47:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:47:04 +0000 Subject: [issue31628] test_emails failure on FreeBSD In-Reply-To: <1506669614.14.0.213398074469.issue31628@psf.upfronthosting.co.za> Message-ID: <1543247224.16.0.788709270274.issue31628@psf.upfronthosting.co.za> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-35317. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:48:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:48:18 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543247298.05.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm able to reproduce the issue on FreeBSD 12.0-RC2: vstinner at freebsd$ TZ=CET ./python -m test test_email -m 'test_localtime_daylight_*' -v (...) Tests result: SUCCESS vstinner at freebsd$ TZ=UTC ./python -m test test_email -m 'test_localtime_daylight_*' -v (...) ====================================================================== ERROR: test_localtime_daylight_false_dst_true (test.test_email.test_utils.LocaltimeTests) ---------------------------------------------------------------------- (...) File "/usr/home/vstinner/prog/python/master/Lib/email/utils.py", line 361, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range ====================================================================== ERROR: test_localtime_daylight_true_dst_true (test.test_email.test_utils.LocaltimeTests) ---------------------------------------------------------------------- (...) File "/usr/home/vstinner/prog/python/master/Lib/email/utils.py", line 361, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:49:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:49:11 +0000 Subject: [issue15750] test_localtime_daylight_false_dst_true raises OverflowError: mktime argument out of range In-Reply-To: <1345526136.06.0.661867821529.issue15750@psf.upfronthosting.co.za> Message-ID: <1543247351.35.0.788709270274.issue15750@psf.upfronthosting.co.za> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-35317. ---------- resolution: fixed -> duplicate superseder: -> test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:50:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:50:45 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543247445.39.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, the tests fail since 2012 at least on FreeBSD: https://bugs.python.org/issue15750#msg168741 """ On the FreeBSD 8.2 build slave: ====================================================================== ERROR: test_localtime_daylight_false_dst_true (test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): (...) seconds = time.mktime(tm) OverflowError: mktime argument out of range ====================================================================== ERROR: test_localtime_daylight_true_dst_true (test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): (...) seconds = time.mktime(tm) OverflowError: mktime argument out of range """ bpo-15750 even contains a reproducer in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 10:55:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 15:55:18 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543247718.52.0.788709270274.issue35317@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +9969 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:03:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:03:39 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543248219.48.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset fc4a44b0c3a69390eca4680d89c2ae5fe967f882 by Victor Stinner in branch '3.6': bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) (GH-10720) https://github.com/python/cpython/commit/fc4a44b0c3a69390eca4680d89c2ae5fe967f882 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:06:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:06:00 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543248360.72.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 3.6, 3.7 and master have been fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:09:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:09:19 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543248559.87.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6eb996685e25c09499858bee4be258776e603c6f by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/object.h (GH-10679) https://github.com/python/cpython/commit/6eb996685e25c09499858bee4be258776e603c6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:29:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:29:41 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543249781.01.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 75e4699b31d1d88abad097ad13466c5c07711324 by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/unicodeobject.h (GH-10680) https://github.com/python/cpython/commit/75e4699b31d1d88abad097ad13466c5c07711324 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:31:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:31:16 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543249876.17.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:39:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:39:38 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543250378.49.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: New failure on AppVeyor: FAIL: test_thread_time (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\projects\cpython\lib\test\test_time.py", line 553, in test_thread_time self.assertLess(stop - start, min_time) AssertionError: 0.015625 not less than 0.015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:39:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:39:44 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543250384.71.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:40:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:40:51 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543250451.03.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9971 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 11:41:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 16:41:59 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543250519.63.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh. In my previous attempt, I changed the minimum time from 20 ms to 15 ms. But I didn't notice that one check uses assertLess() rather than assertGreaterEqual(). So I wrote PR 10724 to change the maximum from 15 ms to 30 ms in test_thread_time(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:05:43 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 26 Nov 2018 17:05:43 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1543251943.49.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Julien Palard : ---------- pull_requests: +9972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:05:52 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 17:05:52 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1543251952.71.0.788709270274.issue35255@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 6f8cab0db044132c6192d6ac1536d28cf72c9d27 by Miss Islington (bot) (Julien Palard) in branch '3.7': [3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722) https://github.com/python/cpython/commit/6f8cab0db044132c6192d6ac1536d28cf72c9d27 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:07:47 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 26 Nov 2018 17:07:47 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1543252067.67.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Julien Palard : ---------- pull_requests: +9973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:09:30 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 26 Nov 2018 17:09:30 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1543252170.51.0.788709270274.issue35255@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:09:57 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 26 Nov 2018 17:09:57 +0000 Subject: [issue35035] Documentation for email.utils is named email.util.rst In-Reply-To: <1540102639.17.0.788709270274.issue35035@psf.upfronthosting.co.za> Message-ID: <1543252197.07.0.788709270274.issue35035@psf.upfronthosting.co.za> Change by Julien Palard : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 12:16:16 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 17:16:16 +0000 Subject: [issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ In-Reply-To: <1542281478.85.0.788709270274.issue35255@psf.upfronthosting.co.za> Message-ID: <1543252576.37.0.788709270274.issue35255@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 7f93f93fa68f54c1bc128d58fa17536245396de3 by Miss Islington (bot) (Julien Palard) in branch '3.6': [3.6] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10725) https://github.com/python/cpython/commit/7f93f93fa68f54c1bc128d58fa17536245396de3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 13:41:33 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Nov 2018 18:41:33 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1543257693.67.0.788709270274.issue34977@psf.upfronthosting.co.za> Steve Dower added the comment: For my own reference, some issues I found installing this package on a clean machine: * requires Developer Mode (until I get the sccd file signed - just sideloading is not sufficient) * requires vcruntime140.dll to be included in the package (workaround is to install the redistributable from https://visualstudio.microsoft.com/downloads/#title-39324) * venv needs to treat .pdb files as binary ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 13:41:44 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Nov 2018 18:41:44 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1543257704.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Steve Dower added the comment: For my own reference, some issues I found installing this package on a clean machine: * requires Developer Mode (until I get the sccd file signed - just sideloading is not sufficient) * requires vcruntime140.dll to be included in the package (workaround is to install the redistributable from https://visualstudio.microsoft.com/downloads/#title-39324) * venv needs to treat .pdb files as binary ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 13:42:01 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Nov 2018 18:42:01 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1543257721.45.0.788709270274.issue34977@psf.upfronthosting.co.za> Change by Steve Dower : ---------- Removed message: https://bugs.python.org/msg330453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 13:44:45 2018 From: report at bugs.python.org (Lisa Roach) Date: Mon, 26 Nov 2018 18:44:45 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1543257885.39.0.788709270274.issue24209@psf.upfronthosting.co.za> Change by Lisa Roach : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 13:49:06 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 18:49:06 +0000 Subject: [issue35318] Check accuracy of str() doc string for its encoding argument Message-ID: <1543258146.71.0.788709270274.issue35318@psf.upfronthosting.co.za> New submission from Raymond Hettinger : The "encoding" parameter is documented to default to sys.getdefaultencoding(). That may be true but there doesn't seem to be a way to use that default because objects will all have a __str__ or __repr__ that will be run instead. ------------------------------------------- >>> import sys >>> sys.getdefaultencoding() # Default encoding is utf-8 'utf-8' >>> buffer = b'lim x \xe2\x9f\xb6 \xe2\x88\x9e, 1/sin\xc2\xb2(x)' >>> str(buffer, 'utf-8') # Explicit argument decodes properly 'lim x ? ?, 1/sin?(x)' >>> str(buffer) # Despite the default, repr is shown "b'lim x \\xe2\\x9f\\xb6 \\xe2\\x88\\x9e, 1/sin\\xc2\\xb2(x)'" >>> print(str.__doc__) str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'. ---------- assignee: docs at python components: Documentation messages: 330454 nosy: docs at python, rhettinger priority: normal severity: normal status: open title: Check accuracy of str() doc string for its encoding argument versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 14:07:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 19:07:25 +0000 Subject: [issue35318] Check accuracy of str() doc string for its encoding argument In-Reply-To: <1543258146.71.0.788709270274.issue35318@psf.upfronthosting.co.za> Message-ID: <1543259245.26.0.788709270274.issue35318@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: >>> str(buffer, errors='strict') 'lim x ? ?, 1/sin?(x)' ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 14:15:58 2018 From: report at bugs.python.org (Kevin Norris) Date: Mon, 26 Nov 2018 19:15:58 +0000 Subject: [issue35319] pkgutil.get_data() is a wrapper for a deprecated class Message-ID: <1543259758.29.0.788709270274.issue35319@psf.upfronthosting.co.za> New submission from Kevin Norris : pkgutil.get_data()'s documentation[1] says it is a wrapper for importlib.abc.ResourceLoader.get_data(), but the latter's documentation[2] says the whole class is deprecated since 3.7. Please either: A. Formally deprecate pkgutil.get_data() (and ideally provide a "nice" alternative wrapper, so that I don't have to muck about with importlib's endless heterarchy of opaque objects which return other opaque objects). B. Modify pkgutil.get_data() to use ResourceReader instead of ResourceLoader. C. (A) or (B) has already been done, just document it. [1]: https://docs.python.org/3/library/pkgutil.html#pkgutil.get_data [2]: https://docs.python.org/3.8/library/importlib.html#importlib.abc.ResourceLoader ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 330456 nosy: Kevin.Norris, docs at python priority: normal severity: normal status: open title: pkgutil.get_data() is a wrapper for a deprecated class type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 14:20:31 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 19:20:31 +0000 Subject: [issue35318] Check accuracy of str() doc string for its encoding argument In-Reply-To: <1543258146.71.0.788709270274.issue35318@psf.upfronthosting.co.za> Message-ID: <1543260031.0.0.788709270274.issue35318@psf.upfronthosting.co.za> Raymond Hettinger added the comment: We may need to reword this a bit to show that the default system encoding only applies if "errors" is specified; otherwise, the argument pattern is mysterious. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 14:37:58 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 19:37:58 +0000 Subject: [issue35318] Check accuracy of str() doc string for its encoding argument In-Reply-To: <1543258146.71.0.788709270274.issue35318@psf.upfronthosting.co.za> Message-ID: <1543261078.09.0.788709270274.issue35318@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is not it exactly what the docsting says? > If encoding or > errors is specified, then the object must expose a data buffer > that will be decoded using the given encoding and error handler. > Otherwise, returns the result of object.__str__() (if defined) > or repr(object). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:19:34 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 20:19:34 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543263574.15.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 65c216e74f7957006ef7653b7e2afe83007c45ce by Victor Stinner in branch 'master': bpo-33723: Fix test_time.test_thread_time() (GH-10724) https://github.com/python/cpython/commit/65c216e74f7957006ef7653b7e2afe83007c45ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:19:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 20:19:55 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543263595.06.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:21:50 2018 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 26 Nov 2018 20:21:50 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543263710.06.0.788709270274.issue35317@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:25:53 2018 From: report at bugs.python.org (R. David Murray) Date: Mon, 26 Nov 2018 20:25:53 +0000 Subject: [issue24925] Allow doctest to find line number of __test__ strings if formatted as a triple quoted string. In-Reply-To: <1440433204.72.0.951879790885.issue24925@psf.upfronthosting.co.za> Message-ID: <1543263953.14.0.788709270274.issue24925@psf.upfronthosting.co.za> R. David Murray added the comment: Without looking at doctest.py, yes. I believe the doctests in that file should be already plugged in to the unittest framework, so adding new testcase containing a non-doctest unit test should work fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:36:58 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 20:36:58 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543264618.97.0.788709270274.issue33723@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 5350dd1b50e60882a2da6d53ed27e02d2b698f2e by Miss Islington (bot) in branch '3.7': bpo-33723: Fix test_time.test_thread_time() (GH-10724) https://github.com/python/cpython/commit/5350dd1b50e60882a2da6d53ed27e02d2b698f2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:50:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 20:50:20 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543265420.24.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: I close again the bug. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 15:50:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 20:50:55 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543265455.93.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:09:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 21:09:04 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543266544.81.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:11:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 21:11:27 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543266687.59.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5a8c240b1d97de0bd6ced2a57cbcf26da19c1fcc by Victor Stinner in branch 'master': bpo-35134: Add Include/cpython/pyerrors.h (GH-10727) https://github.com/python/cpython/commit/5a8c240b1d97de0bd6ced2a57cbcf26da19c1fcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:17:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 21:17:36 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543267056.23.0.788709270274.issue35310@psf.upfronthosting.co.za> STINNER Victor added the comment: > Under this condition, either select() should be re-run with a timeout of 0, or the fd lists should be emptied before returning. What is the current behavior? Are you trying to fix a bug? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:18:03 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Nov 2018 21:18:03 +0000 Subject: [issue31171] multiprocessing.BoundedSemaphore of 32-bit python could not work while cross compiling on linux platform In-Reply-To: <1502349716.95.0.155037219321.issue31171@psf.upfronthosting.co.za> Message-ID: <1543267083.43.0.788709270274.issue31171@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- nosy: +benjamin.peterson, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:29:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 21:29:49 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543267789.03.0.788709270274.issue35308@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8c281ed403fd915284d5bba2405d7c47f8195066 by Serhiy Storchaka (Zhiming Wang) in branch 'master': bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) https://github.com/python/cpython/commit/8c281ed403fd915284d5bba2405d7c47f8195066 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:29:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 21:29:49 +0000 Subject: [issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register In-Reply-To: <1500906744.5.0.485850012333.issue31014@psf.upfronthosting.co.za> Message-ID: <1543267789.16.0.702299269573.issue31014@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8c281ed403fd915284d5bba2405d7c47f8195066 by Serhiy Storchaka (Zhiming Wang) in branch 'master': bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) https://github.com/python/cpython/commit/8c281ed403fd915284d5bba2405d7c47f8195066 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:29:57 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 21:29:57 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543267797.73.0.788709270274.issue35308@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:29:57 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 21:29:57 +0000 Subject: [issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register In-Reply-To: <1500906744.5.0.485850012333.issue31014@psf.upfronthosting.co.za> Message-ID: <1543267797.82.0.663665092547.issue31014@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:42:09 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 21:42:09 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543268529.17.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4060283fcec7bb2bde4eb3c42b0a6ec99cf1d391 by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/abstract.h (GH-10728) https://github.com/python/cpython/commit/4060283fcec7bb2bde4eb3c42b0a6ec99cf1d391 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:49:33 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 21:49:33 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543268973.83.0.788709270274.issue35308@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2a37f013ec81099a6156160ce66803b2609bb7f4 by Miss Islington (bot) in branch '3.7': bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) https://github.com/python/cpython/commit/2a37f013ec81099a6156160ce66803b2609bb7f4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:49:33 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Nov 2018 21:49:33 +0000 Subject: [issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register In-Reply-To: <1500906744.5.0.485850012333.issue31014@psf.upfronthosting.co.za> Message-ID: <1543268973.95.0.702299269573.issue31014@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2a37f013ec81099a6156160ce66803b2609bb7f4 by Miss Islington (bot) in branch '3.7': bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) https://github.com/python/cpython/commit/2a37f013ec81099a6156160ce66803b2609bb7f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:54:31 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 26 Nov 2018 21:54:31 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1543269271.33.0.788709270274.issue31241@psf.upfronthosting.co.za> Brett Cannon added the comment: Yeah, it's a tough call because it's one of those things others have probably worked around already, so backporting would break the work-arounds. If you don't want to bother backporting, Serhiy, I think it would be fine to not do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 16:56:54 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 26 Nov 2018 21:56:54 +0000 Subject: [issue35281] Allow access to unittest.TestSuite tests In-Reply-To: <1542655549.43.0.788709270274.issue35281@psf.upfronthosting.co.za> Message-ID: <1543269414.71.0.788709270274.issue35281@psf.upfronthosting.co.za> Brett Cannon added the comment: Gotcha, thanks for the clarification! Unfortunately I don't think we will be able to accommodate your feature request. It's duplicating an API to simply save calling list() which is the idiomatic way to convert an iterable into a concrete sequence. And providing direct access to the list would be either unittest.TestCase-specific or all subclasses would then have to start supporting it. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 17:00:26 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 26 Nov 2018 22:00:26 +0000 Subject: [issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive" In-Reply-To: <1542752189.25.0.788709270274.issue35283@psf.upfronthosting.co.za> Message-ID: <1543269626.94.0.788709270274.issue35283@psf.upfronthosting.co.za> Brett Cannon added the comment: I think the only thing missing from your list, Andrew, is updating docstrings and such to mention is_alive() instead of isAlive(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 17:24:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 22:24:28 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543271068.54.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 17:43:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 22:43:12 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543272192.67.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 17:43:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 22:43:57 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543272237.86.0.788709270274.issue35240@psf.upfronthosting.co.za> STINNER Victor added the comment: Same error: https://travis-ci.org/python/cpython/jobs/459983088 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 17:59:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 22:59:57 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543273197.25.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:00:16 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 26 Nov 2018 23:00:16 +0000 Subject: [issue35320] Writable __spec__.has_location attribute Message-ID: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> New submission from G?ry : How to reproduce: Assign the __spec__.has_location attribute of any module. Observed result: __spec__.has_location is a writable. Expected result: __spec__.has_location should be read-only, as defined in PEP 451: https://www.python.org/dev/peps/pep-0451/#attributes ---------- components: Library (Lib) messages: 330474 nosy: barry, brett.cannon, docs at python, eric.snow, maggyero, mdk, ncoghlan priority: normal severity: normal status: open title: Writable __spec__.has_location attribute type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:01:38 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Mon, 26 Nov 2018 23:01:38 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543273298.32.0.788709270274.issue35303@psf.upfronthosting.co.za> Josh Rosenberg added the comment: This is completely fixed, right? Just making sure there is nothing left to be done to close the issue. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:06:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 23:06:40 +0000 Subject: [issue35303] A reference leak in _operator.c's methodcaller_repr() In-Reply-To: <1542998310.55.0.788709270274.issue35303@psf.upfronthosting.co.za> Message-ID: <1543273600.77.0.788709270274.issue35303@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:07:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 23:07:19 +0000 Subject: [issue35308] webbrowser regression: BROWSER env var not respected In-Reply-To: <1543073201.72.0.788709270274.issue35308@psf.upfronthosting.co.za> Message-ID: <1543273639.21.0.788709270274.issue35308@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:10:36 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Mon, 26 Nov 2018 23:10:36 +0000 Subject: [issue35314] fnmatch failed with leading caret (^) In-Reply-To: <1543229892.22.0.788709270274.issue35314@psf.upfronthosting.co.za> Message-ID: <1543273836.22.0.788709270274.issue35314@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Finished typing this while Serhiy was closing, but just for further explanation: This isn't a bug. fnmatch provides "shell-style" wildcards, but that doesn't mean it supports every shell's extensions to the globbing syntax. It doesn't even claim support for full POSIX globbing syntax. The docs explicitly specify support for only four forms: * ? [seq] [!seq] There is no support for [^seq]; [^seq] isn't even part of POSIX globbing per glob(7): "POSIX has declared the effect of a wildcard pattern "[^...]" to be undefined." ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:12:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 23:12:10 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543273930.87.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset dd12aa0aea733820807ec4f99e4e476064a0ee41 by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/pylifecycle.h (GH-10731) https://github.com/python/cpython/commit/dd12aa0aea733820807ec4f99e4e476064a0ee41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:12:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 23:12:29 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543273949.32.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ffedd9ad2a8be4bf82a4d8f2bac3eaee5b44191e by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/dictobject.h (GH-10732) https://github.com/python/cpython/commit/ffedd9ad2a8be4bf82a4d8f2bac3eaee5b44191e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:18:26 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 26 Nov 2018 23:18:26 +0000 Subject: [issue35320] Writable __spec__.has_location attribute In-Reply-To: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> Message-ID: <1543274306.84.0.788709270274.issue35320@psf.upfronthosting.co.za> Change by G?ry : ---------- nosy: -maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:19:31 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 26 Nov 2018 23:19:31 +0000 Subject: [issue35321] None _frozen_importlib.__spec__.origin attribute Message-ID: <1543274371.24.0.788709270274.issue35321@psf.upfronthosting.co.za> New submission from G?ry : How to reproduce: In Python: > import _frozen_importlib > print(_frozen_importlib.__spec__.origin) Observed result: The __spec__.origin attribute of the _frozen_importlib module is None. Expected result: The __spec__.origin attribute of the _frozen_importlib module should be 'frozen', like it is already the case for the _frozen_importlib_external module and documented for all frozen modules in PEP 451: https://www.python.org/dev/peps/pep-0451/#origin ---------- components: Library (Lib) messages: 330479 nosy: barry, brett.cannon, docs at python, eric.snow, maggyero, mdk, ncoghlan priority: normal severity: normal status: open title: None _frozen_importlib.__spec__.origin attribute versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:20:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 26 Nov 2018 23:20:03 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543274403.24.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f2a9d5c8378cd7eca90b3b197e2cc0989da55014 by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/pystate.h (GH-10733) https://github.com/python/cpython/commit/f2a9d5c8378cd7eca90b3b197e2cc0989da55014 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:20:11 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 26 Nov 2018 23:20:11 +0000 Subject: [issue35320] Writable __spec__.has_location attribute In-Reply-To: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> Message-ID: <1543274411.14.0.788709270274.issue35320@psf.upfronthosting.co.za> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 18:30:16 2018 From: report at bugs.python.org (Cyker Way) Date: Mon, 26 Nov 2018 23:30:16 +0000 Subject: [issue35314] fnmatch failed with leading caret (^) In-Reply-To: <1543229892.22.0.788709270274.issue35314@psf.upfronthosting.co.za> Message-ID: <1543275016.33.0.788709270274.issue35314@psf.upfronthosting.co.za> Cyker Way added the comment: Thank you for confirmation. Knowing it is not fully POSIX-compliant helps with understanding. I'm asking this because I had interoperability issues writing python scripts providing shell-like utilities for filename expansion and the result may surprise users. The glibc fnmatch provides a flag named `FNM_PATHNAME`, which is missing in the python fnmatch implementation. So I think there is currently no way to tell the python library if we are matching a filename or not. All right so this is not a bug, but probably a good enhancement. ## TLDR This is what POSIX says **for filename expansion**, in section 2.13.3: > when pattern matching notation is used for filename expansion: > > 1. The character in a pathname shall be explicitly matched by using one or more characters in the pattern; it shall neither be matched by the or special characters nor by a bracket expression. characters in the pattern shall be identified before bracket expressions; thus, a cannot be included in a pattern bracket expression used for filename expansion. If a character is found following an unescaped character before a corresponding is found, the open bracket shall be treated as an ordinary character. For example, the pattern "a[b/c]d" does not match such pathnames as abd or a/d. It only matches a pathname of literally a[b/c]d. Currently python fnmatch.fnmatch gives: >>> fnmatch('abd', 'a[b/c]d') True >>> fnmatch('a/d', 'a[b/c]d') True >>> fnmatch('a[b/c]d', 'a[b/c]d') False Ideally we can call `fnmatch('a/d', 'a[b/c]d', fnm_pathname=True)` to correct the behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 19:20:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 00:20:52 +0000 Subject: [issue35322] test_datetime leaks memory Message-ID: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> New submission from STINNER Victor : test_datetime currently leaks memory blocks: test_datetime leaked [3, 4, 3] memory blocks, sum=10 Attached patch should be added to Lib/test/ to only run a minimum set of tests which reproduce the bug. ---------- files: datetimetester.py messages: 330482 nosy: vstinner priority: normal severity: normal status: open title: test_datetime leaks memory Added file: https://bugs.python.org/file47948/datetimetester.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 19:24:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 00:24:10 +0000 Subject: [issue35322] test_datetime leaks memory In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543278250.06.0.788709270274.issue35322@psf.upfronthosting.co.za> Change by STINNER Victor : Added file: https://bugs.python.org/file47949/datetimetester.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 19:24:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 00:24:31 +0000 Subject: [issue35322] test_datetime leaks memory In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543278271.79.0.788709270274.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: C:\vstinner\python\master>python -m test -R 3:20 -u all test_datetime Running Debug|x64 interpreter... Run tests sequentially 0:00:00 [1/1] test_datetime beginning 23 repetitions 12345678901234567890123 ....................... test_datetime leaked [1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] memory blocks, sum=21 test_datetime failed == Tests result: FAILURE == 1 test failed: test_datetime Total duration: 562 ms Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 19:25:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 00:25:05 +0000 Subject: [issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings In-Reply-To: <1535046110.83.0.56676864532.issue34482@psf.upfronthosting.co.za> Message-ID: <1543278305.65.0.788709270274.issue34482@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like thie issue introduced a memory leak: bpo-35322 . ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 21:21:42 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 27 Nov 2018 02:21:42 +0000 Subject: [issue34212] Cygwin link failure with builtin modules since issue30860 In-Reply-To: <1532452252.87.0.56676864532.issue34212@psf.upfronthosting.co.za> Message-ID: <1543285302.18.0.788709270274.issue34212@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset da324d53d420347344236ff64cf5eb9b675d6f86 by Benjamin Peterson (E. M. Bray) in branch 'master': closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) https://github.com/python/cpython/commit/da324d53d420347344236ff64cf5eb9b675d6f86 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 21:21:53 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 02:21:53 +0000 Subject: [issue34212] Cygwin link failure with builtin modules since issue30860 In-Reply-To: <1532452252.87.0.56676864532.issue34212@psf.upfronthosting.co.za> Message-ID: <1543285313.3.0.788709270274.issue34212@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 21:25:52 2018 From: report at bugs.python.org (liang feng) Date: Tue, 27 Nov 2018 02:25:52 +0000 Subject: [issue35323] Windows x86 executable installer can't install Message-ID: <1543285552.0.0.788709270274.issue35323@psf.upfronthosting.co.za> New submission from liang feng <15901111500 at 139.com>: see log ---------- files: Python 3.7.1 (32-bit)_20181127100820.log messages: 330486 nosy: outofthink priority: normal severity: normal status: open title: Windows x86 executable installer can't install versions: Python 3.7 Added file: https://bugs.python.org/file47950/Python 3.7.1 (32-bit)_20181127100820.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 21:33:01 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 02:33:01 +0000 Subject: [issue34212] Cygwin link failure with builtin modules since issue30860 In-Reply-To: <1532452252.87.0.56676864532.issue34212@psf.upfronthosting.co.za> Message-ID: <1543285981.51.0.788709270274.issue34212@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 716a8089b04095acaba493925751df194a4916bb by Miss Islington (bot) in branch '3.7': closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) https://github.com/python/cpython/commit/716a8089b04095acaba493925751df194a4916bb ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 22:10:17 2018 From: report at bugs.python.org (liang feng) Date: Tue, 27 Nov 2018 03:10:17 +0000 Subject: [issue35323] Windows x86 executable installer can't install In-Reply-To: <1543285552.0.0.788709270274.issue35323@psf.upfronthosting.co.za> Message-ID: <1543288217.85.0.788709270274.issue35323@psf.upfronthosting.co.za> liang feng <15901111500 at 139.com> added the comment: the file didn't download complete,change other computer download, it's fine ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 23:41:27 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 27 Nov 2018 04:41:27 +0000 Subject: [issue34893] Add 2to3 fixer to change send and recv methods of socket object. In-Reply-To: <1538664300.49.0.545547206417.issue34893@psf.upfronthosting.co.za> Message-ID: <1543293687.45.0.788709270274.issue34893@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I concur with Raymond. Thank you for the patch, but this seems too error-prone to commit. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 26 23:42:39 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 27 Nov 2018 04:42:39 +0000 Subject: [issue34978] check type of object in fix_dict.py in 2to3 In-Reply-To: <1539475549.65.0.788709270274.issue34978@psf.upfronthosting.co.za> Message-ID: <1543293759.91.0.788709270274.issue34978@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I'm disinclined to change the fix here after it's existed in this for for 10 years. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 01:10:06 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 27 Nov 2018 06:10:06 +0000 Subject: [issue35320] Writable __spec__.has_location attribute In-Reply-To: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> Message-ID: <1543299006.32.0.788709270274.issue35320@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 01:38:41 2018 From: report at bugs.python.org (josephshi@yahoo.com) Date: Tue, 27 Nov 2018 06:38:41 +0000 Subject: [issue35324] ssl: FileNotFoundError when do handshake Message-ID: <1543300721.51.0.788709270274.issue35324@psf.upfronthosting.co.za> New submission from josephshi at yahoo.com : After upgrade my python from 3.6 to 3.7, one of my program got following error msgs and I suppose it is related to the 'ssl' module: Traceback (most recent call last): File "M:\SUPPOR~1\ONEDAY~1\ODD2\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen chunked=chunked) File "M:\SUPPOR~1\ONEDAY~1\ODD2\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "M:\SUPPOR~1\ONEDAY~1\ODD2\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn conn.connect() File "M:\SUPPOR~1\ONEDAY~1\ODD2\lib\site-packages\urllib3\connection.py", line 344, in connect ssl_context=context) File "M:\SUPPOR~1\ONEDAY~1\ODD2\lib\site-packages\urllib3\util\ssl_.py", line 357, in ssl_wrap_socket return context.wrap_socket(sock) File "f:\Anaconda3\Lib\ssl.py", line 412, in wrap_socket session=session File "f:\Anaconda3\Lib\ssl.py", line 853, in _create self.do_handshake() File "f:\Anaconda3\Lib\ssl.py", line 1117, in do_handshake self._sslobj.do_handshake() FileNotFoundError: [Errno 2] No such file or directory The background is, the program works all fine under python 3.6. I actually use the 'requests' lib which use the 'urllib3' inside. I don't know how to fix this so I just report here. I hope some one can help. ---------- assignee: christian.heimes components: SSL messages: 330491 nosy: christian.heimes, josephshi at yahoo.com priority: normal severity: normal status: open title: ssl: FileNotFoundError when do handshake type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 01:54:08 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 27 Nov 2018 06:54:08 +0000 Subject: [issue35320] Writable __spec__.has_location attribute In-Reply-To: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> Message-ID: <1543301648.28.0.788709270274.issue35320@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think a setter was added for has_location (msg205384) and docs were updated as part of the patch but the PEP was not updated? . A setter for has_location : https://hg.python.org/cpython/rev/e961a166dc70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:07:29 2018 From: report at bugs.python.org (Brian Maissy) Date: Tue, 27 Nov 2018 07:07:29 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543302449.11.0.788709270274.issue35310@psf.upfronthosting.co.za> Brian Maissy added the comment: The current behavior is: > select() is not retried, and the rlist is returned as-is (with fds in it which are not ready for reading) Yes, this is a bug. It results in select() indicating that fd are ready for reading when they, in fact, are not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:08:40 2018 From: report at bugs.python.org (Brian Maissy) Date: Tue, 27 Nov 2018 07:08:40 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543302520.06.0.788709270274.issue35310@psf.upfronthosting.co.za> Change by Brian Maissy : ---------- nosy: +oranav _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:10:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 07:10:08 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543302608.05.0.788709270274.issue33954@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Objects/unicodeobject.c: In function ?_PyUnicode_FastFill?: Objects/unicodeobject.c:10126:24: warning: passing argument 2 of ?unicode_fill? discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] unicode_fill(kind, data, fill_char, start, length); ^~~~ Objects/unicodeobject.c:224:1: note: expected ?void *? but argument is of type ?const void *? unicode_fill(enum PyUnicode_Kind kind, void *data, Py_UCS4 value, ^~~~~~~~~~~~ In file included from /usr/include/wchar.h:850:0, from ./Include/unicodeobject.h:97, from ./Include/Python.h:87, from ./Modules/getpath.c:3: ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:27:04 2018 From: report at bugs.python.org (Stefan Bauer (TraceTronic)) Date: Tue, 27 Nov 2018 07:27:04 +0000 Subject: [issue35325] imp.find_module() return value documentation discrepancy Message-ID: <1543303624.81.0.788709270274.issue35325@psf.upfronthosting.co.za> New submission from Stefan Bauer (TraceTronic) : I?d like to report a discrepancy between the documentation and implementation of the method imp.find_module(). The documentation currently says ?If the module does not live in a file, the returned file is None, pathname is the __empty_string__, [?]? The implementation , on the other hand, returns __None__ for built-in and frozen modules. Yours, Stefan ---------- assignee: docs at python components: Documentation messages: 330495 nosy: StefanBauerTT, docs at python priority: normal severity: normal status: open title: imp.find_module() return value documentation discrepancy versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:40:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 07:40:06 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args In-Reply-To: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> Message-ID: <1543304406.25.0.788709270274.issue31961@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Gregory, could you please make a look at PR 5914? Differences from PR 4329: * Any item of args can be an iterable of bytes and path-like objects on Windows (not just a first item as in PR 4329). * Accepts bytes and path-like objects as executable on Windows. * Accepts bytes as cwd on Windows. * Raises a TypeError when shell is true and args is a path-like object (or bytes on Windows). * Does not use raising and catching a TypeError when args is an iterable on Windows or a path-like object on POSIX (this makes the code clearer and a tiny bit more efficient). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:40:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 07:40:35 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1543304435.71.0.788709270274.issue31241@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b619b097923155a7034c05c4018bf06af9f994d0 by Serhiy Storchaka in branch 'master': bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633) https://github.com/python/cpython/commit/b619b097923155a7034c05c4018bf06af9f994d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 02:42:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 07:42:56 +0000 Subject: [issue31241] ast col_offset wrong for list comprehensions, generators and tuples In-Reply-To: <1503255834.0.0.745479367375.issue31241@psf.upfronthosting.co.za> Message-ID: <1543304576.79.0.788709270274.issue31241@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 04:27:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 09:27:40 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543310860.48.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4a934d490fac779d8954a8292369c4506bab23fa by Serhiy Storchaka in branch 'master': bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. (GH-6748) https://github.com/python/cpython/commit/4a934d490fac779d8954a8292369c4506bab23fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 04:44:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 09:44:18 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543311858.3.0.788709270274.issue35322@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- components: +Library (Lib) title: test_datetime leaks memory -> test_datetime leaks memory on Windows versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 04:47:40 2018 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Tue, 27 Nov 2018 09:47:40 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543312060.28.0.788709270274.issue34022@psf.upfronthosting.co.za> Chih-Hsuan Yen added the comment: As https://github.com/python/cpython/pull/10327 has been merged, I think this issue can be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 05:22:16 2018 From: report at bugs.python.org (Paolo Taddonio) Date: Tue, 27 Nov 2018 10:22:16 +0000 Subject: [issue31506] Improve the error message logic for object_new & object_init In-Reply-To: <1505727849.07.0.595214817996.issue31506@psf.upfronthosting.co.za> Message-ID: <1543314136.56.0.788709270274.issue31506@psf.upfronthosting.co.za> Paolo Taddonio added the comment: I am not sure if the following is resolved by your proposal, I post it just in case: The following code works: 1. class Singleton(object): 2. def __new__(cls, *args, **kwargs): 3. if not hasattr(cls, 'instance'): 4. cls.instance = super(Singleton, cls).__new__(cls) 5. cls.instance._init_pointer = cls.instance._init_properties 6. else: 7. cls.instance._init_pointer = lambda *args, **kwargs: None # do nothing 8. return cls.instance 9. def __init__(self, *args, **kwargs): 10. super(Singleton, self).__init__() 11. self._init_pointer(*args, **kwargs) 12. def _init_properties(self, tag): 13. self.info = tag 14. # 15. if __name__ == '__main__': 16. S1 = Singleton('I am S1') 17. print('S1 info is:' + S1.info) 18. S2 = Singleton('Am I S2?') 19. print('S2 info is:' + S2.info) However if I change line 4 into this code (which works in Python 2 by the way): cls.instance = super(Singleton, cls).__new__(cls, *args, **kwargs) I get: TypeError: object.__new__() takes no arguments But if I change line 4 into this (no arguments as suggested): cls.instance = super(Singleton, cls).__new__() I get: TypeError: object.__new__(): not enough arguments Line 10 has the same issue when changed to: super(Singleton, self).__init__(*args, **kwargs) ---------- nosy: +ppt000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 05:34:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 10:34:05 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543314845.6.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 05:39:56 2018 From: report at bugs.python.org (Martin Panter) Date: Tue, 27 Nov 2018 10:39:56 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1543315196.34.0.788709270274.issue35227@psf.upfronthosting.co.za> Martin Panter added the comment: The changes at have various other behaviour changes which are not discussed here. They seem to be there just so that you can use the TCP socket from ?urlopen? with ?gettarinfo?. But ?gettarinfo? is supposed to be for named filesystem objects that could be members of a tar file. See Issue 22208 discussing how to create TarInfo objects without using the OS filesystem. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 05:54:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 10:54:45 +0000 Subject: [issue34212] Cygwin link failure with builtin modules since issue30860 In-Reply-To: <1532452252.87.0.56676864532.issue34212@psf.upfronthosting.co.za> Message-ID: <1543316085.14.0.788709270274.issue34212@psf.upfronthosting.co.za> STINNER Victor added the comment: What about modules compiled by setup.py? They don't have the issue? Only 2 modules are built by setup.py with Py_BUILD_CORE_BUILTIN (_json) or Py_BUILD_CORE (_xxsubinterpreters). By the way, it seems like Py_BUILD_CORE_BUILTIN should be used for modules, not Py_BUILD_CORE. No? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:00:03 2018 From: report at bugs.python.org (Mordechai Botrashvily) Date: Tue, 27 Nov 2018 11:00:03 +0000 Subject: [issue35326] ctypes cast and from_address cause crash on Windows 10 Message-ID: <1543316403.16.0.788709270274.issue35326@psf.upfronthosting.co.za> New submission from Mordechai Botrashvily : Hi, Using cast() or from_address() to convert from c_void_p (or integer) address to POINTER(c_ubyte) causes the interpreter to crash, when accessing the contents of the array. The problem seems to happen when running the following combination: Windows 10 @ 64 bit, version 1803 (OS build 17134.407) and python 3 64 bit, starting with 3.5 until 3.7 (the last that was tested). The following code works fine on the same system using python 2.7.15 or python 3 until 3.4 (inclusive), 64 bit. In addition, it works well also under Windows 7 64 bit and python 3.5/3.6/3.7 etc. How to reproduce? ``` from ctypes import wintypes, windll, c_void_p, c_size_t, POINTER, c_ubyte, cast # Define constants. FILE_MAP_ALL_ACCESS = 983071 PAGE_READWRITE = 4 # Configure function arguments. windll.kernel32.CreateFileMappingA.argtypes = [wintypes.HANDLE, c_void_p, wintypes.DWORD, wintypes.DWORD, wintypes.DWORD, wintypes.LPCSTR] windll.kernel32.CreateFileMappingA.restype = wintypes.HANDLE windll.kernel32.MapViewOfFile.argtypes = [wintypes.HANDLE, wintypes.DWORD, wintypes.DWORD, wintypes.DWORD, c_size_t] windll.kernel32.MapViewOfFile.restypes = wintypes.LPVOID # Open shared-memory. handle = windll.kernel32.CreateFileMappingA(-1, None, PAGE_READWRITE, 0, 1024 * 1024, b'TestSHMEM') # Obtain pointer to SHMEM buffer. ptr = windll.kernel32.MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, 1024 * 1024) arr = cast(ptr, POINTER(c_ubyte)) # or #arr = POINTER(c_ubyte).from_address(ptr) arr[0] # now crashes ``` Also note that changing the return type of MapViewOfFile as follows: windll.kernel32.MapViewOfFile.restypes = wintypes.LPVOID is changed to: windll.kernel32.MapViewOfFile.restypes = POINTER(c_ubyte) The contents of the buffer can be directly accessed without a problem. Just in case I'm not using it properly with new python releases? Thanks! Moti. ---------- components: ctypes files: test_ctypes_shmem.py messages: 330503 nosy: Mordechai Botrashvily priority: normal severity: normal status: open title: ctypes cast and from_address cause crash on Windows 10 type: crash versions: Python 3.5, Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47951/test_ctypes_shmem.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:02:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:02:10 +0000 Subject: [issue35310] select which was interrupted by EINTR isn't re-run if the timeout has passed In-Reply-To: <1543151946.49.0.788709270274.issue35310@psf.upfronthosting.co.za> Message-ID: <1543316530.08.0.788709270274.issue35310@psf.upfronthosting.co.za> STINNER Victor added the comment: Ah! I missed attached select_eintr.py script. Ok, I reproduced the bug and I agree that it must be fixed. ---------- versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:05:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 11:05:06 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543316706.5.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 81524022d0c0df7a41f9b2b2df41e2ebe140e610 by Serhiy Storchaka in branch 'master': bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736) https://github.com/python/cpython/commit/81524022d0c0df7a41f9b2b2df41e2ebe140e610 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:12:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:12:10 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543317130.03.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:20:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:20:29 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543317629.49.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:20:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:20:36 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543317636.83.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:23:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:23:06 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543317786.54.0.788709270274.issue33954@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:27:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 11:27:34 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543318054.38.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 62be74290aca26d16f3f55ece7ff6dad14e60e8d by Serhiy Storchaka in branch 'master': bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749) https://github.com/python/cpython/commit/62be74290aca26d16f3f55ece7ff6dad14e60e8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:30:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 11:30:20 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543318220.57.0.788709270274.issue33029@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Can you provide your patches Siddhesh? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:39:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:39:05 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543318745.56.0.788709270274.issue34022@psf.upfronthosting.co.za> STINNER Victor added the comment: > As https://github.com/python/cpython/pull/10327 has been merged, I think this issue can be closed? The Versions field of this issue is set to Python 3.7, but 7 tests are failing with: $ SOURCE_DATE_EPOCH=0 ./python -m test -j0 -r -u all,-gui (...) 7 tests failed: test_cmd_line_script test_compileall test_importlib test_multiprocessing_main_handling test_posix test_py_compile test_runpy Note: the full test suite pass with SOURCE_DATE_EPOCH=0 on master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:40:54 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:40:54 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543318854.42.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset cfaafda8e3e19764682abb4bd4c574accb784c42 by Victor Stinner in branch 'master': bpo-35317: Fix mktime() error in test_email (GH-10721) https://github.com/python/cpython/commit/cfaafda8e3e19764682abb4bd4c574accb784c42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:41:01 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 11:41:01 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543318861.65.0.788709270274.issue35317@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:41:13 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 11:41:13 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543318873.0.0.788709270274.issue35317@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:41:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:41:20 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543318880.36.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 163403a63e9272fcd14707e344122c2e3c5e0244 by Victor Stinner in branch 'master': bpo-33954: Fix compiler warning in _PyUnicode_FastFill() (GH-10737) https://github.com/python/cpython/commit/163403a63e9272fcd14707e344122c2e3c5e0244 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:42:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:42:08 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543318928.55.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7f9fb0f34555641722be5468b7fbd53dd3c0f1e2 by Victor Stinner in branch '3.7': bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10738) https://github.com/python/cpython/commit/7f9fb0f34555641722be5468b7fbd53dd3c0f1e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:42:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 11:42:28 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543318948.21.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 480833808e918a1dcebbbcfd07d5a8de3c5c2a66 by Victor Stinner in branch 'master': bpo-35134: Update "make tags": add Include/cpython/ (GH-10739) https://github.com/python/cpython/commit/480833808e918a1dcebbbcfd07d5a8de3c5c2a66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:54:28 2018 From: report at bugs.python.org (Siddhesh Poyarekar) Date: Tue, 27 Nov 2018 11:54:28 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543319668.87.0.788709270274.issue33029@psf.upfronthosting.co.za> Siddhesh Poyarekar added the comment: Sorry I haven't had time to look into this since and it doesn't look like I'll be able to get to it in the next couple of weeks. I had a couple of patches in the github fork but they're pretty outdated and probably not even correct. If nobody gets to it by Christmas holidays, I'll give it a shot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 06:58:00 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 11:58:00 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543319880.69.0.788709270274.issue35317@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d669154ee52048f98ac63ba177f3fd1cf62f0174 by Miss Islington (bot) in branch '3.7': bpo-35317: Fix mktime() error in test_email (GH-10721) https://github.com/python/cpython/commit/d669154ee52048f98ac63ba177f3fd1cf62f0174 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 07:01:04 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 12:01:04 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543320064.32.0.788709270274.issue35317@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b59fc311609aadaafaae68240127b4997b85859d by Miss Islington (bot) in branch '3.6': bpo-35317: Fix mktime() error in test_email (GH-10721) https://github.com/python/cpython/commit/b59fc311609aadaafaae68240127b4997b85859d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 07:19:41 2018 From: report at bugs.python.org (Gus Goulart) Date: Tue, 27 Nov 2018 12:19:41 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543321181.65.0.788709270274.issue33930@psf.upfronthosting.co.za> Gus Goulart added the comment: After a couple of rounds, this is the benchmark result I got for the attached patch. It seems to be a simple, non-performance degrading fix. python -m perf compare_to origin.json patch.json -G --min-speed=2 Slower (1): - sqlalchemy_declarative: 213 ms +- 4 ms -> 219 ms +- 9 ms: 1.03x slower (+3%) Faster (9): - logging_format: 15.1 us +- 0.3 us -> 14.5 us +- 0.3 us: 1.05x faster (-5%) - hexiom: 15.0 ms +- 0.5 ms -> 14.5 ms +- 0.2 ms: 1.03x faster (-3%) - json_loads: 39.6 us +- 0.7 us -> 38.5 us +- 0.5 us: 1.03x faster (-3%) - json_dumps: 17.2 ms +- 0.4 ms -> 16.7 ms +- 0.2 ms: 1.03x faster (-3%) - fannkuch: 634 ms +- 4 ms -> 619 ms +- 6 ms: 1.02x faster (-2%) - django_template: 183 ms +- 3 ms -> 178 ms +- 5 ms: 1.02x faster (-2%) - float: 153 ms +- 2 ms -> 150 ms +- 1 ms: 1.02x faster (-2%) - raytrace: 761 ms +- 19 ms -> 745 ms +- 8 ms: 1.02x faster (-2%) - regex_effbot: 3.69 ms +- 0.06 ms -> 3.61 ms +- 0.05 ms: 1.02x faster (-2%) Benchmark hidden because not significant (47): 2to3, chaos, crypto_pyaes, deltablue, dulwich_log, go, html5lib, logging_silent, logging_simple, mako, meteor_contest, nbody, nqueens, pathlib, pickle, pickle_dict, pickle_list, pickle_pure_python, pidigits, python_startup, python_startup_no_site, regex_compile, regex_dna, regex_v8, richards, scimark_fft, scimark_lu, scimark_monte_carlo, scimark_sor, scimark_sparse_mat_mult, spectral_norm, sqlalchemy_imperative, sqlite_synth, sympy_expand, sympy_integrate, sympy_sum, sympy_str, telco, tornado_http, unpack_sequence, unpickle, unpickle_list, unpickle_pure_python, xml_etree_parse, xml_etree_iterparse, xml_etree_generate, xml_etree_process ---------- keywords: +patch Added file: https://bugs.python.org/file47952/bpo-33930.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 08:31:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 13:31:00 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543325460.6.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 54fa83e0a3f3b077763cb50705d7a7dbe4a40a4a by Victor Stinner in branch '3.6': bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10740) https://github.com/python/cpython/commit/54fa83e0a3f3b077763cb50705d7a7dbe4a40a4a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 08:32:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 13:32:20 +0000 Subject: [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error for locales with non-ascii thousands separator In-Reply-To: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> Message-ID: <1543325540.4.0.788709270274.issue33954@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy Storchaka: """ Objects/unicodeobject.c: In function ?_PyUnicode_FastFill?: Objects/unicodeobject.c:10126:24: warning: passing argument 2 of ?unicode_fill? discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] """ Yeah, I was aware of the warning. I had a local branch but I started to make many unrelated changes and so I lost track of the issue :-) The warning should now be fixed. Thanks for the report. Note: it was a real bug which exists since at least Python 3.6 ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 08:33:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 13:33:44 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543325624.22.0.788709270274.issue34100@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 08:39:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 13:39:21 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543325961.13.0.788709270274.issue34100@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 by Miss Islington (bot) (INADA Naoki) in branch 'master' This change introduced a lot of memory leaks (reference leaks): https://buildbot.python.org/all/#/builders/1/builds/422 The following change fix "make && ./python -m test -R 3:3 test_code": diff --git a/Python/compile.c b/Python/compile.c index acb5cfe29b..cb3e73740d 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1277,6 +1277,7 @@ merge_consts_recursive(struct compiler *c, PyObject *o) else { u = k; } + Py_DECREF(k); Py_INCREF(u); PyTuple_SET_ITEM(tuple, i, u); i++; @@ -1288,6 +1289,7 @@ merge_consts_recursive(struct compiler *c, PyObject *o) Py_DECREF(key); return NULL; } + Py_DECREF(PyTuple_GET_ITEM(key, 1)); PyTuple_SET_ITEM(key, 1, new); } But I dislike the frozenset branch of merge_consts_recursive(): modifying a tuple is a bad idea. For example, if you replace PyTuple_SET_ITEM() with PyTuple_SetItem(), you get a PyErr_BadInternalCall() because the reference count is greater than 1. I don't see how to rewrote properly the code, so I reverted (removed) it to let someone else fix the code: PR 10743. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 08:59:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 13:59:26 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543327166.4.0.788709270274.issue33930@psf.upfronthosting.co.za> STINNER Victor added the comment: - _PyObject_GC_UNTRACK(m); + PyObject_GC_UnTrack(m); Can someone please explain me why this change has any impact? Does it mean that _PyObject_GC_UNTRACK() macro has a bug? The function is quite straighforward :-) void PyObject_GC_Track(void *op) { _PyObject_GC_TRACK(op); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:12:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 14:12:51 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543327971.99.0.788709270274.issue34100@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1005c84535191a72ebb7587d8c5636a065b7ed79 by Victor Stinner in branch 'master': bpo-34100: Partially revert merge_consts_recursive() (GH-10743) https://github.com/python/cpython/commit/1005c84535191a72ebb7587d8c5636a065b7ed79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:13:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 14:13:40 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543328020.52.0.788709270274.issue34100@psf.upfronthosting.co.za> STINNER Victor added the comment: merge_consts_recursive(): rather than modifying the 'key' tuple, would it make sense to *add* the new key to the cache? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:20:00 2018 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Tue, 27 Nov 2018 14:20:00 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543328400.9.0.788709270274.issue34022@psf.upfronthosting.co.za> Chih-Hsuan Yen added the comment: Looks like in https://github.com/python/cpython/pull/10327, Serhiy Storchaka considers fixing these issues for 3.8 only - "It is easier to skip the test on 3.7." and then remove the "needs backport to 3.7" label. How about changing the target version to 3.8 only and close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:21:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 14:21:26 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543328486.39.0.788709270274.issue34022@psf.upfronthosting.co.za> STINNER Victor added the comment: "What?s New In Python 3.7" mentions twice "build reproducibility": https://docs.python.org/dev/whatsnew/3.7.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:32:16 2018 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Tue, 27 Nov 2018 14:32:16 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543329136.55.0.788709270274.issue34022@psf.upfronthosting.co.za> Chih-Hsuan Yen added the comment: Got it. Thanks for the pointer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:55:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 14:55:03 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543330502.99.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +9991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 09:56:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 14:56:59 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543330619.34.0.788709270274.issue33012@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset 62be74290aca26d16f3f55ece7ff6dad14e60e8d by Serhiy Storchaka in branch 'master': > bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749) I still get something 100 warnings with GCC 8.2.1 on Fedora 29. I wrote PR 10744 to add a macro to cast a function pointer. I chose to add a macro, so it will be easier to spot where we cast function pointers and change the implementation (cast) if needed at a single place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:24:28 2018 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 27 Nov 2018 15:24:28 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. Message-ID: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> New submission from Paul Ganssle : It seems that if you call skipTest *anywhere* in a test function, even in a subTest, the *entire* function gets marked as "skipped", even if only one sub-test is skipped. Example: import unittest class SomeTest(unittest.TestCase): def test_something(self): for i in range(1, 3): with self.subTest(i): if i > 1: self.skipTest('Not supported') self.assertEqual(i, 1) If you run `python3.7 -m unittest -v` on this, you get: $ python -m unittest -v test_something (test_mod.SomeTest) ... skipped 'Not supported' ---------------------------------------------------------------------- Ran 1 test in 0.000s OK (skipped=1) Despite the fact that the test *was* run in the `i == 1` case. Similarly, pytest marks this as a single skipped test: ========= test session starts ======= platform linux -- Python 3.7.1, pytest-4.0.1, py-1.7.0, pluggy-0.8.0 rootdir: /tmp/test_mod, inifile: collected 1 item test_mod.py s [100%] ===== 1 skipped in 0.00 seconds ===== The solution to this is not obvious, unfortunately. One way to solve it would be to have each subtest considered a "separate test". Another would be to detect whether subTests have been skipped and expose only the *skipped* tests as separate tests. You could also add a "partially skipped" marker, so to say, "Some parts of this were skipped" I suspect the right answer is some combination of these three answers - possibly adding an extra-verbose mode that splits out all sub tests and having skipped subTests default to being displayed separately. Somewhat related to issue #30997. ---------- components: Tests messages: 330527 nosy: ezio.melotti, michael.foord, p-ganssle, rbcollins priority: normal severity: normal status: open title: Using skipTest with subTest gives a misleading UI. versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:29:45 2018 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 27 Nov 2018 15:29:45 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. In-Reply-To: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Message-ID: <1543332585.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Paul Ganssle added the comment: As "prior art" the way that pytest does this is to have parametrized tests show up as separate tests: import pytest @pytest.mark.parametrize("i", range(1, 3)) def test_something(i): if i > 1: pytest.skip('Not supported') assert i == 1 @pytest.mark.parametrize("i", range(1, 3)) def test_something_else(i): assert 3 > i >= 1 Running `pytest -v` for this gives: ======================================= test session starts ======================================== platform linux -- Python 3.7.1, pytest-4.0.1, py-1.7.0, pluggy-0.8.0 cachedir: .pytest_cache rootdir: /tmp/test_mod, inifile: collected 4 items test_mod.py::test_something[1] PASSED [ 25%] test_mod.py::test_something[2] SKIPPED [ 50%] test_mod.py::test_something_else[1] PASSED [ 75%] test_mod.py::test_something_else[2] PASSED [100%] =============================== 3 passed, 1 skipped in 0.01 seconds ================================ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:36:00 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 27 Nov 2018 15:36:00 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. In-Reply-To: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Message-ID: <1543332960.7.0.788709270274.issue35327@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: Did you notice that `skipped 'Not supported'` will be displayed once per skipped subtest so changing your `for i in range(1, 3):` by `for i in range(1, 5):` will show: python3 -m unittest -v test_something (test2.SomeTest) ... skipped 'Not supported' skipped 'Not supported' skipped 'Not supported' Do you think it should show something like: python3 -m unittest -v test_something (test2.SomeTest) ... SubTest skipped 'Not supported' SubTest skipped 'Not supported' SubTest skipped 'Not supported' ? ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:41:40 2018 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 27 Nov 2018 15:41:40 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. In-Reply-To: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Message-ID: <1543333300.55.0.788709270274.issue35327@psf.upfronthosting.co.za> Paul Ganssle added the comment: @R?mi Interesting. Your suggested output does look clearer than the existing one, but it still doesn't indicate that anything *passed*. I think I like the way pytest does it the best, but if we can't expose the subtests as separate tests, I'd probably want it to be more like this: test_something (test2.SomeTest) ... ok (3 subtests skipped) test_something [2] skipped 'Not supported' test_something [3] skipped 'Not supported' test_something [4] skipped 'Not supported' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:47:18 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 27 Nov 2018 15:47:18 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. In-Reply-To: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Message-ID: <1543333638.83.0.788709270274.issue35327@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: I think this is a nice output, taking a quick look at unittest source, all the information needed to display this is save in the TestResult object, showing skipped tests is done here: https://github.com/python/cpython/blob/master/Lib/unittest/runner.py#L85 It seems to me that the change would not be very hard to add. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 10:57:03 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 27 Nov 2018 15:57:03 +0000 Subject: [issue35227] [RFE] tarfile: support adding file objects without prior known size In-Reply-To: <1542097676.97.0.788709270274.issue35227@psf.upfronthosting.co.za> Message-ID: <1543334223.08.0.788709270274.issue35227@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: I came across this thread while working on the PR, creating tarinfo as Lars Gust?bel suggests does not work since you still need to get the size before reading. Do you think the API should be different? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:12:29 2018 From: report at bugs.python.org (Baptiste Darthenay) Date: Tue, 27 Nov 2018 16:12:29 +0000 Subject: [issue35328] Set a environment variable for venv prompt Message-ID: <1543335149.71.0.788709270274.issue35328@psf.upfronthosting.co.za> New submission from Baptiste Darthenay : When creating a new virtual env with `python3 -m venv .venv --prompt env`, the prompt information is only used to set a temporary PS1. This information is lost when using custom prompt, for example with ZSH. I propose to set VIRTUAL_ENV_PROMPT=__VENV_PROMPT__ when activating the newly created venv, to be used by tools and other shells. ---------- messages: 330533 nosy: batisteo priority: normal severity: normal status: open title: Set a environment variable for venv prompt versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:15:29 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Tue, 27 Nov 2018 16:15:29 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543335329.95.0.788709270274.issue35322@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: This is because of a leak of 'wstr' at https://github.com/python/cpython/blob/1005c84535191a72ebb7587d8c5636a065b7ed79/Objects/unicodeobject.c#L3476 . There is another leak and usage of uninitialized 'str' because the following "else if" clause doesn't have a 'return' (probably due to copy-paste from unicode_decode_locale() in 3d4226a832cabc630402589cc671cc4035d504e5). ---------- nosy: +izbyshev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:17:11 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Tue, 27 Nov 2018 16:17:11 +0000 Subject: [issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings In-Reply-To: <1535046110.83.0.56676864532.issue34482@psf.upfronthosting.co.za> Message-ID: <1543335431.79.0.788709270274.issue34482@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: The added test exposed a leak in unicode_encode_locale(). See msg330534. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:25:05 2018 From: report at bugs.python.org (Baptiste Darthenay) Date: Tue, 27 Nov 2018 16:25:05 +0000 Subject: [issue35328] Set a environment variable for venv prompt In-Reply-To: <1543335149.71.0.788709270274.issue35328@psf.upfronthosting.co.za> Message-ID: <1543335905.97.0.788709270274.issue35328@psf.upfronthosting.co.za> Change by Baptiste Darthenay : ---------- keywords: +patch pull_requests: +9992 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:25:44 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Tue, 27 Nov 2018 16:25:44 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543335944.69.0.788709270274.issue35322@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: Correction: the fall-through in "else if (res == -3)" clause doesn't cause a memory leak, but still results in usage of uninitialized 'str'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:33:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 16:33:03 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543336383.86.0.788709270274.issue33029@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:43:56 2018 From: report at bugs.python.org (Hans Strijker) Date: Tue, 27 Nov 2018 16:43:56 +0000 Subject: [issue35329] Documentation - capitalization issue Message-ID: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> New submission from Hans Strijker : In the documentation I noticed "from Package import specific_submodule". I recon package should be all lowercase in accordance with pep8. (https://www.python.org/dev/peps/pep-0008/#package-and-module-names) It may be far from the most important bug ever, but it's my first bug reported, and gotta start small... :-) https://docs.python.org/3/tutorial/modules.html#importing-from-a-package 6.4.1. Importing * From a Package ... Remember, there is nothing wrong with using from Package import specific_submodule! In fact, this is the recommended notation unless the importing module needs to use submodules with the same name from different packages. ---------- assignee: docs at python components: Documentation messages: 330537 nosy: Strijker, docs at python priority: normal severity: normal status: open title: Documentation - capitalization issue versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:44:00 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 16:44:00 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543337040.85.0.788709270274.issue33029@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +9994 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 11:55:58 2018 From: report at bugs.python.org (Vidar Fauske) Date: Tue, 27 Nov 2018 16:55:58 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1543337758.91.0.788709270274.issue31512@psf.upfronthosting.co.za> Vidar Fauske added the comment: Thanks! I addressed the comment, so hopefully this should be OK now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:11:07 2018 From: report at bugs.python.org (Eryk Sun) Date: Tue, 27 Nov 2018 17:11:07 +0000 Subject: [issue35326] ctypes cast and from_address cause crash on Windows 10 In-Reply-To: <1543316403.16.0.788709270274.issue35326@psf.upfronthosting.co.za> Message-ID: <1543338667.19.0.788709270274.issue35326@psf.upfronthosting.co.za> Eryk Sun added the comment: The default function result type is c_int, which truncates a 64-bit pointer to 32-bit. The attribute that needs to be set is singular restype, not plural restypes. Unfortunately ctypes objects have a dict, so you're not catching the typo in an obvious way. Additional comments: POINTER(c_ubyte).from_address(ptr) is not the same as cast(ptr, POINTER(c_ubyte)). The first one wrongly instantiates a pointer from the value at the ptr address instead of the address itself. If you want to use from_address, where ptr is a Python integer, a correct expression for this is POINTER(c_ubyte)(c_ubyte.from_address(ptr)). I recommend using kernel32 = WinDLL('kernel32', use_last_error=True) instead of windll. This allows using ctypes.get_last_error() instead of kernel32.GetLastError(), which is especially more reliable when working in the REPL. It also avoids the problem with cached libraries on the global windll object, which can lead to prototype conflicts between libraries (e.g. if a script makes use of your library and another that uses the Windows API via ctypes, such as colorama), since libraries in turn cache function pointers. ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:26:39 2018 From: report at bugs.python.org (Noam Yorav-Raphael) Date: Tue, 27 Nov 2018 17:26:39 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value Message-ID: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> New submission from Noam Yorav-Raphael : When using mock to wrap an existing object, and using side_effect to set a function to wrap a method, I would expect the wrapper function to be called instead of the wrapped function, and its return value to be returned. Instead, both the wrapper function and the wrapped functions are being called, and the return value of the wrapped function is returned. If, in addition to side_effect, return_value is set, the return_value is ignored, but my expected behavior actually happens: only the wrapper function is called, and its return value is returned. Python 3.7.0 (default, Aug 22 2018, 20:50:05) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from unittest import mock >>> class MyClass(object): ... def func(self): ... print('func called') ... return 1 ... >>> c = MyClass() >>> m = mock.Mock(wraps=c) >>> def func2(): ... print('func2 called') ... return 2 ... >>> m.func.side_effect = func2 >>> m.func() func2 called func called 1 >>> m.func.return_value = 3 >>> m.func() func2 called 2 ---------- components: Library (Lib) messages: 330540 nosy: noamraph priority: normal severity: normal status: open title: When using mock to wrap an existing object, side_effect requires return_value type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:34:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 17:34:38 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543340078.8.0.788709270274.issue33029@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d4f9cf5545d6d8844e0726552ef2e366f5cc3abd by Serhiy Storchaka in branch 'master': bpo-33029: Fix signatures of getter and setter functions. (GH-10746) https://github.com/python/cpython/commit/d4f9cf5545d6d8844e0726552ef2e366f5cc3abd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:34:51 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 17:34:51 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543340091.15.0.788709270274.issue33029@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:44:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 17:44:28 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543340668.7.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:48:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 17:48:30 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543340910.12.0.788709270274.issue33029@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:55:11 2018 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 27 Nov 2018 17:55:11 +0000 Subject: [issue35328] Set a environment variable for venv prompt In-Reply-To: <1543335149.71.0.788709270274.issue35328@psf.upfronthosting.co.za> Message-ID: <1543341311.41.0.788709270274.issue35328@psf.upfronthosting.co.za> Anthony Sottile added the comment: The current prompt works fine for me on zsh -- what's the bug here? zsh $ virtualenv venv --prompt '(wat)' Using real prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7' New python executable in /private/tmp/venv/bin/python3.7 Also creating executable in /private/tmp/venv/bin/python Installing setuptools, pip, wheel...done. zsh $ . venv/bin/activate (wat)zsh $ ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 12:58:10 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 17:58:10 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543341490.91.0.788709270274.issue33029@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 5ceb7018dc63fab96f81d05e62bbe704e9f10cb9 by Miss Islington (bot) in branch '3.7': bpo-33029: Fix signatures of getter and setter functions. (GH-10746) https://github.com/python/cpython/commit/5ceb7018dc63fab96f81d05e62bbe704e9f10cb9 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:22:25 2018 From: report at bugs.python.org (Dan Snider) Date: Tue, 27 Nov 2018 18:22:25 +0000 Subject: [issue35331] Incorrect __module__ attribute for _struct.Struct and perhaps a few others Message-ID: <1543342945.38.0.788709270274.issue35331@psf.upfronthosting.co.za> New submission from Dan Snider : _struct.Struct not defining a valid __module__ by prefixing its tp_name slot with "_struct" is inconsistent with every other extension type which is available in the corresponding module globals. >From the documentation of the `tp_name` slot: Pointer to a NUL-terminated string containing the name of the type. For types that are accessible as module globals, the string should be the full module name, followed by a dot, followed by the type name; for built-in types, it should be just the type name. If the module is a submodule of a package, the full package name is part of the full module name. For example, a type named T defined in module M in subpackage Q in package P should have the tp_name initializer "P.Q.M.T". For dynamically allocated type objects, this should just be the type name, and the module name explicitly stored in the type dict as the value for key '__module__'. ---- I know that this is also a way to make something unpickleable, but that seems like a poor way to do it and since _struct.Struct was relatively alone in this, I figured it was an oversight. At the end is the script I made to display all currently alive "builtins" classes that have been "PyType_Ready"ed. For brevity I further manually filtered out obvious cases where a specified module would be inappropriate. The main point is that I think the new contextvars classes, _struct.Struct, and the weakref classes are missing the "_struct", "_contextvars", and "_weakref" prefixes in their tp_name slots, respectively. Since _contextvars is one of the few extension modules using the multiphase initialization protocol, maybe it should go in their type dicts (although the prefix method still works) instead, although i think the docs were referring to heap allocated types. if __name__=='__main__': import sys, collections subclassesof = type.__subclasses__ def get_types(*names): r = {"__builtins__":{'__import__':__import__, 'globals':globals}} for name in names: exec(f'from {name} import __dict__ as d; globals().update(d)', r) return dict.fromkeys(r[k] for k in r if isinstance(r[k],type)).keys() def derivative_classes(cls): a = b = r = {*subclassesof(cls)} while b: r, a, b, = r|b, b, set().union(*map(subclassesof, b)) return r | a classes = derivative_classes(object) singles = None, NotImplemented, ... od = collections.OrderedDict() odtypes = iter(od), od.keys(), od.items(), od.values() bltns = {cls for cls in classes if cls.__module__=='builtins'} bltns-= get_types('builtins', 'types', '_collections_abc') bltns-= {*map(type, odtypes)} | {*map(type, singles)} for cls in sorted(bltns, key=vars(type)['__name__'].__get__): print(f'# {sys.getrefcount(cls):4} {cls.__name__}') # all of these are in _contextvars.__dict__ but have their __module__=='builtins': # 25 Context # 15 ContextVar # 12 Token # from _struct # 23 Struct # IS in _struct.__dict__ # 11 unpack_iterator # no tp_new so make sense to leave as-is # These are here because it's a mystery how they were included in the results # without importing _testcapi: # 25 hamt # 8 hamt_array_node # 8 hamt_bitmap_node # 8 hamt_collision_node # no idea what these are: # 11 items # 11 values # 11 keys # these are all in _weakref.__dict__ # 76 weakcallableproxy # 76 weakproxy # 32 weakref ---------- messages: 330544 nosy: bup priority: normal severity: normal status: open title: Incorrect __module__ attribute for _struct.Struct and perhaps a few others versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:27:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:27:50 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543343270.84.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ad8ac54aa3d2323bdb5feb5e858a922840358187 by Serhiy Storchaka in branch '3.7': bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) https://github.com/python/cpython/commit/ad8ac54aa3d2323bdb5feb5e858a922840358187 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:28:23 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 18:28:23 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543343303.23.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +9998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:38:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:38:39 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543343919.35.0.788709270274.issue33029@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 29d2f3c47280f05795c9d4d70f4018cb1488f0ab by Serhiy Storchaka in branch '3.6': [3.6] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) (GH-10749) https://github.com/python/cpython/commit/29d2f3c47280f05795c9d4d70f4018cb1488f0ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:39:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:39:53 +0000 Subject: [issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable In-Reply-To: <1543205038.25.0.788709270274.issue35312@psf.upfronthosting.co.za> Message-ID: <1543343993.74.0.788709270274.issue35312@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c57e6e2e52d5d8b4005753bed789d99ebe407fb6 by Serhiy Storchaka (Anthony Sottile) in branch 'master': bpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710) https://github.com/python/cpython/commit/c57e6e2e52d5d8b4005753bed789d99ebe407fb6 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:49:37 2018 From: report at bugs.python.org (Baptiste Darthenay) Date: Tue, 27 Nov 2018 18:49:37 +0000 Subject: [issue35328] Set a environment variable for venv prompt In-Reply-To: <1543335149.71.0.788709270274.issue35328@psf.upfronthosting.co.za> Message-ID: <1543344577.14.0.788709270274.issue35328@psf.upfronthosting.co.za> Baptiste Darthenay added the comment: How the venv prompt name would be displayed in a project like Powerline? Or in VS Code? https://i.ibb.co/JHYrnk2/Screenshot-from-2018-11-27-19-41-47.png Or in my custom prompt? https://gist.github.com/batisteo/c5c9bd87a344cdbfb7a6401648c118a2#file-batisteo-zsh-theme-L194 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:50:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:50:14 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543344614.88.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +9999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:51:11 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Nov 2018 18:51:11 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543344671.64.0.788709270274.issue33012@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d5c8bd8e4cc04873254f0bd38895a6479c23c8aa by Miss Islington (bot) in branch '3.6': bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) https://github.com/python/cpython/commit/d5c8bd8e4cc04873254f0bd38895a6479c23c8aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 13:55:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:55:03 +0000 Subject: [issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions In-Reply-To: <1520522102.88.0.467229070634.issue33029@psf.upfronthosting.co.za> Message-ID: <1543344903.77.0.788709270274.issue33029@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have done this. Thank you for reporting about this issue. I don't have enough motivation for making a backport for 2.7. If someone want to do this, a PR is welcome. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 14:34:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 19:34:36 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543347276.85.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1c607155c9e363489036ae6258b165a3fae75134 by Serhiy Storchaka in branch 'master': bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) https://github.com/python/cpython/commit/1c607155c9e363489036ae6258b165a3fae75134 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 14:45:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 19:45:30 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543347930.77.0.788709270274.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Only one function cast warning is left, and it is a separate issue: issue33015. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 14:51:53 2018 From: report at bugs.python.org (Ronal Abraham) Date: Tue, 27 Nov 2018 19:51:53 +0000 Subject: [issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close() Message-ID: <1543348313.91.0.788709270274.issue35332@psf.upfronthosting.co.za> New submission from Ronal Abraham : These lines throw intermittently for me on AIX when removing a directory on NFS (python version 3.6.6-1), even when "ignore_errors=True": https://github.com/python/cpython/blob/v3.6.6rc1/Lib/shutil.py#L433 https://github.com/python/cpython/blob/v3.6.6rc1/Lib/shutil.py#L492 Should there be try-except blocks around these lines and calls to onerror(...)? ---------- components: Library (Lib) messages: 330553 nosy: rabraham priority: normal severity: normal status: open title: shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close() type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 15:30:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 20:30:08 +0000 Subject: [issue35317] test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone In-Reply-To: <1543244008.28.0.788709270274.issue35317@psf.upfronthosting.co.za> Message-ID: <1543350608.37.0.788709270274.issue35317@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 2.7 doesn't seem to be affected: $ TZ=UTC ./python -m test -v test_email Tests result: SUCCESS ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 15:36:01 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 27 Nov 2018 20:36:01 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543350961.95.0.788709270274.issue35330@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 15:37:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 20:37:48 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543351068.71.0.788709270274.issue35240@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10000 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 15:43:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 20:43:10 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543351390.63.0.788709270274.issue35240@psf.upfronthosting.co.za> STINNER Victor added the comment: "make doctest" has been added by commit 859c068e52a31e13e2b9bb6a3f861fa8c290cb0e of bpo-34962. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 16:13:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 21:13:10 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543353190.98.0.788709270274.issue35240@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 16:18:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 21:18:31 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543353511.94.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh cpython/pystate.h introduced this warning, when building Python with clang in release mode: In file included from Parser/node.c:3: In file included from ./Include/Python.h:107: In file included from ./Include/traceback.h:8: In file included from ./Include/pystate.h:123: ./Include/cpython/pystate.h:217:3: warning: redefinition of typedef 'PyThreadState' is a C11 feature [-Wtypedef-redefinition] } PyThreadState; ^ ./Include/pystate.h:27:20: note: previous definition is here typedef struct _ts PyThreadState; ^ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 17:28:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 22:28:04 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543357684.17.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 17:55:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 22:55:03 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543359303.23.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9bdd2de84c1af55fbc006d3f892313623bd0195c by Victor Stinner in branch 'master': bpo-35134: Don't define types twice in header files (GH-10754) https://github.com/python/cpython/commit/9bdd2de84c1af55fbc006d3f892313623bd0195c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:28:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 23:28:29 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543361309.31.0.788709270274.issue33676@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:30:59 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 27 Nov 2018 23:30:59 +0000 Subject: [issue35321] None _frozen_importlib.__spec__.origin attribute In-Reply-To: <1543274371.24.0.788709270274.issue35321@psf.upfronthosting.co.za> Message-ID: <1543361459.57.0.788709270274.issue35321@psf.upfronthosting.co.za> Brett Cannon added the comment: I can replicate. Do note, though, that PEPs are not documentation once they are implemented; at that point the official docs are what should be followed. ---------- components: +Interpreter Core -Library (Lib) nosy: -docs at python stage: -> test needed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:32:49 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 27 Nov 2018 23:32:49 +0000 Subject: [issue35320] Writable __spec__.has_location attribute In-Reply-To: <1543273216.1.0.788709270274.issue35320@psf.upfronthosting.co.za> Message-ID: <1543361569.89.0.788709270274.issue35320@psf.upfronthosting.co.za> Brett Cannon added the comment: The docs do not specify that has_location is read-only: https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.has_location . And PEPs are not updated once they are implemented as that would mean we would have to perpetually update docs in at least two different places. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:38:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Nov 2018 23:38:37 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543361917.77.0.788709270274.issue33676@psf.upfronthosting.co.za> STINNER Victor added the comment: The bug is still alive: https://buildbot.python.org/all/#/builders/168/builds/294 I found a bug using attached mp_debug.patch. I wrote PR 10755 to try to fix it. I have access to FreeBSD CURRENT buildbot. I only reproduced the bug once using: ./python -m test -v test_multiprocessing_fork -m WithThreadsTestPool --fail-env-changed -F I ran this command 4 times in parallel in 4 terminals, but I failed to reliably reproduce the bug. Even if I stress the computer using "./python -m test -j4 -r" run in different shell, or using my "system_load.py 3" script, I fail to trigger the bug. ---------- keywords: +patch resolution: out of date -> status: closed -> open Added file: https://bugs.python.org/file47953/mp_debug.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:43:17 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 27 Nov 2018 23:43:17 +0000 Subject: [issue35319] pkgutil.get_data() is a wrapper for a deprecated class In-Reply-To: <1543259758.29.0.788709270274.issue35319@psf.upfronthosting.co.za> Message-ID: <1543362197.79.0.788709270274.issue35319@psf.upfronthosting.co.za> Brett Cannon added the comment: You can use importlib.resources to read data files and such from within a package as an alternative. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 18:52:52 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Nov 2018 23:52:52 +0000 Subject: [issue34855] batch file variables In-Reply-To: <1538330156.86.0.545547206417.issue34855@psf.upfronthosting.co.za> Message-ID: <1543362772.28.0.788709270274.issue34855@psf.upfronthosting.co.za> Steve Dower added the comment: Yep, good catch. That should be EXTERNALS_DIR in PCbuild/find_python.bat. ---------- components: +Windows keywords: +easy nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:07:59 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 28 Nov 2018 00:07:59 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1543327166.4.0.788709270274.issue33930@psf.upfronthosting.co.za> Message-ID: <2C1CACB2-6204-4160-8666-2085B9130F08@mac.com> Ronald Oussoren added the comment: I don?t understand this either. For some reason the patch works when using the function and not when using the macro. I haven?t looked into this yet, and am currently traveling. I should have time to look into this starting December 5th when I?m back home. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:12:34 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 00:12:34 +0000 Subject: [issue35333] Rename private structs to use names closer to types Message-ID: <1543363954.23.0.788709270274.issue35333@psf.upfronthosting.co.za> New submission from STINNER Victor : To prevent a compiler warning/error (on clang), I had modify Include/object.h and Include/pystate.h: * Replace "PyTypeObject" with "struct _typeobject" * Replace "PyInterpreterState" with "struct _is" * Replace "PyThreadState" with "struct _ts" => see commit 9bdd2de84c1af55fbc006d3f892313623bd0195c of bpo-35134. I propose to rename "struct _ts" to "struct PyThreadState" or "struct _PyThreadState", and do a similar change for "struct _ts" and "struct _typeobject". My intent is to make the Include/object.h and Include/pystate.h less surprising. Maybe "struct _frame" should also be renamed to "struct _PyFrameObject"? -- Python header files use many "private" C structures (struct): struct _addr_pair struct _arena PyArena struct _ceval_runtime_state struct _dictkeysobject struct _err_stackitem struct _frame struct _gc_runtime_state struct _gil_runtime_state gil struct _heaptypeobject struct _is struct _longobject struct _object struct _odictobject PyODictObject struct _pending_calls struct _pycontextobject struct _pycontexttokenobject struct _pycontextvarobject struct _symtable_entry struct _traceback struct _ts struct _typeobject struct _warnings_runtime_state struct _xid struct _xidregitem The following structures are documented: * struct _frozen: https://docs.python.org/dev/c-api/import.html#c._frozen * struct _inittab: https://docs.python.org/dev/c-api/import.html#c._inittab * struct _node: https://docs.python.org/dev/c-api/veryhigh.html#c.PyParser_SimpleParseString ---------- components: Interpreter Core messages: 330564 nosy: vstinner priority: normal severity: normal status: open title: Rename private structs to use names closer to types versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:12:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 00:12:47 +0000 Subject: [issue35333] Rename private structs to use names closer to types In-Reply-To: <1543363954.23.0.788709270274.issue35333@psf.upfronthosting.co.za> Message-ID: <1543363967.57.0.788709270274.issue35333@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +nascheme, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:14:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 00:14:36 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543364076.81.0.788709270274.issue33676@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b7278736b3ae158a7738057e3045bc767ced019e by Victor Stinner in branch 'master': bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) https://github.com/python/cpython/commit/b7278736b3ae158a7738057e3045bc767ced019e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:14:44 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 00:14:44 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543364084.25.0.788709270274.issue33676@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10004 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:14:53 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 00:14:53 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543364093.69.0.788709270274.issue33676@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:30:37 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 00:30:37 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543365037.7.0.788709270274.issue33676@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 80db40cdd6a58c9d66694a43ee9a7c06ab958373 by Miss Islington (bot) in branch '3.7': bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) https://github.com/python/cpython/commit/80db40cdd6a58c9d66694a43ee9a7c06ab958373 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:37:28 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 00:37:28 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543365448.09.0.788709270274.issue33676@psf.upfronthosting.co.za> miss-islington added the comment: New changeset dd5293871703e6a12ffdde14eeaa86a73b7b0d99 by Miss Islington (bot) in branch '3.6': bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) https://github.com/python/cpython/commit/dd5293871703e6a12ffdde14eeaa86a73b7b0d99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 19:44:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 00:44:39 +0000 Subject: [issue33676] test_multiprocessing_fork: dangling threads warning In-Reply-To: <1527548628.93.0.682650639539.issue33676@psf.upfronthosting.co.za> Message-ID: <1543365879.0.0.788709270274.issue33676@psf.upfronthosting.co.za> STINNER Victor added the comment: I *hope* that it will be enough :-/ ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 20:58:02 2018 From: report at bugs.python.org (John Parejko) Date: Wed, 28 Nov 2018 01:58:02 +0000 Subject: [issue23078] unittest.mock patch autospec doesn't work on staticmethods In-Reply-To: <1418892323.1.0.910322233262.issue23078@psf.upfronthosting.co.za> Message-ID: <1543370282.41.0.788709270274.issue23078@psf.upfronthosting.co.za> John Parejko added the comment: Adding to the list of "I just ran into this". The patch submitted by fov seems straightforward enough: what can we do to help shepherd it along? ---------- nosy: +John Parejko2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 21:05:39 2018 From: report at bugs.python.org (Berker Peksag) Date: Wed, 28 Nov 2018 02:05:39 +0000 Subject: [issue23078] unittest.mock patch autospec doesn't work on staticmethods In-Reply-To: <1418892323.1.0.910322233262.issue23078@psf.upfronthosting.co.za> Message-ID: <1543370738.98.0.788709270274.issue23078@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the pings. I will work on this issue this weekend. Note that 3.4 and 3.5 are in security-fix-only mode now, so I removed them from the versions field. ---------- assignee: -> berker.peksag versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 21:22:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 02:22:52 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1543371772.98.0.788709270274.issue34523@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 21:22:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 02:22:53 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543371773.18.0.663665092547.issue35322@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10007 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 21:28:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 02:28:06 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543372086.15.0.788709270274.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I see. unicode_encode_locale() has multiple bugs in the code handling errors :-( I don't think that my commit 3d4226a832cabc630402589cc671cc4035d504e5 introduced the memory leak triggered by test_datetime, it seems older. Python 3.7 also has the bug in unicode_encode_locale(). The memory leak has been introduced by commit 7ed7aead9503102d2ed316175f198104e0cd674c, also written by me :-) ---------- stage: patch review -> versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 27 22:14:00 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 28 Nov 2018 03:14:00 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543374840.38.0.788709270274.issue34100@psf.upfronthosting.co.za> INADA Naoki added the comment: I agree that modifying tuple is bad idea in general case. But in case of constants, in-place modify is the easiest approach. Our purpose is "merging" constant. On the other hand, "build new tuple and replace old tuple" approach makes two same constant tuples. If old tuple is referenced from somewhere, we fail to "merging". So I don't think we need to follow the general principle unless it reduces code. FYI, we have similar in-place editing for interning already. https://github.com/python/cpython/blob/master/Objects/codeobject.c#L47-L95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 00:46:03 2018 From: report at bugs.python.org (Alexandr Zamaraev) Date: Wed, 28 Nov 2018 05:46:03 +0000 Subject: [issue28608] Support creating hardlink using `pathlib` Message-ID: <1543383963.73.0.788709270274.issue28608@psf.upfronthosting.co.za> Change by Alexandr Zamaraev : ---------- nosy: +shura_zam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 00:47:02 2018 From: report at bugs.python.org (Alexandr Zamaraev) Date: Wed, 28 Nov 2018 05:47:02 +0000 Subject: [issue28608] Support creating hardlink using `pathlib` Message-ID: <1543384022.76.0.788709270274.issue28608@psf.upfronthosting.co.za> New submission from Alexandr Zamaraev : see https://python-forum.io/Thread-makin-hardlinks-with-pathlib-Path?pid=57399#pid57399 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 01:53:31 2018 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Wed, 28 Nov 2018 06:53:31 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry Message-ID: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> New submission from Arno-Can Uestuensoez : Hi, I am using the installation script *adafruit-pitft.sh* which tries to apply *urllib3* which itself tries to install nested dependencies, here *evdev* from PyPI. When the installation is offline - e.g. by internal mirror of debian/raspbian - PyPI is not accessible. The code fails than by an type error exception: > adafruit-pitft.sh # or pitft.sh > https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/adafruit-pitft.sh > > ... > > _stacktrace=sys.exc_info()[2]) > File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3 none-any.whl/urllib3/util/retry.py", line 228, in increment > > total -= 1 > > TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' For the current distribution(based on debian-9.6.0/stretch): > File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment > > total -= 1 > > TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' See also: https://stackoverflow.com/questions/37495375/python-pip-install-throws-typeerror-unsupported-operand-types-for-retry The following - dirty *:) - patch enables a sounding error trace: # File: retry.py - in *def increment(self, ..* about line 315 # original: total = self.total # patch: quick-and-dirty-fix # START: if isinstance(self.total, Retry): self.total = self.total.total if type(self.total) is not int: self.total = 2 # default is 10 # END: # continue with original: total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect cause = 'unknown' status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise six.reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 The sounding output with the temporary patch is(twice...): > Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at/ > > Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at/ > > Could not find a version that satisfies the requirement evdev (from versions: ) > > No matching distribution found for evdev > > WARNING : Pip failed to install software! In this case I did not thoroughly analysed the actual error source, thus did a quick and dirty patch only. My proposal is to add the inplace operator to the class *Reply* with the default assignment in case of an type error and display an error message. This is still not really the correct solution, but resolves a lot of confusion by required interpretation of the exception. Arno-Can Uestuensoez ---------- components: Library (Lib) messages: 330574 nosy: Quentin.Pradet, acue, deivid, martin.panter priority: normal severity: normal status: open title: urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry type: crash versions: 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 Wed Nov 28 02:26:19 2018 From: report at bugs.python.org (s-ball) Date: Wed, 28 Nov 2018 07:26:19 +0000 Subject: [issue35335] msgfmt should be able to merge more than one po file Message-ID: <1543389979.14.0.788709270274.issue35335@psf.upfronthosting.co.za> New submission from s-ball : GNU gettext msgfmt can merge several po files into one single mo file. The current version of msgfmt can only compile one po file to one mo file. After looking at the code, the enhancement should be simple to implement. Command line: if one output file is given (option -o) and several input files, then all the input files should be combined. Implementation: - main should pass all the parameters to make (*args) - make should accept one single string for compatibility or an iterable of string. In that latter case, the current processing should be repeated on all input files. I could propose a patch (but I am afraid it ends being rather large) or a pull request. As a new user here, I do not know what is the best way... ---------- components: Demos and Tools messages: 330575 nosy: s-ball priority: normal severity: normal status: open title: msgfmt should be able to merge more than one po file type: enhancement versions: 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 Wed Nov 28 02:39:23 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 07:39:23 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry In-Reply-To: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> Message-ID: <1543390763.79.0.788709270274.issue35334@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think this is an issue with pip specifically with Ubuntu/Debian packaging causing the error. Please see https://github.com/pypa/pip/issues/3943, https://github.com/pypa/pip/issues/4779 and https://answers.launchpad.net/ubuntu/+question/659285 . I think this is a third party issue. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 02:42:41 2018 From: report at bugs.python.org (Chris Withers) Date: Wed, 28 Nov 2018 07:42:41 +0000 Subject: [issue35226] mock.call equality surprisingly broken In-Reply-To: <1542096332.14.0.788709270274.issue35226@psf.upfronthosting.co.za> Message-ID: <1543390961.19.0.788709270274.issue35226@psf.upfronthosting.co.za> Chris Withers added the comment: ?ric, doesn't look like I can add labels, what needs to happen for me to do so? (I was/am a core developer, just an extremely inactive one ;-), but happy to jump through whatever hoops necessary... ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 03:07:44 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Nov 2018 08:07:44 +0000 Subject: [issue35333] Rename private structs to use names closer to types In-Reply-To: <1543363954.23.0.788709270274.issue35333@psf.upfronthosting.co.za> Message-ID: <1543392464.35.0.788709270274.issue35333@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't know reasons against using the same name for the structure and the type. This can break extensions written before exposing the current Python C API in Python 1.5, but they should be already broken several times. This is a cosmetic but large change. I suggest to ask on Python-Dev for the case if somebody has objections or better idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 03:26:21 2018 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 28 Nov 2018 08:26:21 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1536176195.07.0.56676864532.issue34589@psf.upfronthosting.co.za> Message-ID: <1543393581.07.0.788709270274.issue34589@psf.upfronthosting.co.za> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 03:27:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Nov 2018 08:27:46 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543393666.7.0.788709270274.issue33930@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is hard to get a noticeable difference in macrobenchmarks. I want to see results of microbenchmarks. For tuples, the trashcan mechanism is the main culprit of the performance hit when use short-living tuples for passing arguments. For bound method objects the relative effect should be smaller, because looking up the method is more costly than building a tuple, and less bound method objects are created after implementing the method call optimization. But in any case we should know the maximal cost of this change before merging it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:02:34 2018 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Wed, 28 Nov 2018 09:02:34 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry In-Reply-To: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> Message-ID: <1543395754.83.0.788709270274.issue35334@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: @xtreak I didn't checked the source of the assignment of the instance of *Retry* to *self.total*. For me it was important to get the display of the actual source of the failure, which is the failed access to PyPI. Thus my proposal, just to intercept the error, display a bug-report, and display the quite good error message for the failed PyPI access already contained in the code. Thus the intention to replace: > File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment > > total -= 1 > > TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' by: > Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at/ > > Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at/ > > Could not find a version that satisfies the requirement evdev (from versions: ) > > No matching distribution found for evdev > > WARNING : Pip failed to install software! Optionally with an additional error message for the faulty assignment to the member *total*. But this is actually just a repetition counter, so even the integer replacement(>=1) should be OK. If an application uses it - wrongly - as a reference pointer, this will fail than immediately and the app recognises it's error straight away. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:09:18 2018 From: report at bugs.python.org (Christian Heimes) Date: Wed, 28 Nov 2018 09:09:18 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry In-Reply-To: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> Message-ID: <1543396158.66.0.788709270274.issue35334@psf.upfronthosting.co.za> Christian Heimes added the comment: This is the wrong bug tracker for urllib3. The urllib3 package is not part of Python's standard library. As xtreak pointed out, it's not even a bug in urllib3 or pip. Debian ships a modified and patched version of pip that uses an incompatible version of urllib3. Please follow up on the Debian bug tracker, ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:16:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 09:16:33 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1543374840.38.0.788709270274.issue34100@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Well, it's up to you. I will review your PR ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:18:48 2018 From: report at bugs.python.org (Leonard de Ruijter) Date: Wed, 28 Nov 2018 09:18:48 +0000 Subject: [issue19865] create_unicode_buffer() fails on non-BMP strings on Windows In-Reply-To: <1386013006.0.0.412572088185.issue19865@psf.upfronthosting.co.za> Message-ID: <1543396728.77.0.788709270274.issue19865@psf.upfronthosting.co.za> Leonard de Ruijter added the comment: I'm still able to reproduce this issue with ctypes under Python 3.7.0 ---------- nosy: +Leonard de Ruijter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:24:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 09:24:12 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543397052.97.0.788709270274.issue35240@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a22df4896f6b83c8741203118790ae281716bca5 by Victor Stinner in branch 'master': bpo-35240: Add "doctest" job to Travis CI (GH-10753) https://github.com/python/cpython/commit/a22df4896f6b83c8741203118790ae281716bca5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:25:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 09:25:49 +0000 Subject: [issue35240] Travis CI: xvfb-run: error: Xvfb failed to start In-Reply-To: <1542158379.67.0.788709270274.issue35240@psf.upfronthosting.co.za> Message-ID: <1543397149.42.0.788709270274.issue35240@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a new job to no longer run xvfb-run twice. Let's see if it works around the issue. At least, it should make Travis CI a little bit faster. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:26:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 09:26:24 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1543397184.19.0.788709270274.issue34523@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 by Victor Stinner in branch 'master': bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) https://github.com/python/cpython/commit/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:26:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 09:26:24 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543397184.43.0.702299269573.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 by Victor Stinner in branch 'master': bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) https://github.com/python/cpython/commit/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:54:45 2018 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Wed, 28 Nov 2018 09:54:45 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry In-Reply-To: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> Message-ID: <1543398885.44.0.788709270274.issue35334@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: @christian.heimes , @xtreak Thanks, just for documentation, hope this is the right place - putting one to debian later: See: issue - 1486: https://github.com/urllib3/urllib3/issues/1486 for file: https://github.com/urllib3/urllib3/blob/master/src/urllib3/util/retry.py Rem.: The issue is about the originator of the exception - which is not necessarily the original cause. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 04:59:54 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 09:59:54 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543399194.24.0.788709270274.issue35330@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 05:18:03 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 28 Nov 2018 10:18:03 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543400283.11.0.788709270274.issue34100@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- pull_requests: +10008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 05:34:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 10:34:32 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1543401272.47.0.788709270274.issue34523@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 05:34:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 10:34:32 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543401272.59.0.663665092547.issue35322@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10010 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 05:36:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 10:36:24 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543401384.8.0.788709270274.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: bpo-34482 added the test in test_datetime which triggered the bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 05:42:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 10:42:16 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 Message-ID: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> New submission from STINNER Victor : PYTHONCOERCECLOCALE=1 should not force C locale coercion, Python should still check if the LC_CTYPE locale is "C". Bug: $ ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' fr_FR.UTF-8 $ PYTHONCOERCECLOCALE=1 ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' C.UTF-8 It should be fr_FR.UTF-8 as well in the second example :-( It seems to be a regression that I introduced in the middle of my refactoring on the Python initialization. The bug is around: static void config_init_locale(_PyCoreConfig *config) { if (config->coerce_c_locale < 0) { /* The C locale enables the C locale coercion (PEP 538) */ if (_Py_LegacyLocaleDetected()) { config->coerce_c_locale = 1; } } ... } The 3.7 branch and the 3.7.0 release are affected :-( $ ./python -V Python 3.7.0 $ PYTHONCOERCECLOCALE=1 ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' C.UTF-8 ---------- components: Interpreter Core messages: 330590 nosy: vstinner priority: normal severity: normal status: open title: Bug in C locale coercion with PYTHONCOERCECLOCALE=1 versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 06:26:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 11:26:23 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543404383.82.0.788709270274.issue34100@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 06:42:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 11:42:43 +0000 Subject: [issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding) In-Reply-To: <1535413443.13.0.56676864532.issue34523@psf.upfronthosting.co.za> Message-ID: <1543405363.72.0.788709270274.issue34523@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 85ab974f78c0ebcfa611639864640d0273eb5466 by Victor Stinner in branch '3.7': bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761) https://github.com/python/cpython/commit/85ab974f78c0ebcfa611639864640d0273eb5466 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 06:42:43 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 11:42:43 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543405363.86.0.702299269573.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 85ab974f78c0ebcfa611639864640d0273eb5466 by Victor Stinner in branch '3.7': bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761) https://github.com/python/cpython/commit/85ab974f78c0ebcfa611639864640d0273eb5466 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 06:47:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 11:47:37 +0000 Subject: [issue35322] test_datetime leaks memory on Windows In-Reply-To: <1543278052.7.0.788709270274.issue35322@psf.upfronthosting.co.za> Message-ID: <1543405657.17.0.788709270274.issue35322@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested manually that "python -m test test_datetime -R 3:3" pass on 3.7 and master branches. Note: PyUnicode_DecodeLocale() is still untested, only _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() are tested. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 06:47:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 11:47:47 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543405667.65.0.788709270274.issue35134@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 07:01:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 12:01:37 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1543406497.29.0.788709270274.issue35134@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 54ba556c6c7d8fd5504dc142c2e773890c55a774 by Victor Stinner in branch 'master': bpo-35134: Create Include/cpython/tupleobject.h (GH-10764) https://github.com/python/cpython/commit/54ba556c6c7d8fd5504dc142c2e773890c55a774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 07:01:58 2018 From: report at bugs.python.org (Mark Lawrence) Date: Wed, 28 Nov 2018 12:01:58 +0000 Subject: [issue19865] create_unicode_buffer() fails on non-BMP strings on Windows In-Reply-To: <1386013006.0.0.412572088185.issue19865@psf.upfronthosting.co.za> Message-ID: <1543406518.57.0.788709270274.issue19865@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 07:32:08 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 12:32:08 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543408328.52.0.788709270274.issue35330@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I did some debugging with docstring for wraps. > `wraps`: Item for the mock object to wrap. If `wraps` is not None then > calling the Mock will pass the call through to the wrapped object > (returning the real result). Attribute access on the mock will return a > Mock object that wraps the corresponding attribute of the wrapped object > (so attempting to access an attribute that doesn't exist will raise an > `AttributeError`). > If the mock has an explicit return_value set then calls are not passed to the wrapped object and the return_value is returned instead. So calling mock.Mock(wraps=c) sets the _mock_wraps with c. When we set m.func.side_effect and call m.func() it checks for the side_effect (func2) to be a callable and calls it [0]. It also checks if self._mock_wraps is not None which in this case is MyClass() and checks for the func of Myclass that is also called at [1] . As per the docstring since it wraps the actual object calling m.invalid_func without return_value set will cause attribute error like "AttributeError: 'MyClass' object has no attribute 'invalid_func'" It seems to be a general case with mock itself where when side_effect and return_value are set then side_effect is called and ignores the return_value set unless the side_effect returns the sentinel value DEFAULT as in test [2]. I find this to be surprising. $ ./python.exe Python 3.8.0a0 (heads/master:b7278736b3, Nov 28 2018, 10:26:47) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from unittest import mock >>> m = mock.Mock() >>> m.side_effect = lambda : 2 >>> m.return_value = 3 >>> m() # side_effect and return_value are set returning side_effect 2 >>> f = mock.Mock() >>> f.return_value = 3 >>> f() # side_effect is not set thus returns only return_value 3 As per the original report when there is a return_value set without the side_effect it returns the set return_value. When there is a return_value set with the side_effect then return value of the side effect is returned though return_value is explicitly set like above also with wraps >>> m = mock.Mock(wraps=c) >>> print(m.func()) func called 1 >>> m.func.return_value = 3 >>> print(m.func()) 3 >>> f = mock.Mock(wraps=c) >>> f.func.side_effect = func2 >>> f.func.return_value = 3 >>> print(f.func()) func2 called 2 [0] https://github.com/python/cpython/blob/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6/Lib/unittest/mock.py#L1031 [1] https://github.com/python/cpython/blob/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6/Lib/unittest/mock.py#L1041 [2] https://github.com/python/cpython/blob/54ba556c6c7d8fd5504dc142c2e773890c55a774/Lib/unittest/test/testmock/testmock.py#L156 ---------- nosy: +mariocj89, michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 07:39:39 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 12:39:39 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543408779.57.0.788709270274.issue35330@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: A little more discussion over side_effect and return_value precedence : issue22541 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:17:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 13:17:08 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode Message-ID: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> New submission from STINNER Victor : I propose to add assertions to PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode to check the index when Python is compiled in debug mode (./configure --with-pydebug). This change is backward incompatible when PyTuple_GET_ITEM/PyTuple_SET_ITEM is used on a structseq with unnamed fields. Well, that's a bug in the user code, PyStructSequence_GET_ITEM/PyStructSequence_SET_ITEM should be used instead. ---------- components: Interpreter Core messages: 330597 nosy: vstinner priority: normal severity: normal status: open title: Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:18:55 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 28 Nov 2018 13:18:55 +0000 Subject: [issue19865] create_unicode_buffer() fails on non-BMP strings on Windows In-Reply-To: <1386013006.0.0.412572088185.issue19865@psf.upfronthosting.co.za> Message-ID: <1543411135.82.0.788709270274.issue19865@psf.upfronthosting.co.za> Change by Josh Rosenberg : ---------- keywords: +3.2regression versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:19:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 13:19:10 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543411150.17.0.788709270274.issue35337@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10013 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:20:06 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 28 Nov 2018 13:20:06 +0000 Subject: [issue19865] create_unicode_buffer() fails on non-BMP strings on Windows In-Reply-To: <1386013006.0.0.412572088185.issue19865@psf.upfronthosting.co.za> Message-ID: <1543411206.2.0.788709270274.issue19865@psf.upfronthosting.co.za> Change by Josh Rosenberg : ---------- keywords: -3.2regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:30:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 13:30:00 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543411800.52.0.788709270274.issue35337@psf.upfronthosting.co.za> STINNER Victor added the comment: My commit df108dc6610e41c54ed064a854e3903c143f0d77 already added assert(PyTuple_Check(op)) to these two macros. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 08:50:59 2018 From: report at bugs.python.org (Mario Corchero) Date: Wed, 28 Nov 2018 13:50:59 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543413059.59.0.788709270274.issue35330@psf.upfronthosting.co.za> Mario Corchero added the comment: I can indeed reproduce the issue. The problem seems to be here: https://github.com/python/cpython/blob/54ba556c6c7d8fd5504dc142c2e773890c55a774/Lib/unittest/mock.py#L1041 The simplified current logic in that code is: - call side_effect, save the return value in ret. - if return_value is not set, call the wraps object and return it. - return the value in ret from the first step. That explains why you see your "expected behavior" to happen only when return value is set. Basically, the logic disables the current wrapped object ONLY if return value is set. I am not sure why it was not done for `side_effect` as well. Trying to perform that change in the sourcecode (nor run wraps if side_effect is set) results in no failure from the tests, which might mean it is a bug One might claim the code is there because `side_effect` might still be used to cause a side effect but not return, I would disagree, especially as setting `return_value` totally breaks it. As once the `return_value` is set, both `return_value` and `wraps` are ignored and `side_effect` takes preference due to line 1044. Especially as the docs say about side_effect: `unless it returns DEFAULT, the return value of this function is used as the return value.` I'd suggest a patch adding the `and not effect` to line 1041, so `side_effect` takes preference over `wraps`, the same way `return_value` does today. The behavior of `side_effect` taken precedence over `return_value` is fine, that is how Mock works. This bug can be reproduced without a class at all, see: ``` from unittest import mock def func(): print('Original func called') return "ORIGINAL" m = mock.Mock(wraps=func) def side_effect(): print('Side effect func called') return "SIDE EFFECT" m.side_effect = side_effect print(m()) ``` Results in: ``` Side effect func called Original func called ORIGINAL ``` Whilst the expected is: ``` Side effect func called SIDE EFFECT ``` ## TL;DR; Indeed, `side_effect` seems broken when applied to an object with wraps and setting `return_value` kind of "fixes it". I'd send a fix to add the check for `effect` unless michael.foord or someone else knows a good reason of why things are not like that. + tests Noam Yorav-Raphael I am happy to send the patch if you don't have time :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 09:19:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 14:19:57 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543414797.83.0.788709270274.issue35337@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38 by Victor Stinner in branch 'master': bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765) https://github.com/python/cpython/commit/1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 09:50:56 2018 From: report at bugs.python.org (David Miguel Susano Pinto) Date: Wed, 28 Nov 2018 14:50:56 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments Message-ID: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> New submission from David Miguel Susano Pinto : set union, intersection, difference methods accept any non-zero number of sets and return a new set instance, like so: >>> a = set([1, 2]) >>> b = set([1, 3]) >>> c = set([3, 5]) >>> set.union(a, b, c) {1, 2, 3, 5} even if it's only one argument: >>> set.union(a) {1, 2} I think it would be nice if zero arguments were not an error: >>> set.union() Traceback (most recent call last): File "", line 1, in TypeError: descriptor 'union' of 'set' object needs an argument This would allow to handle any sequence of sets which otherwise requires this: if len(sequence): return set.union(*sequence) else: return set() ---------- messages: 330601 nosy: carandraug priority: normal severity: normal status: open title: set union/intersection/difference could accept zero arguments type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 10:01:36 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 15:01:36 +0000 Subject: [issue35330] When using mock to wrap an existing object, side_effect requires return_value In-Reply-To: <1543339599.43.0.788709270274.issue35330@psf.upfronthosting.co.za> Message-ID: <1543417296.56.0.788709270274.issue35330@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Thanks @mariocj89 for the explanation. I just got to the docs part about side_effect and return_value precedence. I am curious to know about the behavior as well and at least this can be added as a test as I see only around 3 tests for side_effect and there is no test for wraps behavior in this report I assume given that there were no test failures due to changing the logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 10:23:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 15:23:11 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543418591.34.0.788709270274.issue35337@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 10:24:11 2018 From: report at bugs.python.org (SilentGhost) Date: Wed, 28 Nov 2018 15:24:11 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543418651.76.0.788709270274.issue35338@psf.upfronthosting.co.za> SilentGhost added the comment: You can write your code like this: set().union(*sequence) as well as: a.union(b, c) if you already have a set object available. ---------- nosy: +SilentGhost versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 10:35:24 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 28 Nov 2018 15:35:24 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543419324.37.0.788709270274.issue35338@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I agree with @SilentGhost to use set().union(*sequence) which is compatible with Python 2 too. ---------- nosy: +rhettinger, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 10:58:49 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 15:58:49 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543420729.77.0.788709270274.issue34100@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 by Victor Stinner (INADA Naoki) in branch 'master': bpo-34100: compile: Re-enable frozenset merging (GH-10760) https://github.com/python/cpython/commit/f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:00:26 2018 From: report at bugs.python.org (ebw) Date: Wed, 28 Nov 2018 16:00:26 +0000 Subject: [issue30689] len() and iter() of ChainMap don't work with unhashable keys In-Reply-To: <1497702703.77.0.955908214036.issue30689@psf.upfronthosting.co.za> Message-ID: <1543420826.12.0.788709270274.issue30689@psf.upfronthosting.co.za> ebw added the comment: I actually have a real life use case of that problem. Using the eval() function of pandas need to use a custom resolver: class Resolver(object): def __getitem__(self, name): if name == "test": return 0.5 else: raise KeyError resolvers = (Resolver(), ) pd.eval("test", resolvers=resolvers) But pandas store the resolvers used for eval() in a DeepChainMap and uses bool(len(self.resolvers)) in the property has_resolvers. Which with my custom Resolver raise a KeyError because __getiem__ gets call with name = 0. The way to solve/bypass the problem was to make Resolver a inherit from UserDict. class Resolver(UserDict): def __init__(self, data={}): super(Resolver, self).__init__(data) self.data["test"] = None def __getitem__(self, name): if (name == "test"): return 0.5 else: super(Resolver, self).__getitem__(name) resolvers = (Resolver(), ) pd.eval("test", resolvers=resolvers) I had to add a dummy "test" value to Resolver.data dict to avoid len(self.resolvers) to be 0. I tried to implement Resolver.__len__, keys... but it didn't help has ChainMap compute the len using set().union(*self.maps). ---------- nosy: +ebw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:05:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 16:05:45 +0000 Subject: [issue34100] Same constants in tuples are not merged while compile() In-Reply-To: <1531336111.06.0.56676864532.issue34100@psf.upfronthosting.co.za> Message-ID: <1543421145.69.0.788709270274.issue34100@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks INADA Naoki! Thanks a simple and cool optimization! Maybe you might want to document it at https://docs.python.org/dev/whatsnew/3.8.html#optimizations ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:16:40 2018 From: report at bugs.python.org (SilentGhost) Date: Wed, 28 Nov 2018 16:16:40 +0000 Subject: [issue35335] msgfmt should be able to merge more than one po file In-Reply-To: <1543389979.14.0.788709270274.issue35335@psf.upfronthosting.co.za> Message-ID: <1543421800.29.0.788709270274.issue35335@psf.upfronthosting.co.za> SilentGhost added the comment: The best way is to propose a PR via github (here are some details: https://devguide.python.org/pullrequest/) This sort of change, can only be applied against master (future 3.8), so don't spend time on legacy releases. ---------- nosy: +SilentGhost versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:18:48 2018 From: report at bugs.python.org (SilentGhost) Date: Wed, 28 Nov 2018 16:18:48 +0000 Subject: [issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close() In-Reply-To: <1543348313.91.0.788709270274.issue35332@psf.upfronthosting.co.za> Message-ID: <1543421928.43.0.788709270274.issue35332@psf.upfronthosting.co.za> Change by SilentGhost : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:20:56 2018 From: report at bugs.python.org (SilentGhost) Date: Wed, 28 Nov 2018 16:20:56 +0000 Subject: [issue35331] Incorrect __module__ attribute for _struct.Struct and perhaps a few others In-Reply-To: <1543342945.38.0.788709270274.issue35331@psf.upfronthosting.co.za> Message-ID: <1543422056.39.0.788709270274.issue35331@psf.upfronthosting.co.za> Change by SilentGhost : ---------- nosy: +mark.dickinson, meador.inge, serhiy.storchaka type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:21:58 2018 From: report at bugs.python.org (SilentGhost) Date: Wed, 28 Nov 2018 16:21:58 +0000 Subject: [issue35311] exception unpickling error causes `multiprocessing.Pool` to hang forever In-Reply-To: <1543183325.55.0.788709270274.issue35311@psf.upfronthosting.co.za> Message-ID: <1543422118.46.0.788709270274.issue35311@psf.upfronthosting.co.za> Change by SilentGhost : ---------- nosy: +alexandre.vassalotti type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:39:35 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 28 Nov 2018 16:39:35 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543423175.59.0.788709270274.issue35338@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:51:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 16:51:47 +0000 Subject: [issue28604] localeconv() doesn't support LC_MONETARY encoding different than LC_CTYPE encoding In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1543423907.41.0.788709270274.issue28604@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Exception raised by python3.5 when using en_GB locale -> localeconv() doesn't support LC_MONETARY encoding different than LC_CTYPE encoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:52:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 16:52:24 +0000 Subject: [issue28604] localeconv() doesn't support LC_MONETARY encoding different than LC_CTYPE encoding In-Reply-To: <1478208394.68.0.721396484587.issue28604@psf.upfronthosting.co.za> Message-ID: <1543423944.31.0.788709270274.issue28604@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-31900: localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:52:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 16:52:47 +0000 Subject: [issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding In-Reply-To: <1509370865.74.0.213398074469.issue31900@psf.upfronthosting.co.za> Message-ID: <1543423967.06.0.788709270274.issue31900@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-28604: localeconv() doesn't support LC_MONETARY encoding different than LC_CTYPE encoding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:53:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 16:53:58 +0000 Subject: [issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding In-Reply-To: <1509370865.74.0.213398074469.issue31900@psf.upfronthosting.co.za> Message-ID: <1543424038.46.0.788709270274.issue31900@psf.upfronthosting.co.za> STINNER Victor added the comment: The initial bug has been fixed, I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:54:40 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 28 Nov 2018 16:54:40 +0000 Subject: [issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition In-Reply-To: <1471355745.98.0.805545529346.issue27777@psf.upfronthosting.co.za> Message-ID: <1543424080.52.0.788709270274.issue27777@psf.upfronthosting.co.za> Change by Pierre Quentel : ---------- pull_requests: +10015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 11:59:35 2018 From: report at bugs.python.org (Ismo Toijala) Date: Wed, 28 Nov 2018 16:59:35 +0000 Subject: [issue34921] NoReturn not allowed by get_type_hints when future import annotations is used In-Reply-To: <1538912765.08.0.545547206417.issue34921@psf.upfronthosting.co.za> Message-ID: <1543424375.89.0.788709270274.issue34921@psf.upfronthosting.co.za> Change by Ismo Toijala : ---------- pull_requests: +10016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:01:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 17:01:55 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543424515.3.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:03:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 17:03:59 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543424639.14.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: A test failed again on AppVeyor! In the 3.7 branch, on this test: def busy_wait(duration): deadline = time.monotonic() + duration while time.monotonic() < deadline: pass (...) def test_thread_time(self): (...) # bpo-33723: A busy loop of 100 ms should increase thread_time() # by at least 15 ms, but less than 30 ms in other threads. # Tolerate 15 and 30 ms because of the bad resolution # of the clock on Windows (around 15.6 ms). min_time = 0.015 max_time = 0.030 busy_time = 0.100 # thread_time() should include CPU time spent in current thread... start = time.thread_time() busy_wait(busy_time) stop = time.thread_time() self.assertGreaterEqual(stop - start, min_time) # <===== HERE ===== (...) FAIL: test_thread_time (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\projects\cpython\lib\test\test_time.py", line 550, in test_thread_time self.assertGreaterEqual(stop - start, min_time) AssertionError: 0.0 not greater than or equal to 0.015 IMHO the root issue is that time.thread_time() and time.monotonic() clocks are just... unrelated... on Windows. This time, I give up and wrote a PR to remove the "busy loop" tests, sorry! PR 10773. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:05:42 2018 From: report at bugs.python.org (Daugeras) Date: Wed, 28 Nov 2018 17:05:42 +0000 Subject: [issue35339] Populating instances of class automatically Message-ID: <1543424742.68.0.788709270274.issue35339@psf.upfronthosting.co.za> New submission from Daugeras : Hello, I am not sure it is a bug, but it is a very strange behavior of Python, which I do not understand. I created a class (mainly a structure) and instantiated an object of this class in a first function (Object 1). The function populates Object 1. In another function, I instantiate another object of the same class (Object 2) , and Object 2 is automatically populated with the data of Object 1. Note than Object 1 and Object 2 have different memory adresses. This behavior is very strange. Is it normal for Python or is it a Bug ? ---------- messages: 330613 nosy: Daugeras priority: normal severity: normal status: open title: Populating instances of class automatically type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:08:56 2018 From: report at bugs.python.org (Geoffrey Spear) Date: Wed, 28 Nov 2018 17:08:56 +0000 Subject: [issue35339] Populating instances of class automatically In-Reply-To: <1543424742.68.0.788709270274.issue35339@psf.upfronthosting.co.za> Message-ID: <1543424936.42.0.788709270274.issue35339@psf.upfronthosting.co.za> Geoffrey Spear added the comment: It's impossible to guess exactly what you did from your vague description instead of actual code, but it may be covered by this FAQ question: https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects (mutable objects as class rather than instance attributes will display similar behavior. This isn't a bug.) ---------- nosy: +geoffreyspear _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:17:11 2018 From: report at bugs.python.org (Matthias Klose) Date: Wed, 28 Nov 2018 17:17:11 +0000 Subject: [issue35340] global symbol "freegrammar" should be made static ore renamed Message-ID: <1543425431.95.0.788709270274.issue35340@psf.upfronthosting.co.za> New submission from Matthias Klose : seen at least on the 2.7, a new symbol polluting the symbol namespace. the global symbol "freegrammar" should be made static ore renamed ---------- components: Interpreter Core messages: 330615 nosy: doko priority: normal severity: normal status: open title: global symbol "freegrammar" should be made static ore renamed versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:17:38 2018 From: report at bugs.python.org (Ismo Toijala) Date: Wed, 28 Nov 2018 17:17:38 +0000 Subject: [issue35341] Add generic version of OrderedDict to typing module Message-ID: <1543425458.24.0.788709270274.issue35341@psf.upfronthosting.co.za> New submission from Ismo Toijala : The other collections from the collections module (namedtuple, deque, ChainMap, Counter, defaultdict) have generic versions in the typing module for use in type annotations. The problem is currently the following: from __future__ import annotations import typing from collections import OrderedDict # Understood by mypy def f(d: OrderedDict[str, str]) -> None: pass typing.get_type_hints(f) gives: Traceback (most recent call last): File "foo.py", line 9, in typing.get_type_hints(f) File "/usr/lib/python3.7/typing.py", line 1001, in get_type_hints value = _eval_type(value, globalns, localns) File "/usr/lib/python3.7/typing.py", line 260, in _eval_type return t._evaluate(globalns, localns) File "/usr/lib/python3.7/typing.py", line 464, in _evaluate eval(self.__forward_code__, globalns, localns), File "", line 1, in TypeError: 'type' object is not subscriptable To fix this, a line like the following could be added to Lib/typing.py near line 1250: OrderedDict = _alias(collections.OrderedDict, (KT, VT)) There might be a reasoning for why this has not been done yet, but I have not been able to find any. If this is acceptable, I could prepare a PR. I suppose there is no hope of a backport to 3.7, since this is a new feature (though very minor). ---------- components: Library (Lib) messages: 330616 nosy: itoijala priority: normal severity: normal status: open title: Add generic version of OrderedDict to typing module type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:19:03 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:19:03 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543425543.12.0.788709270274.issue34022@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:19:03 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:19:03 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1543425543.31.0.663665092547.issue29708@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:22:13 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 28 Nov 2018 17:22:13 +0000 Subject: [issue34921] NoReturn not allowed by get_type_hints when future import annotations is used In-Reply-To: <1538912765.08.0.545547206417.issue34921@psf.upfronthosting.co.za> Message-ID: <1543425733.63.0.788709270274.issue34921@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: New changeset f71a5922916abd6cc7bf7d99ed4715b6e96e5981 by Ivan Levkivskyi (Ismo Toijala) in branch '3.7': bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772) https://github.com/python/cpython/commit/f71a5922916abd6cc7bf7d99ed4715b6e96e5981 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:26:00 2018 From: report at bugs.python.org (Mordechai Botrashvily) Date: Wed, 28 Nov 2018 17:26:00 +0000 Subject: [issue35326] ctypes cast and from_address cause crash on Windows 10 In-Reply-To: <1543316403.16.0.788709270274.issue35326@psf.upfronthosting.co.za> Message-ID: <1543425960.85.0.788709270274.issue35326@psf.upfronthosting.co.za> Mordechai Botrashvily added the comment: Eryk, thanks :). This really solved the problem. Odd how it went unnoticed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:26:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 17:26:41 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543426001.18.0.788709270274.issue34022@psf.upfronthosting.co.za> STINNER Victor added the comment: test_compileall, test_importlib, test_py_compile: I created https://github.com/python/cpython/pull/10775 backport. test_cmd_line_script, test_runpy and test_multiprocessing_main_handling failures are related to zipimport. They have been fixed in master by commit a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 which modifies Lib/zipimport.py... but in 3.7, zipimport is written in C. It seems non-trivial to fix zipimport, and I'm not sure that it's worth it. Note: test_posix now pass, no idea why it failed a few days ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:30:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 17:30:12 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543426212.73.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 48498dd57f79ab1d061c754ad6a2ebe1a7172b0e by Victor Stinner in branch 'master': bpo-33723: Remove busy loop from test_time (GH-10773) https://github.com/python/cpython/commit/48498dd57f79ab1d061c754ad6a2ebe1a7172b0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:30:21 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:30:21 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543426221.67.0.788709270274.issue33723@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10020 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:37:10 2018 From: report at bugs.python.org (Richard Brooksby) Date: Wed, 28 Nov 2018 17:37:10 +0000 Subject: [issue35342] email "default" policy raises exception iterating over unparseable date headers Message-ID: <1543426629.99.0.788709270274.issue35342@psf.upfronthosting.co.za> New submission from Richard Brooksby : It is not possible to loop over the headers of a message with an unparseable date field using the "default" policy. This means that a poison email can break email processing. I expect to be able to process an email with an unparseable date field using the "default" policy. $ python3 --version Python 3.6.7 $ python3 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email >>> import email.policy >>> email.message_from_string('Date: not a parseable date', policy=email.policy.default).items() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/email/message.py", line 460, in items for k, v in self._headers] File "/usr/lib/python3.6/email/message.py", line 460, in for k, v in self._headers] File "/usr/lib/python3.6/email/policy.py", line 162, in header_fetch_parse return self.header_factory(name, value) File "/usr/lib/python3.6/email/headerregistry.py", line 589, in __call__ return self[name](name, value) File "/usr/lib/python3.6/email/headerregistry.py", line 197, in __new__ cls.parse(value, kwds) File "/usr/lib/python3.6/email/headerregistry.py", line 306, in parse value = utils.parsedate_to_datetime(value) File "/usr/lib/python3.6/email/utils.py", line 210, in parsedate_to_datetime *dtuple, tz = _parsedate_tz(data) TypeError: 'NoneType' object is not iterable >>> Related: https://docs.python.org/3/library/email.headerregistry.html#email.headerregistry.DateHeader does not specify what happens to the datetime field if a date header cannot be parsed. Related: https://docs.python.org/3/library/email.utils.html#email.utils.parsedate_to_datetime does not specify what happens if a date cannot be parsed. Suggested tests: random fuzz testing of the contents of all email headers, especially those with parsers in the header registry. ---------- components: email messages: 330621 nosy: barry, r.david.murray, rptb1 priority: normal severity: normal status: open title: email "default" policy raises exception iterating over unparseable date headers type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:45:26 2018 From: report at bugs.python.org (Richard Brooksby) Date: Wed, 28 Nov 2018 17:45:26 +0000 Subject: [issue35342] email "default" policy raises exception iterating over unparseable date headers In-Reply-To: <1543426629.99.0.788709270274.issue35342@psf.upfronthosting.co.za> Message-ID: <1543427126.03.0.788709270274.issue35342@psf.upfronthosting.co.za> Change by Richard Brooksby : ---------- versions: +Python 3.6 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:45:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:45:40 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543427140.6.0.788709270274.issue34022@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 24b51b1a4919e310d338629cc60371387f475a32 by Miss Islington (bot) in branch '3.7': bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) https://github.com/python/cpython/commit/24b51b1a4919e310d338629cc60371387f475a32 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:45:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:45:40 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1543427140.83.0.702299269573.issue29708@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 24b51b1a4919e310d338629cc60371387f475a32 by Miss Islington (bot) in branch '3.7': bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) https://github.com/python/cpython/commit/24b51b1a4919e310d338629cc60371387f475a32 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:48:15 2018 From: report at bugs.python.org (Richard Brooksby) Date: Wed, 28 Nov 2018 17:48:15 +0000 Subject: [issue35342] email "default" policy raises exception iterating over unparseable date headers In-Reply-To: <1543426629.99.0.788709270274.issue35342@psf.upfronthosting.co.za> Message-ID: <1543427295.53.0.788709270274.issue35342@psf.upfronthosting.co.za> Change by Richard Brooksby : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:54:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Nov 2018 17:54:07 +0000 Subject: [issue24412] setUpClass equivalent for addCleanup In-Reply-To: <1433788299.35.0.440062273493.issue24412@psf.upfronthosting.co.za> Message-ID: <1543427647.31.0.788709270274.issue24412@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: /home/serhiy/py/cpython/Lib/unittest/test/test_runner.py:259: DeprecationWarning: Please use assertEqual instead. self.assertEquals(e, 'cleanup1') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 12:58:34 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Nov 2018 17:58:34 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543427914.39.0.788709270274.issue33723@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d46d753d152a5d01f9c454d18b1ae660509d9b16 by Miss Islington (bot) in branch '3.7': bpo-33723: Remove busy loop from test_time (GH-10773) https://github.com/python/cpython/commit/d46d753d152a5d01f9c454d18b1ae660509d9b16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 13:05:37 2018 From: report at bugs.python.org (Pierre Quentel) Date: Wed, 28 Nov 2018 18:05:37 +0000 Subject: [issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition In-Reply-To: <1471355745.98.0.805545529346.issue27777@psf.upfronthosting.co.za> Message-ID: <1543428337.89.0.788709270274.issue27777@psf.upfronthosting.co.za> Pierre Quentel added the comment: I have submitted another Pull Request (10771) that seems to fix the bug while passing all the tests in test_cgi.py ---------- nosy: +quentel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 13:17:59 2018 From: report at bugs.python.org (R. David Murray) Date: Wed, 28 Nov 2018 18:17:59 +0000 Subject: [issue35342] email "default" policy raises exception iterating over unparseable date headers In-Reply-To: <1543426629.99.0.788709270274.issue35342@psf.upfronthosting.co.za> Message-ID: <1543429079.87.0.788709270274.issue35342@psf.upfronthosting.co.za> R. David Murray added the comment: This is effectively a duplicate of #30681, which has a solution, although it is not yet in final form per the last couple of comments on the issue and the PR. ---------- resolution: -> duplicate stage: -> resolved superseder: -> email.utils.parsedate_to_datetime() should return None when date cannot be parsed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 13:23:33 2018 From: report at bugs.python.org (R. David Murray) Date: Wed, 28 Nov 2018 18:23:33 +0000 Subject: [issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed In-Reply-To: <1497568363.46.0.596536376967.issue30681@psf.upfronthosting.co.za> Message-ID: <1543429413.91.0.788709270274.issue30681@psf.upfronthosting.co.za> R. David Murray added the comment: Reported again in issue #35342. The existing PR is close to complete, but needs adjusted for the fact that we want (and want to document) that the utility raises errors (ie: catch the error in the header parser rather than having the utility return None). ---------- versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 15:32:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 20:32:42 +0000 Subject: [issue33723] test_time.test_thread_time() failed on AMD64 Debian root 3.x In-Reply-To: <1527803116.79.0.682650639539.issue33723@psf.upfronthosting.co.za> Message-ID: <1543437162.28.0.788709270274.issue33723@psf.upfronthosting.co.za> STINNER Victor added the comment: I removed the "busy loop" tests from 3.7 and master. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 16:45:02 2018 From: report at bugs.python.org (Daugeras) Date: Wed, 28 Nov 2018 21:45:02 +0000 Subject: [issue35339] Populating instances of class automatically In-Reply-To: <1543424742.68.0.788709270274.issue35339@psf.upfronthosting.co.za> Message-ID: <1543441502.08.0.788709270274.issue35339@psf.upfronthosting.co.za> Daugeras added the comment: Hi Geoffrey, Indeed you where right, this is not a bug. The link you provided did solve my problem. I declared classes with attributes as strings, lists, etc... and indeed it was the reason for the issue. I changed it to instantiate the attributes in the __init__ method of the class, and it solved the problems. Thanks again !! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:03:48 2018 From: report at bugs.python.org (Owen Pembery) Date: Wed, 28 Nov 2018 22:03:48 +0000 Subject: [issue35343] Importlib.reload has different behaviour in script and interactive mode Message-ID: <1543442628.31.0.788709270274.issue35343@psf.upfronthosting.co.za> New submission from Owen Pembery : This may be a bug, or may be a hole in my understanding of how importlib.reload works. In short, when running importlib.reload in a script, it seems that a module is not reloaded before it is used, whereas running the same script a line at a time in interactive mode seems to reload the script. Relevant scripts are in the github repository: https://github.com/orpembery/python-reload-bug. I find the bug using python 3.5.2 on Ubuntu 16.04. The expected output from running python3 master.py is: 1 2 However, I instead find that the output is: 1 1 If I paste the commands in master.py into the interpreter one at a time, I get the expected behaviour: Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from shutil import copy >>> >>> from importlib import reload >>> # Move a file ... copy('fn_1.py','fn.py') 'fn.py' >>> # Import it ... import fn >>> # Run it ... fn.fn() 1 >>> # Move a different file to the same location. ... copy('fn_2.py','fn.py') 'fn.py' >>> # Reload it ... reload(fn) >>> # Run it ... fn.fn() 2 However, if the commands in master.py are pasted in all at one (i.e., with a single CTRL-V keystroke), I obtain the unexpected behaviour: Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from shutil import copy >>> from importlib import reload >>> >>> # Move a file ... copy('fn_1.py','fn.py') 'fn.py' >>> >>> # Import it ... import fn >>> >>> # Run it ... fn.fn() 1 >>> >>> # Move a different file to the same location. ... copy('fn_2.py','fn.py') 'fn.py' >>> >>> # Reload it ... reload(fn) >>> >>> # Run it ... fn.fn() 1 Possible causes: I'm very far from an expert, but it seems to be something to do with caching; running python3 -B master.py gives the expected behaviour. ---------- components: Library (Lib) messages: 330631 nosy: brett.cannon, orpembery priority: normal severity: normal status: open title: Importlib.reload has different behaviour in script and interactive mode versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:04:25 2018 From: report at bugs.python.org (Owen Pembery) Date: Wed, 28 Nov 2018 22:04:25 +0000 Subject: [issue35343] Importlib.reload has different behaviour in script and interactive mode In-Reply-To: <1543442628.31.0.788709270274.issue35343@psf.upfronthosting.co.za> Message-ID: <1543442665.78.0.788709270274.issue35343@psf.upfronthosting.co.za> Change by Owen Pembery : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:23:07 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Nov 2018 22:23:07 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543443787.87.0.788709270274.issue35316@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Some buildbots failing with this problem: https://buildbot.python.org/all/#/builders/145/builds/849 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:24:03 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Nov 2018 22:24:03 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543443843.34.0.788709270274.issue35316@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I will investigate with MacOS Mojave this week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:24:07 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Nov 2018 22:24:07 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543443847.49.0.788709270274.issue35316@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- assignee: -> pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:49:45 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 22:49:45 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543445385.07.0.788709270274.issue35316@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm unable to reproduce the issue using "./python.exe Lib/test/eintrdata/eintr_tester.py -v SelectEINTRTest.test_select" on macOS 10.13.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:53:22 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Nov 2018 22:53:22 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543445602.14.0.788709270274.issue33930@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: > Can someone please explain me why this change has any impact? Does it mean that _PyObject_GC_UNTRACK() macro has a bug? Interestingly, this lonely and perplexing comment is left in PyObject_GC_UnTrack (the function): void PyObject_GC_UnTrack(void *op) { /* Obscure: the Py_TRASHCAN mechanism requires that we be able to * call PyObject_GC_UnTrack twice on an object. */ if (_PyObject_GC_IS_TRACKED(op)) { _PyObject_GC_UNTRACK(op); } } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 17:55:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 22:55:01 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? Message-ID: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> New submission from STINNER Victor : Would it be possible to get the macOS version (platform.mac_ver()) rather than the darwin version (uname()) for platform.platform()? As an user, I prefer the OS (macOS) version rather than the kernel (darwin) version. Current output $ ./python.exe -m platform Darwin-17.7.0-x86_64-i386-64bit versus $ ./python.exe -c 'import platform; print(platform.mac_ver())' ('10.13.6', ('', '', ''), 'x86_64') I tested on: $ uname -a Darwin macbook 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64 $ sw_vers ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65 ---------- components: Library (Lib), macOS messages: 330636 nosy: ned.deily, ronaldoussoren, vstinner priority: normal severity: normal status: open title: platform: get macOS version rather than darwin version? versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 18:05:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 23:05:48 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: <1543446348.26.0.788709270274.issue35344@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like platform.mac_ver() can return None if plistlist is not available. platform.platform() can maybe try mac_ver(), but fallback on uname() if it's not available/working? -- It seems like getting the macOS version without plistlib is not easy: https://stackoverflow.com/questions/11072804/how-do-i-determine-the-os-version-at-runtime-in-os-x-or-ios-without-using-gesta ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 18:42:49 2018 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 28 Nov 2018 23:42:49 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543448569.95.0.788709270274.issue35337@psf.upfronthosting.co.za> Zackery Spytz added the comment: See also #14614. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 18:46:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 23:46:06 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: <1543448766.14.0.788709270274.issue35344@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10021 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 18:54:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Nov 2018 23:54:11 +0000 Subject: [issue35345] Remove platform.popen(), deprecated since Python 3.3 Message-ID: <1543449251.4.0.788709270274.issue35345@psf.upfronthosting.co.za> New submission from STINNER Victor : platform.popen() is deprecated since Python 3.3: bpo-11377. Calling the function emits a DeprecationWarning and the function is documented as being deprecated. The function is documented in the "Win95/98 specific": https://docs.python.org/dev/library/platform.html#win95-98-specific Python 3.5 dropped Windows XP support. I don't think that Python 2.7 still support Windows 98. So it's time to remove support for this old OS. Python 3 now has a os.popen() function: https://docs.python.org/dev/library/os.html#os.popen ---------- components: Library (Lib) messages: 330639 nosy: vstinner priority: normal severity: normal status: open title: Remove platform.popen(), deprecated since Python 3.3 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:00:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:00:16 +0000 Subject: [issue35345] Remove platform.popen(), deprecated since Python 3.3 In-Reply-To: <1543449251.4.0.788709270274.issue35345@psf.upfronthosting.co.za> Message-ID: <1543449616.55.0.788709270274.issue35345@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10022 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:11:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:11:53 +0000 Subject: [issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var In-Reply-To: <1530533915.92.0.56676864532.issue34022@psf.upfronthosting.co.za> Message-ID: <1543450313.35.0.788709270274.issue34022@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset 24b51b1a4919e310d338629cc60371387f475a32 by Miss Islington (bot) in branch '3.7': With this change, only 3 tests fail on 3.7, and all these 3 fail because of zipimport: test_cmd_line_script, test_multiprocessing_main_handling and test_runpy. Chih-Hsuan Yen: > Looks like in https://github.com/python/cpython/pull/10327, Serhiy Storchaka considers fixing these issues for 3.8 only - "It is easier to skip the test on 3.7." and then remove the "needs backport to 3.7" label. How about changing the target version to 3.8 only and close this issue? Now I agree to close the issue :-) I'm ok to not fix zipimport in 3.7. Anyway, it's not like Python is perfect in the master branch: frozenset in marshal is still not reproducible. See bpo-29708. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:15:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:15:29 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543450529.83.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:15:29 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:15:29 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543450529.97.0.663665092547.issue35316@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10024 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:18:35 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 29 Nov 2018 00:18:35 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543448766.19.0.702299269573.issue35344@psf.upfronthosting.co.za> Message-ID: Ronald Oussoren added the comment: Why do you want to change this? The current behavior is consistent with the platform name (Darwin). I?ve filed an issue in the past to change the platform name to ?macosx?, but there were good arguments to not change the behavior at the time. The existence of iOS might change that though. W.r.t. failing when the Plist is not present: that is unlikely to happen because this is a system file that is hard to remove and is AFAIK documented to exist. If the platform version info gets changed, the platform name should change as well. Ps. Sorry about the lack of references, I?m away from my computer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:23:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:23:46 +0000 Subject: [issue14614] PyTuple_SET_ITEM could check bounds in debug mode In-Reply-To: <1334761414.21.0.756614621806.issue14614@psf.upfronthosting.co.za> Message-ID: <1543451026.25.0.788709270274.issue14614@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I didn't know this old issue (6 years old). I wrote an implementation of this issue for PyTuple_GET_ITEM/SET_ITEM: bpo-35337. Would you mind to have a look? It seems to be backward incompatible when these macros are misused on structseq. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:24:21 2018 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Nov 2018 00:24:21 +0000 Subject: [issue34977] Release Windows Store app containing Python In-Reply-To: <1539470627.18.0.788709270274.issue34977@psf.upfronthosting.co.za> Message-ID: <1543451061.35.0.788709270274.issue34977@psf.upfronthosting.co.za> Steve Dower added the comment: Updated testing instructions - this one should work with just sideloading permissions I think. iwr "https://dev.azure.com/Python/8e426817-76c0-4b99-ba9e-a48a1e4bd5db/_apis/build/builds/34760/artifacts?artifactName=appx&api-version=5.0-preview.5&%24format=zip" -outfile python37.zip Expand-Archive .\python37.zip . Add-AppxPackage appx\python.msix To remove: Remove-AppxPackage (Get-AppxPackage *Python.3.7) (delete the downloaded files) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:28:45 2018 From: report at bugs.python.org (Tim Bell) Date: Thu, 29 Nov 2018 00:28:45 +0000 Subject: [issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed In-Reply-To: <1497568363.46.0.596536376967.issue30681@psf.upfronthosting.co.za> Message-ID: <1543451325.92.0.788709270274.issue30681@psf.upfronthosting.co.za> Change by Tim Bell : ---------- keywords: +patch pull_requests: +10025 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:34:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:34:33 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: <1543451673.85.0.788709270274.issue35344@psf.upfronthosting.co.za> STINNER Victor added the comment: > Why do you want to change this? I created this issue after I read this comment: > https://bugs.python.org/issue35316#msg330633 > I will investigate with MacOS Mojave this week. "Mojave" seems to be the new thing, but I don't recall if my macbook is running it or not. So I checked "python3 -m platform" but it gives me... the darwin version. How am I supposed to guess the macOS version from this output? As an user, I see/use "High Sierra" name, or sometimes "macOS 10.12", but I never see/use darwin versions. Even inside Python, we rely on the macOS version, not the on the darwin version. For example, @requires_mac_ver of test.support rely on the *macOS* version. Example from test_math: # log2() is not accurate enough on Mac OS X Tiger (10.4) @support.requires_mac_ver(10, 5) def testLog2Exact(self): ... > The current behavior is consistent with the platform name (Darwin). I?ve filed an issue in the past to change the platform name to ?macosx?, but there were good arguments to not change the behavior at the time. I don't expect that any library rely on platform.platform() to detect a platform, so I don't see any risk of backward incompatibility, whereas changing sys.platform would just break every single Python library for what? I don't see any benefit of replacing "darwin" with "macos" or "macosx". By the way, we use "win32" for sys.platform, whereas all Windows are now 64-bit... > W.r.t. failing when the Plist is not present: that is unlikely to happen because this is a system file that is hard to remove and is AFAIK documented to exist. I was talking about the plistlib module, not the file on the disk. I am talking about these lines from platform.py: try: import plistlib except ImportError: return None The import can fail for various reasons: module not provided by the Python implementation, missing depending (ex: "from xml.parsers.expat import ParserCreate" in plistlib.py causing an import error), etc. I'm not saying that it should be common on CPython, just that it might happen in some weird cases :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:34:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:34:55 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543451695.47.0.788709270274.issue35189@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2956bffbc00127af65f69e04d7979021a21d1288 by Victor Stinner in branch 'master': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/2956bffbc00127af65f69e04d7979021a21d1288 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:34:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:34:55 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543451695.63.0.702299269573.issue35316@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2956bffbc00127af65f69e04d7979021a21d1288 by Victor Stinner in branch 'master': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/2956bffbc00127af65f69e04d7979021a21d1288 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:35:25 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:35:25 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543451725.35.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:35:25 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:35:25 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543451725.44.0.663665092547.issue35316@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:35:43 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:35:43 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543451743.46.0.788709270274.issue35189@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:35:43 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:35:43 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543451743.55.0.663665092547.issue35316@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:37:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:37:36 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: <1543451856.31.0.788709270274.issue35344@psf.upfronthosting.co.za> STINNER Victor added the comment: > I?ve filed an issue in the past to change the platform name to ?macosx?, but there were good arguments to not change the behavior at the time. The existence of iOS might change that though. I'm not sure that we are talking about the same thing. I'm talking about sys.platform. Are you talking about platform.system()? We might change platform.system(), but that change might be backward incompatible and I'm not sure that it's worth it. -- Why only changing platform.platform()? See the doc: .. function:: platform(aliased=0, terse=0) Returns a single string identifying the underlying platform with as much useful information as possible. The output is intended to be *human readable* rather than machine parseable. It may look different on different platforms and this is intended. (...) This string is for humans, and it is not machine parseable. So there is no risk of backward incompatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:52:08 2018 From: report at bugs.python.org (Tim Bell) Date: Thu, 29 Nov 2018 00:52:08 +0000 Subject: [issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed In-Reply-To: <1497568363.46.0.596536376967.issue30681@psf.upfronthosting.co.za> Message-ID: <1543452728.09.0.788709270274.issue30681@psf.upfronthosting.co.za> Tim Bell added the comment: I've addressed the points in the last few comments and created a new PR (10783). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:52:15 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:52:15 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543452735.28.0.788709270274.issue35189@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 by Miss Islington (bot) in branch '3.7': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:52:15 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:52:15 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543452735.4.0.702299269573.issue35316@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 by Miss Islington (bot) in branch '3.7': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:56:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 00:56:59 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot In-Reply-To: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> Message-ID: <1543453019.37.0.788709270274.issue35136@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'm trying to figure out the exact OpenSSL version. It used to be part of pythoninfo step. Did you click on "view all 165 lines"? I like to click on [download] to open the output in my text editor (gvim). ssl info from pythoninfo: ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1a 20 Nov 2018 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 1, 15) ssl.OP_ALL: 0x80000054 ssl.OP_NO_TLSv1_1: 0x10000000 That's the boring OpenSSL, not the funny LibreSSL, no? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:57:21 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:57:21 +0000 Subject: [issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) In-Reply-To: <1541681130.38.0.788709270274.issue35189@psf.upfronthosting.co.za> Message-ID: <1543453041.86.0.788709270274.issue35189@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 833a7067a4d5621d024511d9166db7331c4650c9 by Miss Islington (bot) in branch '3.6': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/833a7067a4d5621d024511d9166db7331c4650c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 19:57:22 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 00:57:22 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543453042.28.0.702299269573.issue35316@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 833a7067a4d5621d024511d9166db7331c4650c9 by Miss Islington (bot) in branch '3.6': bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) https://github.com/python/cpython/commit/833a7067a4d5621d024511d9166db7331c4650c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:14:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:14:17 +0000 Subject: [issue34521] Multiple tests (test_socket, test_multiprocessing_*) fail due to incorrect recvmsg(2) buffer lengths, causing failures on FreeBSD CURRENT In-Reply-To: <1535389978.32.0.56676864532.issue34521@psf.upfronthosting.co.za> Message-ID: <1543454057.51.0.788709270274.issue34521@psf.upfronthosting.co.za> STINNER Victor added the comment: > Is test_socket of Python 2.7 affected by the issue? If not, I suggest to remove 2.7 from this issue and close it. Some "FD transfer" tests of test_multiprocessing still fail on AMD64 FreeBSD CURRENT Shared 2.7: https://buildbot.python.org/all/#/builders/169/builds/36 Re-running test 'test_multiprocessing' in verbose mode FAIL: test_fd_transfer (test.test_multiprocessing.WithProcessesTestConnection) FAIL: test_large_fd_transfer (test.test_multiprocessing.WithProcessesTestConnection) Modules/_multiprocessing/multiprocessing.c uses CMSG_SPACE() *and* CMSG_LEN(). Are they used properly? I don't understand the code, but I propose: diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index d192a074ba..eecace887e 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -167,7 +167,7 @@ multiprocessing_recvfd(PyObject *self, PyObject *args) cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_len = CMSG_SPACE(sizeof(int)); msg.msg_controllen = cmsg->cmsg_len; Py_BEGIN_ALLOW_THREADS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:16:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:16:26 +0000 Subject: [issue35316] test_eintr fails randomly on macOS In-Reply-To: <1543241507.8.0.788709270274.issue35316@psf.upfronthosting.co.za> Message-ID: <1543454186.22.0.788709270274.issue35316@psf.upfronthosting.co.za> STINNER Victor added the comment: > I will investigate with MacOS Mojave this week. Ok, so I leave the issue open. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:18:58 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Nov 2018 01:18:58 +0000 Subject: [issue34521] Multiple tests (test_socket, test_multiprocessing_*) fail due to incorrect recvmsg(2) buffer lengths, causing failures on FreeBSD CURRENT In-Reply-To: <1535389978.32.0.56676864532.issue34521@psf.upfronthosting.co.za> Message-ID: <1543454338.85.0.788709270274.issue34521@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I did not backport this still because the code is very different and it required more time to understand how it works on 2.7. I do not have access currently to koobs buildbot (the IP has changed) so I cannot check if that works :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:42:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:42:39 +0000 Subject: [issue35346] Modernize Lib/platform.py code Message-ID: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/platform.py still contains code to support Python 2.3. It's maybe time to modernize it. platform imports subprocess since commit fc990e942fb55be78e8352f4913749e91cac381d. The two calls to os.popen() can now be replaced with subprocess.Popen. ---------- components: Library (Lib) messages: 330657 nosy: vstinner priority: normal severity: normal status: open title: Modernize Lib/platform.py code versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:44:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:44:03 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543455843.24.0.788709270274.issue35346@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10030 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:51:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:51:25 +0000 Subject: [issue28167] remove platform.linux_distribution() In-Reply-To: <1473933007.75.0.131793274646.issue28167@psf.upfronthosting.co.za> Message-ID: <1543456285.4.0.788709270274.issue28167@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:54:17 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 29 Nov 2018 01:54:17 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543451856.31.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: Ronald Oussoren added the comment: I should have been clearer in my previous post. I?m not against changing this, but would like an implementation that returns consistent information: either return ?macOS? and the macOS version, or ?Darwin? and the kernel version. IIRC there is, or used to be, a similar issue on Linux where the regular API does not return distribution information. I cannot check the details at the moment. Btw. macOS Mojave is the latest macOS release, 10.14, released in September or October. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 20:58:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 01:58:20 +0000 Subject: [issue35344] platform: get macOS version rather than darwin version? In-Reply-To: <1543445701.98.0.788709270274.issue35344@psf.upfronthosting.co.za> Message-ID: <1543456700.36.0.788709270274.issue35344@psf.upfronthosting.co.za> STINNER Victor added the comment: > I?m not against changing this, but would like an implementation that returns consistent information: either return ?macOS? and the macOS version, or ?Darwin? and the kernel version. See my PR 10780. It returns "macOS-10.13.6-x86_64" (macOS + macOS version) if mac_ver() works, or "Darwin-17.7.0-x86_64" otherwise (Darwin + darwin version). > Btw. macOS Mojave is the latest macOS release, 10.14, released in September or October. "sw_vers" and platform.mac_ver() confirmed what I guessed: I didn't upgrade yet :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 21:14:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 02:14:08 +0000 Subject: [issue28167] remove platform.linux_distribution() In-Reply-To: <1473933007.75.0.131793274646.issue28167@psf.upfronthosting.co.za> Message-ID: <1543457648.18.0.788709270274.issue28167@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7cc1fa40b76de34a0fe86162667c87ce7a18f33d by Victor Stinner in branch 'master': bpo-28167: Remove platform._dist_try_harder() (GH-10787) https://github.com/python/cpython/commit/7cc1fa40b76de34a0fe86162667c87ce7a18f33d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 22:36:26 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 03:36:26 +0000 Subject: [issue35341] Add generic version of OrderedDict to typing module In-Reply-To: <1543425458.24.0.788709270274.issue35341@psf.upfronthosting.co.za> Message-ID: <1543462586.37.0.788709270274.issue35341@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 28 23:02:32 2018 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 29 Nov 2018 04:02:32 +0000 Subject: [issue35341] Add generic version of OrderedDict to typing module In-Reply-To: <1543425458.24.0.788709270274.issue35341@psf.upfronthosting.co.za> Message-ID: <1543464152.5.0.788709270274.issue35341@psf.upfronthosting.co.za> Guido van Rossum added the comment: Given that this is in collections, I don't object. Ivan, what do you say? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 00:45:00 2018 From: report at bugs.python.org (Eddie Elizondo) Date: Thu, 29 Nov 2018 05:45:00 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543470300.4.0.788709270274.issue16086@psf.upfronthosting.co.za> Change by Eddie Elizondo : ---------- pull_requests: +10032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 00:50:57 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 05:50:57 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543470657.93.0.788709270274.issue27903@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I guess this can be closed as out of date since the function was removed with https://github.com/python/cpython/pull/10787/. cc: Victor ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 01:41:01 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 29 Nov 2018 06:41:01 +0000 Subject: [issue35339] Populating instances of class automatically In-Reply-To: <1543424742.68.0.788709270274.issue35339@psf.upfronthosting.co.za> Message-ID: <1543473661.48.0.788709270274.issue35339@psf.upfronthosting.co.za> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 01:44:03 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 29 Nov 2018 06:44:03 +0000 Subject: [issue35340] global symbol "freegrammar" should be made static ore renamed In-Reply-To: <1543425431.95.0.788709270274.issue35340@psf.upfronthosting.co.za> Message-ID: <1543473843.08.0.788709270274.issue35340@psf.upfronthosting.co.za> Steven D'Aprano added the comment: What "freegrammar" symbol are you referring to? Why should it be made static or renamed? 2.7 is something like a decade old now, why do you describe this as a new symbol? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 02:10:58 2018 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Thu, 29 Nov 2018 07:10:58 +0000 Subject: [issue35334] urllib3 fails with type error exception, when cannot reach PyPI - urllib3.util.retry In-Reply-To: <1543388010.85.0.788709270274.issue35334@psf.upfronthosting.co.za> Message-ID: <1543475458.31.0.788709270274.issue35334@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: In order to avoid further confusion (github: #1486): > This is the wrong bug tracker for urllib3. The urllib3 package is not part of Python's standard library. => OK. # As xtreak pointed out, it's not even a bug in urllib3 or pip. Debian ships a modified and patched version of pip that uses an incompatible version of urllib3. Please follow up on the Debian bug tracker, => not the issue as I posted it. The file is: urllib3.util.retry, So NOK, see issue-text: > My proposal is to add the inplace operator to the class *Reply* with the default assignment in case of an type error and display an error message. > This is still not really the correct solution, but resolves a lot of confusion by required interpretation of the exception. Anyhow, going to issue a bug report to debian. ---------- pull_requests: +10033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 02:22:58 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 07:22:58 +0000 Subject: [issue35340] global symbol "freegrammar" should be made static ore renamed In-Reply-To: <1543425431.95.0.788709270274.issue35340@psf.upfronthosting.co.za> Message-ID: <1543476178.46.0.788709270274.issue35340@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It was added in issue27780. ---------- nosy: +benjamin.peterson, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 02:25:59 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 29 Nov 2018 07:25:59 +0000 Subject: [issue35340] global symbol "freegrammar" should be made static ore renamed In-Reply-To: <1543425431.95.0.788709270274.issue35340@psf.upfronthosting.co.za> Message-ID: <1543476359.43.0.788709270274.issue35340@psf.upfronthosting.co.za> Change by Benjamin Peterson : ---------- keywords: +patch pull_requests: +10034 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 02:37:19 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 29 Nov 2018 07:37:19 +0000 Subject: [issue35340] global symbol "freegrammar" should be made static ore renamed In-Reply-To: <1543425431.95.0.788709270274.issue35340@psf.upfronthosting.co.za> Message-ID: <1543477039.68.0.788709270274.issue35340@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 2e869a8f8280b5c786b3fde1f990e13927625e7a by Benjamin Peterson in branch '2.7': closes bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788) https://github.com/python/cpython/commit/2e869a8f8280b5c786b3fde1f990e13927625e7a ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 03:01:58 2018 From: report at bugs.python.org (Javier Castillo II) Date: Thu, 29 Nov 2018 08:01:58 +0000 Subject: [issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME In-Reply-To: <1401593302.24.0.994822187168.issue21622@psf.upfronthosting.co.za> Message-ID: <1543478518.0.0.788709270274.issue21622@psf.upfronthosting.co.za> Javier Castillo II added the comment: The PR 10460 ( for 3.8 ) patches the search attempts to leverage LD_LIBRARY_PATH for the Linux case and catches the case after SONAME, gcc and ldconfig behaviors fail. While this may not be set in all environments ( like the musl based Alpine docker image ) setting the environment variable is within the user's control and when properly set does return found libraries. PR 10461 and PR 10462 are closed for now, as backports to 2.7 and 3.7 need to have the 3.8 accepted first before being reviewed. ---------- nosy: +jcastillo2nd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 03:58:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 08:58:23 +0000 Subject: [issue35345] Remove platform.popen(), deprecated since Python 3.3 In-Reply-To: <1543449251.4.0.788709270274.issue35345@psf.upfronthosting.co.za> Message-ID: <1543481903.49.0.788709270274.issue35345@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 73104fa1e6a791f7d66c0091ed91f6c396ca0fb2 by Victor Stinner in branch 'master': bpo-35345: Remove platform.popen() (GH-10781) https://github.com/python/cpython/commit/73104fa1e6a791f7d66c0091ed91f6c396ca0fb2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 03:59:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 08:59:21 +0000 Subject: [issue35345] Remove platform.popen(), deprecated since Python 3.3 In-Reply-To: <1543449251.4.0.788709270274.issue35345@psf.upfronthosting.co.za> Message-ID: <1543481961.0.0.788709270274.issue35345@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:11:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 09:11:44 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543482704.12.0.788709270274.issue16086@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9fbcfc08e5814d7aa9287740187e461425a99f67 by Victor Stinner (Eddie Elizondo) in branch 'master': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) https://github.com/python/cpython/commit/9fbcfc08e5814d7aa9287740187e461425a99f67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:11:49 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 09:11:49 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543482709.71.0.788709270274.issue16086@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:12:02 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 09:12:02 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543482722.25.0.788709270274.issue16086@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:32:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 09:32:02 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization Message-ID: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> New submission from STINNER Victor : Failure seen on the Windows XP buildbot: https://buildbot.python.org/all/#/builders/45/builds/288 0:02:14 [ 35/404/1] test_socket failed test test_socket failed -- Traceback (most recent call last): File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_socket.py", line 1020, in testRecv self.fail("Error trying to do non-blocking recv.") AssertionError: Error trying to do non-blocking recv. In fact, the master branch still uses the weak 100 ms sleep as synchronization primitive :-( Attached PR replaces time.sleep() with a threading.Event(). ---------- components: Tests messages: 330671 nosy: vstinner priority: normal severity: normal status: open title: test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:36:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 09:36:19 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543484179.99.0.788709270274.issue35347@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10038 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:53:25 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 29 Nov 2018 09:53:25 +0000 Subject: [issue35341] Add generic version of OrderedDict to typing module In-Reply-To: <1543425458.24.0.788709270274.issue35341@psf.upfronthosting.co.za> Message-ID: <1543485205.42.0.788709270274.issue35341@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Yes, since we already have `DefaultDict`, `Counter`, and `ChainMap` from collections, we can also add `OrderedDict`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 04:55:52 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 29 Nov 2018 09:55:52 +0000 Subject: [issue35341] Add generic version of OrderedDict to typing module In-Reply-To: <1543425458.24.0.788709270274.issue35341@psf.upfronthosting.co.za> Message-ID: <1543485352.81.0.788709270274.issue35341@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Also typing is technically still provisional, we can backport this to previous versions (at least to 3.7). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 05:05:14 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 10:05:14 +0000 Subject: [issue28608] Support creating hardlink using `pathlib` In-Reply-To: <1543384022.76.0.788709270274.issue28608@psf.upfronthosting.co.za> Message-ID: <1543485914.35.0.788709270274.issue28608@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Just to add to this os.link supports path-like objects. Adding @pitrou to take a call on this. ---------- nosy: +pitrou, xtreak versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 05:24:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 10:24:46 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543487086.78.0.788709270274.issue35337@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is compatibility breaking change. Currently you can get the address of the array of tuple items by using &PyTuple_GET_ITEM(obj, 0). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 05:57:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 10:57:55 +0000 Subject: [issue35337] Check index in PyTuple_GET_ITEM/PyTuple_SET_ITEM in debug mode In-Reply-To: <1543411028.15.0.788709270274.issue35337@psf.upfronthosting.co.za> Message-ID: <1543489074.99.0.788709270274.issue35337@psf.upfronthosting.co.za> STINNER Victor added the comment: > This is compatibility breaking change. Right. The question is if you are ok with it :-) > Currently you can get the address of the array of tuple items by using &PyTuple_GET_ITEM(obj, 0). I don't get your point. I know that you access directly obj->ob_item to use directly the C array rather than PyTuple_GET_ITEM/PyTuple_SET_ITEM, but the issue is about making PyTuple_GET_ITEM/PyTuple_SET_ITEM stricter in debug mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:01:32 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 29 Nov 2018 11:01:32 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1543489292.95.0.788709270274.issue30167@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 82daa60defbd6497efdaa6c1132ecc8563122ed5 by INADA Naoki in branch 'master': bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415) https://github.com/python/cpython/commit/82daa60defbd6497efdaa6c1132ecc8563122ed5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:07:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 11:07:36 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543489656.49.0.788709270274.issue16086@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e754159ef0af99a4124dd041ab7ceb77fcc922ad by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789) https://github.com/python/cpython/commit/e754159ef0af99a4124dd041ab7ceb77fcc922ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:07:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 11:07:40 +0000 Subject: [issue16086] tp_flags: Undefined behaviour with 32 bits long In-Reply-To: <1348934655.6.0.704339106877.issue16086@psf.upfronthosting.co.za> Message-ID: <1543489660.94.0.788709270274.issue16086@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2a852a2b122cf9545909234cdc8fca564dc8f805 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10790) https://github.com/python/cpython/commit/2a852a2b122cf9545909234cdc8fca564dc8f805 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:15:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 11:15:41 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543490141.93.0.788709270274.issue27903@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:16:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 11:16:14 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543490174.66.0.788709270274.issue27903@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 3.6 and 3.7 are still supported. The patch LGTM, I converted it to a PR. ---------- resolution: out of date -> status: closed -> open versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:31:10 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 11:31:10 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543491070.69.0.788709270274.issue27903@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7eeab87263b831adbe617a4af7ec5b5d9296962a by Victor Stinner in branch '3.7': bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) https://github.com/python/cpython/commit/7eeab87263b831adbe617a4af7ec5b5d9296962a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:31:23 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 11:31:23 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543491083.62.0.788709270274.issue27903@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10040 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 06:53:21 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 11:53:21 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543492401.55.0.788709270274.issue27903@psf.upfronthosting.co.za> miss-islington added the comment: New changeset cbf57674e257617977b35c016e861a52b5f65359 by Miss Islington (bot) in branch '3.6': bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) https://github.com/python/cpython/commit/cbf57674e257617977b35c016e861a52b5f65359 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:04:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 12:04:32 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543493072.87.0.788709270274.issue27903@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Ville Skytt? for your bugfix! I applied it in 3.6 and 3.7 branches. FYI as Karthikeyan Singaravelan wrote, the function is gone (I removed it) from the master branch ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:04:41 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 12:04:41 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543493081.88.0.788709270274.issue27903@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:08:04 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 12:08:04 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543493284.6.0.788709270274.issue27903@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Ah sorry I forgot the previous versions that had this code. Thanks for the catch and PR victor :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:08:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 12:08:48 +0000 Subject: [issue27903] Avoid ResourceWarnings from platform._dist_try_harder In-Reply-To: <1472591978.31.0.987771003839.issue27903@psf.upfronthosting.co.za> Message-ID: <1543493328.64.0.788709270274.issue27903@psf.upfronthosting.co.za> STINNER Victor added the comment: No problem, thanks for "cc-ing" me ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:33:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 12:33:34 +0000 Subject: [issue35348] Problems with handling the file command output in platform.architecture() Message-ID: <1543494814.29.0.788709270274.issue35348@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The code of _syscmd_file() in the platform module does not match the docstring. The "-b" option was removed in 685fffa (issue16112), and this leads to inclusion the executable path in the file command output. If the executable path contains some key strings like "32-bit" or "PE", platform.architecture() can return an incorrect result. I think that the "-b" option should be restored. $ python3 -c 'import platform; print(platform.architecture("/usr/bin/python3.6"))' ('64bit', 'ELF') $ cp /usr/bin/python3.6 /tmp/32-bitPE $ python3 -c 'import platform; print(platform.architecture("/tmp/32-bitPE"))' ('32bit', 'ELF') Other problem is that the code tests if the string "executable" is contained in the file command output. But it is not always contained for executables on Linux. $ file python python: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d3cfa06c2bdcbf7b6af9e4e6be5061cb8398c086, with debug_info, not stripped $ file /usr/bin/python2.7 /usr/bin/python2.7: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=fd3904306c73383fb371287416257b82d6a3363b, stripped $ file /usr/bin/python3.6 /usr/bin/python3.6: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9dae0eec9b3f9cb82612d20dc0c3088feab9e356, stripped ---------- components: Library (Lib) messages: 330686 nosy: lemburg, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Problems with handling the file command output in platform.architecture() type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:34:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 12:34:03 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543494843.7.0.788709270274.issue35346@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- dependencies: +Problems with handling the file command output in platform.architecture() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:42:36 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 12:42:36 +0000 Subject: [issue24412] setUpClass equivalent for addCleanup In-Reply-To: <1433788299.35.0.440062273493.issue24412@psf.upfronthosting.co.za> Message-ID: <1543495356.27.0.788709270274.issue24412@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- pull_requests: +10041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 07:52:22 2018 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 29 Nov 2018 12:52:22 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543495942.65.0.788709270274.issue35338@psf.upfronthosting.co.za> Mark Dickinson added the comment: What would the intersection of zero sets be? The only reasonable mathematical answer is either "not defined", or "the universe" - i.e., the set containing everything, but what would "everything" be in a Python context? I also don't see how a difference of zero sets makes any sense; you need a set to start subtracting items from. So I think this feature request only really applies to union. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 08:25:24 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Thu, 29 Nov 2018 13:25:24 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543497924.9.0.788709270274.issue35338@psf.upfronthosting.co.za> R?mi Lapeyre added the comment: The intersection of an empty set of sets is either the empty set or the universe sets so if set.union() is defined to support set.union(*sequence), wouldn't it be less surprising for set.intersection() to return the empty set too? ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:10:05 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 14:10:05 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543500605.43.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:22:54 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:22:54 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543501374.27.0.788709270274.issue33012@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:27:12 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:27:12 +0000 Subject: [issue35348] Problems with handling the file command output in platform.architecture() In-Reply-To: <1543494814.29.0.788709270274.issue35348@psf.upfronthosting.co.za> Message-ID: <1543501632.22.0.788709270274.issue35348@psf.upfronthosting.co.za> STINNER Victor added the comment: Why does platform has to analyze sys.executable binary to check if it's 32 or 64 bits? Can't we use sizeof(void*) for example? Is it something related to FAT binary on macOS? (single binary for 32 and 64 bits, or single binary for PPC and x86) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:27:55 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 14:27:55 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543501675.5.0.788709270274.issue33012@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1659c08d5d17357597f220c4d297b19e7a59737c by Miss Islington (bot) in branch '3.7': bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) https://github.com/python/cpython/commit/1659c08d5d17357597f220c4d297b19e7a59737c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:43:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:43:28 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1543502608.47.0.788709270274.issue31625@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e1b210342fa08685bf9b24eb449a2f079f1b50f5 by Victor Stinner (stratakis) in branch '3.6': [3.6] bpo-31625: Stop using ranlib (GH-10417) https://github.com/python/cpython/commit/e1b210342fa08685bf9b24eb449a2f079f1b50f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:46:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:46:30 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1543502790.02.0.788709270274.issue31625@psf.upfronthosting.co.za> STINNER Victor added the comment: Maybe it would be possible to keep ranlib in Python 3.6, but it seems safe to remove it. The master doesn't use ranlib and the compilation is fine in our large fleet of buildbot workers. I chose to backport the change to be able to backport the clang LTO fix. ---------- resolution: -> fixed status: open -> closed versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:46:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:46:50 +0000 Subject: [issue31625] stop using ranlib In-Reply-To: <1506665732.66.0.213398074469.issue31625@psf.upfronthosting.co.za> Message-ID: <1543502810.63.0.788709270274.issue31625@psf.upfronthosting.co.za> STINNER Victor added the comment: clang LTO fix: bpo-28015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:49:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:49:24 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1543502964.61.0.788709270274.issue33012@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 77000bbb104021b89368b9f7cab6f1417794e348 by Victor Stinner in branch '3.6': bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) (GH-10796) https://github.com/python/cpython/commit/77000bbb104021b89368b9f7cab6f1417794e348 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:57:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:57:52 +0000 Subject: [issue35131] Cannot access to customized paths within .pth file In-Reply-To: <1541066197.73.0.788709270274.issue35131@psf.upfronthosting.co.za> Message-ID: <1543503472.85.0.788709270274.issue35131@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 09:58:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 14:58:35 +0000 Subject: [issue33944] Deprecate and remove pth files In-Reply-To: <1529688140.44.0.56676864532.issue33944@psf.upfronthosting.co.za> Message-ID: <1543503515.5.0.788709270274.issue33944@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 10:05:12 2018 From: report at bugs.python.org (Leonard de Ruijter) Date: Thu, 29 Nov 2018 15:05:12 +0000 Subject: [issue35349] collections.abc.Sequence isn't an abstract base class for array.array Message-ID: <1543503912.1.0.788709270274.issue35349@psf.upfronthosting.co.za> New submission from Leonard de Ruijter : array.array seems to have all the abstract methods of a collections.abc.Sequence and all the classes it inherits from, still the following returns False: `isinstance(array.array("u"), collections.abc.Sequence)` ---------- messages: 330695 nosy: Leonard de Ruijter priority: normal severity: normal status: open title: collections.abc.Sequence isn't an abstract base class for array.array type: behavior versions: 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 Thu Nov 29 10:17:50 2018 From: report at bugs.python.org (David) Date: Thu, 29 Nov 2018 15:17:50 +0000 Subject: [issue35350] importing "ctypes" immediately causes a segmentation fault Message-ID: <1543504667.76.0.788709270274.issue35350@psf.upfronthosting.co.za> New submission from David : ~Environment Cross compiled Python 2.7.15 for ARM Cortex-A7 target, Linux Kernel 4.18 uname -a: Linux Test-0002 4.18.13 #1 SMP Wed Oct 31 11:20:07 CET 2018 armv7l GNU/Linux ~Description of the problem Importing the "ctypes" module in order to load shared libraries causes a segmentation fault: root [ /tmpfs/root ] $ python Python 2.7.15 (default, Nov 29 2018, 13:57:56) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Segmentation fault I have found a similiar issue here: https://bugs.python.org/issue11048 But the changes are already applied in 2.7.15. Here is the GDB output similiar to the link I posted: (gdb) file python2.7 Reading symbols from python2.7...done. (gdb) run -c "import ctypes" Starting program: /usr/bin/python2.7 -c "import ctypes" warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. Program received signal SIGSEGV, Segmentation fault. 0x76a4fa94 in CThunkObject_dealloc (_self=0x76adb920) at /home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/callbacks.c:25 25 /home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/callbacks.c: No such file or directory. (gdb) >From what I can see it tries to use the path from the host I cross compiled for the callbacks.c. Is this the cause of the segmentation fault? If yes, how can I correct the path during compilation? I also attached the strace log of the command 'python -c "import ctypes"' Thank you in advance! ---------- components: ctypes files: strace_python.log messages: 330696 nosy: n0s69z priority: normal severity: normal status: open title: importing "ctypes" immediately causes a segmentation fault type: crash versions: Python 2.7 Added file: https://bugs.python.org/file47954/strace_python.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 10:29:02 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 15:29:02 +0000 Subject: [issue35351] LTOFLAGS are passed to BASECFLAGS when using LTO Message-ID: <1543505341.98.0.788709270274.issue35351@psf.upfronthosting.co.za> New submission from Charalampos Stratakis : Through configure.ac and this change [0] LTOFLAGS and more specifically -flto is baked into BASECFLAGS when using link time optimizations, which will make this flag propagate to distutils. [0] https://github.com/python/cpython/commit/69a3f153a92fd8c86080e8da477ee50df18fc0d1#diff-67e997bcfdac55191033d57a16d1408aL1350 ---------- components: Build, Extension Modules messages: 330697 nosy: cstratak priority: normal severity: normal status: open title: LTOFLAGS are passed to BASECFLAGS when using LTO versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 10:38:59 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 15:38:59 +0000 Subject: [issue35351] LTOFLAGS are passed to BASECFLAGS when using LTO In-Reply-To: <1543505341.98.0.788709270274.issue35351@psf.upfronthosting.co.za> Message-ID: <1543505939.13.0.788709270274.issue35351@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- keywords: +patch pull_requests: +10044 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:13:50 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 16:13:50 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 Message-ID: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> New submission from Charalampos Stratakis : When compiling python3 on RHEL8 and run the tests, test_asyncio fails with 8 failures (and more on older branches). openssl version is 1.1.1 Attaching the failures for the various branches. ---------- components: Tests, asyncio files: asyncio_failures_3.8.log messages: 330698 nosy: asvetlov, cstratak, yselivanov priority: normal severity: normal status: open title: test_asyncio fails on RHEL8 versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47955/asyncio_failures_3.8.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:13:58 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 16:13:58 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543508038.59.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by Charalampos Stratakis : Added file: https://bugs.python.org/file47956/asyncio_failures_3.7.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:14:08 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 16:14:08 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543508048.89.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by Charalampos Stratakis : Added file: https://bugs.python.org/file47957/asyncio_failures_3.6.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:14:40 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 29 Nov 2018 16:14:40 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543508080.51.0.788709270274.issue35352@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Seems that 3.8 and 3.7 get the same failures, while 3.6 gets 14 instead of 8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:16:45 2018 From: report at bugs.python.org (Gerrit Holl) Date: Thu, 29 Nov 2018 16:16:45 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1543508205.32.0.788709270274.issue22543@psf.upfronthosting.co.za> Gerrit Holl added the comment: There is a thread on StackOverflow related to this problem: https://stackoverflow.com/q/42495641/974555 The (currently only and accepted) answer proposes as a workaround to set the PYTHONPATH variable, as the contents of those apparently *are* already in sys.path at the time warnings._processoptions is called, unlike site-packages. So manually adding site-packages to the PYTHONPATH variable does circumvent this problem (tested in Python 3.7.1). ---------- nosy: +Gerrit.Holl versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:36:32 2018 From: report at bugs.python.org (s-ball) Date: Thu, 29 Nov 2018 16:36:32 +0000 Subject: [issue35335] msgfmt should be able to merge more than one po file In-Reply-To: <1543389979.14.0.788709270274.issue35335@psf.upfronthosting.co.za> Message-ID: <1543509392.79.0.788709270274.issue35335@psf.upfronthosting.co.za> s-ball added the comment: Ok, I have created a fork, and started coding on a local branch. But it will take some time, because I assume that I am supposed to write tests for the msgfmt module... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:40:36 2018 From: report at bugs.python.org (kernc) Date: Thu, 29 Nov 2018 16:40:36 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1543509636.45.0.788709270274.issue22543@psf.upfronthosting.co.za> Change by kernc : ---------- nosy: +kernc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 11:56:05 2018 From: report at bugs.python.org (Leonard de Ruijter) Date: Thu, 29 Nov 2018 16:56:05 +0000 Subject: [issue35349] collections.abc.Sequence isn't an abstract base class for array.array In-Reply-To: <1543503912.1.0.788709270274.issue35349@psf.upfronthosting.co.za> Message-ID: <1543510565.43.0.788709270274.issue35349@psf.upfronthosting.co.za> Leonard de Ruijter added the comment: This might be a duplicate of https://bugs.python.org/issue35190 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:04:25 2018 From: report at bugs.python.org (Christian Klein) Date: Thu, 29 Nov 2018 17:04:25 +0000 Subject: [issue35353] Add frame command to pub Message-ID: <1543511065.26.0.788709270274.issue35353@psf.upfronthosting.co.za> New submission from Christian Klein : Add command fr(ame) to jump to a stack frame in the Python debugger ---------- components: Library (Lib) messages: 330703 nosy: cnklein priority: normal pull_requests: 10045 severity: normal status: open title: Add frame command to pub _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:10:15 2018 From: report at bugs.python.org (SilentGhost) Date: Thu, 29 Nov 2018 17:10:15 +0000 Subject: [issue35335] msgfmt should be able to merge more than one po file In-Reply-To: <1543389979.14.0.788709270274.issue35335@psf.upfronthosting.co.za> Message-ID: <1543511415.08.0.788709270274.issue35335@psf.upfronthosting.co.za> SilentGhost added the comment: The test for this part of code are located in Lib/test/test_tools/test_i18n.py as you'll quickly notice there aren't any tests specific to msgfmt.py I would actually advice to start by writing some tests for existing behaviour, so you'd know if (when) you break things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:17:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 17:17:48 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543511868.97.0.788709270274.issue34279@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9724348b43a9005a449ba532ccd3c6726f031097 by Victor Stinner (Pablo Galindo) in branch 'master': bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150) https://github.com/python/cpython/commit/9724348b43a9005a449ba532ccd3c6726f031097 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:23:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 17:23:25 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543512205.57.0.788709270274.issue34279@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10046 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:23:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 17:23:25 +0000 Subject: [issue34605] Avoid master/slave terminology In-Reply-To: <1536330120.62.0.56676864532.issue34605@psf.upfronthosting.co.za> Message-ID: <1543512205.67.0.663665092547.issue34605@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 12:40:01 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 17:40:01 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543513201.95.0.788709270274.issue34279@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10048 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:16:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 18:16:39 +0000 Subject: [issue35349] collections.abc.Sequence isn't an abstract base class for array.array In-Reply-To: <1543503912.1.0.788709270274.issue35349@psf.upfronthosting.co.za> Message-ID: <1543515399.96.0.788709270274.issue35349@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See issue23864, issue25737 and issue35190. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> array is not a Sequence _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:16:58 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 18:16:58 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue) In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1543515418.79.0.788709270274.issue35190@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This looks like a duplicate of issue23864 and issue25737. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:31:25 2018 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 29 Nov 2018 18:31:25 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543516285.14.0.788709270274.issue35338@psf.upfronthosting.co.za> Mark Dickinson added the comment: > The intersection of an empty set of sets is either the empty set [...] Nope, it's never the empty set, unless you're using a *very* unusual definition. The intersection of a collection X of sets is the set of all x in the universe such that x is in S for all S in X. If X is empty, that condition is vacuously true, and you simply get the set of all x. There are universe problems here, but giving the empty set is definitely wrong. OTOH, the union of an empty collection of sets _is_ unambiguously the empty set, and the request for `set.union(*args)` to be valid regardless of the length of args seems reasonable to me. Without that validity, there's a potential corner-case bug where `set.union(*args)` potentially fails when `args` is empty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:32:30 2018 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 29 Nov 2018 18:32:30 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543516350.06.0.788709270274.issue35338@psf.upfronthosting.co.za> Mark Dickinson added the comment: Some reading: http://mathforum.org/library/drmath/view/62503.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:40:29 2018 From: report at bugs.python.org (-) Date: Thu, 29 Nov 2018 18:40:29 +0000 Subject: [issue35354] Generator functions stack overflow Message-ID: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> New submission from - : G?t `Fatal Python error: Cannot recover from stack overflow.` on Windows 10, not tested on other os. Crashed when use undefined variable. ---------- components: Interpreter Core files: crash.py messages: 330710 nosy: SUHAR1K priority: normal severity: normal status: open title: Generator functions stack overflow type: crash versions: Python 3.7 Added file: https://bugs.python.org/file47958/crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 13:55:29 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 29 Nov 2018 18:55:29 +0000 Subject: [issue35343] Importlib.reload has different behaviour in script and interactive mode In-Reply-To: <1543442628.31.0.788709270274.issue35343@psf.upfronthosting.co.za> Message-ID: <1543517729.0.0.788709270274.issue35343@psf.upfronthosting.co.za> Brett Cannon added the comment: It will because your file change happens so quickly by script that your file system isn't leading to a different mtime on the source, and so the bytecode isn't being regenerated. When you do it by hand you're physically slow enough to have the file copies take long enough for your file system to record the new mtime. You can try using importlib.invalidate_caches() to help with this. Otherwise realize that importlib.reload() is really meant for interactive use and not script use anyway because it doesn't update old references to the module. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:02:35 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:02:35 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543518155.76.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I think I have seen this bug reported elsewhere but can't find it now. A simple reproducer : def foo(): try: raise Exception() except: foo() foo() Running under gdb on Ubuntu : Program received signal SIGABRT, Aborted. 0x00007ffff7115428 in __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. ---------- nosy: +xtreak versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:27:23 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:27:23 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543519643.46.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I was referring to issue6028 and issue32570. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:27:42 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:27:42 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543519662.8.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I was referring to issue6028 and issue32570. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:28:11 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:28:11 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543519691.74.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I was referring to issue6028 and issue32570. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:29:59 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:29:59 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543519799.21.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: I was referring to issue6028 and issue32570. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:32:13 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 29 Nov 2018 19:32:13 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543518155.76.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 14:44:57 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 29 Nov 2018 19:44:57 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543520697.96.0.788709270274.issue35346@psf.upfronthosting.co.za> Brett Cannon added the comment: It's because the module was originally kept compatible with Python 1.5.2: https://www.python.org/dev/peps/pep-0291/#backward-compatible-packages-modules-and-tools ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:00:38 2018 From: report at bugs.python.org (Evan Newman) Date: Thu, 29 Nov 2018 20:00:38 +0000 Subject: [issue35355] Some Errors involving formatted strings aren't reported in the right place. Message-ID: <1543521638.64.0.788709270274.issue35355@psf.upfronthosting.co.za> New submission from Evan Newman : Formatted strings seem to have some quirks. if you try putting in this, for example; print(f'{0 0}') ; you get a syntax error, which is probably intended, but where the error is reported is not always accurate. for example; #just a comment, it doesn't matter what it says print(f'{0 0}') ;will raise the syntax error, and highlight the j,u,and s in the comment! that doesn't help, and makes it look like the comment is the error. this is a real pain to debug if you hadn't known about this. it took me about 2 hours to track down the problem. seriously, this should be fixed. I haven't tested the problem in any editor but idle, so the cause could be anywhere. I was first using 3.7.0, I've just updated to 3.7.1 to make sure it still happens, and it does. ---------- assignee: terry.reedy components: IDLE files: recreation.py messages: 330719 nosy: Enewman, terry.reedy priority: normal severity: normal status: open title: Some Errors involving formatted strings aren't reported in the right place. type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47959/recreation.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:14:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 20:14:47 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543522487.17.0.788709270274.issue34279@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 36003003f26d0c30fc15ec4dc3b0d7697dff908e by Victor Stinner in branch '2.7': bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801) https://github.com/python/cpython/commit/36003003f26d0c30fc15ec4dc3b0d7697dff908e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:15:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 20:15:04 +0000 Subject: [issue34605] Avoid master/slave terminology In-Reply-To: <1536330120.62.0.56676864532.issue34605@psf.upfronthosting.co.za> Message-ID: <1543522504.29.0.788709270274.issue34605@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8a73cac618a050f4e74eb38ff43e48d9957a6dec by Victor Stinner in branch '3.7': [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) https://github.com/python/cpython/commit/8a73cac618a050f4e74eb38ff43e48d9957a6dec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:15:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 20:15:04 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543522504.71.0.702299269573.issue34279@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8a73cac618a050f4e74eb38ff43e48d9957a6dec by Victor Stinner in branch '3.7': [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) https://github.com/python/cpython/commit/8a73cac618a050f4e74eb38ff43e48d9957a6dec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:17:53 2018 From: report at bugs.python.org (Evan Newman) Date: Thu, 29 Nov 2018 20:17:53 +0000 Subject: [issue35355] Some Errors involving formatted strings aren't reported in the right place. In-Reply-To: <1543521638.64.0.788709270274.issue35355@psf.upfronthosting.co.za> Message-ID: <1543522673.86.0.788709270274.issue35355@psf.upfronthosting.co.za> Change by Evan Newman : ---------- title: Some Errors involving formatted strings aren't reported in the right place. -> Some Errors involving formatted strings aren't reported in the right place. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:18:45 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 20:18:45 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543522725.27.0.788709270274.issue34279@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10049 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:18:45 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 20:18:45 +0000 Subject: [issue34605] Avoid master/slave terminology In-Reply-To: <1536330120.62.0.56676864532.issue34605@psf.upfronthosting.co.za> Message-ID: <1543522725.36.0.663665092547.issue34605@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:20:11 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 20:20:11 +0000 Subject: [issue35355] Some Errors involving formatted strings aren't reported in the right place. In-Reply-To: <1543521638.64.0.788709270274.issue35355@psf.upfronthosting.co.za> Message-ID: <1543522811.49.0.788709270274.issue35355@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This looks like a duplicate of issue34364. ---------- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> problem with traceback for syntax error in f-string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:39:08 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 20:39:08 +0000 Subject: [issue34605] Avoid master/slave terminology In-Reply-To: <1536330120.62.0.56676864532.issue34605@psf.upfronthosting.co.za> Message-ID: <1543523948.65.0.788709270274.issue34605@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 43d812692f9207520e1169ff88cd8d6c59cc4804 by Miss Islington (bot) in branch '3.6': [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) https://github.com/python/cpython/commit/43d812692f9207520e1169ff88cd8d6c59cc4804 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 15:39:08 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Nov 2018 20:39:08 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543523948.96.0.702299269573.issue34279@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 43d812692f9207520e1169ff88cd8d6c59cc4804 by Miss Islington (bot) in branch '3.6': [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) https://github.com/python/cpython/commit/43d812692f9207520e1169ff88cd8d6c59cc4804 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 16:49:26 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 29 Nov 2018 21:49:26 +0000 Subject: [issue35355] Some Errors involving formatted strings aren't reported in the right place. In-Reply-To: <1543521638.64.0.788709270274.issue35355@psf.upfronthosting.co.za> Message-ID: <1543528166.03.0.788709270274.issue35355@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Evan, IDLE runs your code with the Python running IDLE. Bad tracebacks are created by Python and are usually, as in this case, the fault of Python. To decide, run your code directly with Python, at a command line, instead of indirectly with IDLE, and see if you get the same problem. In this case, I ran, on Windows, in Command Prompt, 'py -m a.tem3', where 'py' defaults to python 3.7.1 and 'a' is a directory on sys.path. ---------- assignee: terry.reedy -> components: -IDLE stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 16:54:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 21:54:39 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543528479.4.0.788709270274.issue35346@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: While we are here, look at other outdated code: * Top-imported warnings is not used. * struct.calcsize('P') is always success. * plistlib is always available. Should we keep compatibility with 2.7? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 16:58:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 21:58:19 +0000 Subject: [issue34279] RFC: issue a warning in regrtest when no tests have been executed? In-Reply-To: <1532947707.98.0.56676864532.issue34279@psf.upfronthosting.co.za> Message-ID: <1543528699.88.0.788709270274.issue34279@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Pablo! I merged your change in 2.7, 3.6, 3.7 and master branches. To reuse the example of my first message, we now get: vstinner at apu$ ./python -W error -m test test_asyncio -m test_no_such_test Run tests sequentially 0:00:00 load avg: 1.21 [1/1] test_asyncio test_asyncio run no tests == Tests result: NO TEST RUN == 1 test run no tests: test_asyncio Total duration: 347 ms Tests result: NO TEST RUN vstinner at apu$ echo $? 0 So the exit status is still a success (code 0), but "Tests result: NO TEST RUN" is an hint that no test has been executed. If we run two files, but one file runs no test, the output now contains "1 test run no tests: test_sys": $ ./python -m test test_os test_sys -m test_access -v == CPython 3.8.0a0 (heads/platform_popen:4fcc412d3d, Nov 29 2018, 21:21:53) [GCC 8.2.1 20181105 (Red Hat 8.2.1-5)] == Linux-4.19.3-300.fc29.x86_64-x86_64-with-glibc2.28 little-endian == cwd: /home/vstinner/prog/python/master/build/test_python_18420 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 1.05 [1/2] test_os test_access (test.test_os.FileTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK 0:00:00 load avg: 1.05 [2/2] test_sys ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK test_sys run no tests == Tests result: SUCCESS == 1 test OK. 1 test run no tests: test_sys Total duration: 240 ms Tests result: SUCCESS ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 16:59:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 21:59:21 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543528761.41.0.788709270274.issue35346@psf.upfronthosting.co.za> STINNER Victor added the comment: > Should we keep compatibility with 2.7? I don't think that the master branch (Python 3.8) has to be compatible with Python 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:03:56 2018 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Nov 2018 22:03:56 +0000 Subject: [issue35217] REPL history is broken when python is invoked with cmd /c In-Reply-To: <1542029001.03.0.788709270274.issue35217@psf.upfronthosting.co.za> Message-ID: <1543529036.12.0.788709270274.issue35217@psf.upfronthosting.co.za> Eryk Sun added the comment: The Windows console has a fixed number of history buffers. In Windows 7 the default maximum is four history buffers. In this case, if we run a script via cmd.exe -> py.exe -> python.exe, then only one history buffer remains for a child process. As you've observed, no history buffer is available for the fifth process if we run cmd.exe -> python.exe. You can increase the default maximum in the console's Alt+Space+D defaults dialog, under "Command History" -> "Number of Buffers". This corresponds to the "NumberOfHistoryBuffers" value in the registry key "HKCU\Console". You can increase the maximum for the current window in the console's Alt+Space+P properties dialog. If the current console was allocated by an application that was launched from a shortcut (i.e. a .LNK file), this property gets persisted in the shortcut itself. Otherwise it gets persisted in a registry key under "HKCU\Console" that's named for the startup window title. If no title was specified, the default title is the path to the executable, with backslashes replaced by underscore and the Windows directory as %SystemRoot%. For example, if you run cmd.exe from the Win+R run dialog, its console properties are stored in the registry key "HKCU\Console\%SystemRoot%_system32_cmd.exe". ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:07:08 2018 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 29 Nov 2018 22:07:08 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543529228.67.0.788709270274.issue35346@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Please keep Python 2.7 compatibility. It should be possible to copy the module back into Python 2.7 and use it there. This is not hard to do and allows it to fulfill its purpose as platform detection module even while part of the stdlib. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:09:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 22:09:19 +0000 Subject: [issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7 In-Reply-To: <1530525938.11.0.56676864532.issue34021@psf.upfronthosting.co.za> Message-ID: <1543529359.04.0.788709270274.issue34021@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10051 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:11:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 22:11:57 +0000 Subject: [issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7 In-Reply-To: <1530525938.11.0.56676864532.issue34021@psf.upfronthosting.co.za> Message-ID: <1543529517.41.0.788709270274.issue34021@psf.upfronthosting.co.za> STINNER Victor added the comment: Five months later nobody has any kind of clue explaining why the test randomly fails on this specific buildbot, whereas it's reliable on all other buildbots and all Python 3.x versions. So I wrote PR 10804 to skip the test on Windows. The feature will remain to be tested on all other platforms, and it's still tested on Windows on Python 3.x. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:14:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 22:14:25 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543529665.49.0.788709270274.issue35346@psf.upfronthosting.co.za> STINNER Victor added the comment: > Please keep Python 2.7 compatibility. It should be possible to copy the module back into Python 2.7 and use it there. I don't understand why someone would like to copy Lib/platform.py from the master branch to Python 2.7? Python 2.7 already provides the platform module, it's part of its standard library. platform.linux_distribution() function has been removed from master, so you cannot simply copy platform.py from master and use it in Python 2.7: it has a different API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:38:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 22:38:37 +0000 Subject: [issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7 In-Reply-To: <1530525938.11.0.56676864532.issue34021@psf.upfronthosting.co.za> Message-ID: <1543531117.85.0.788709270274.issue34021@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f681e93e46925e862a8b0fa4b6e9e341fd8de3c2 by Victor Stinner in branch '2.7': bpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804) https://github.com/python/cpython/commit/f681e93e46925e862a8b0fa4b6e9e341fd8de3c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:38:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 22:38:47 +0000 Subject: [issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7 In-Reply-To: <1530525938.11.0.56676864532.issue34021@psf.upfronthosting.co.za> Message-ID: <1543531127.36.0.788709270274.issue34021@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 17:53:50 2018 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 29 Nov 2018 22:53:50 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543529665.49.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <75f42082-412e-d6c4-df87-1d3fa9bb6aa7@egenix.com> Marc-Andre Lemburg added the comment: Ok, let me add some history here: When I created the platform module it was clear that this would be a module which will frequently need updates, since platforms evolve faster than Python does. I had developed this with a larger number of contributors outside the stdlib for a while and then there was a request to add it to the stdlib. Now in order to keep the module more or less up-to-date, it still required regular updates, so the plan was to have it updated in the current versions of Python, but allow it to be used in older Python versions as well. That was the compromise to have it in the stdlib and not external. Otherwise, I would have not added it to the stdlib. This is why it has a special status and keep backwards compatibility much longer than other code in the stdlib. This worked quite well, but for some systems such as the Linux distros, it was impossible to keep up with the development in that mode. Well, actually, there were multiple reasons why this part failed: 1. Linux distros didn't not have a standard when I added the code, 2. Then some distros started two or three different ones, 3. Distros started to use multiple standards with conflicting data, 4. New distros became popular more often than we could update the code. That's why I was fine with removing the code again and leaving this part to a PyPI package. Does it make more sense now ? ---------- _______________________________________ Python tracker _______________________________________ From mal at egenix.com Thu Nov 29 17:53:46 2018 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 29 Nov 2018 23:53:46 +0100 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543529665.49.0.788709270274.issue35346@psf.upfronthosting.co.za> References: <1543529665.49.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <75f42082-412e-d6c4-df87-1d3fa9bb6aa7@egenix.com> Ok, let me add some history here: When I created the platform module it was clear that this would be a module which will frequently need updates, since platforms evolve faster than Python does. I had developed this with a larger number of contributors outside the stdlib for a while and then there was a request to add it to the stdlib. Now in order to keep the module more or less up-to-date, it still required regular updates, so the plan was to have it updated in the current versions of Python, but allow it to be used in older Python versions as well. That was the compromise to have it in the stdlib and not external. Otherwise, I would have not added it to the stdlib. This is why it has a special status and keep backwards compatibility much longer than other code in the stdlib. This worked quite well, but for some systems such as the Linux distros, it was impossible to keep up with the development in that mode. Well, actually, there were multiple reasons why this part failed: 1. Linux distros didn't not have a standard when I added the code, 2. Then some distros started two or three different ones, 3. Distros started to use multiple standards with conflicting data, 4. New distros became popular more often than we could update the code. That's why I was fine with removing the code again and leaving this part to a PyPI package. Does it make more sense now ? -- Marc-Andre Lemburg eGenix.com From report at bugs.python.org Thu Nov 29 18:25:28 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Nov 2018 23:25:28 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543533928.27.0.788709270274.issue35336@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10052 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 18:29:04 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 29 Nov 2018 23:29:04 +0000 Subject: [issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue) In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1543534144.4.0.788709270274.issue35190@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: I would propose to keep this one open as a superseding https://bugs.python.org/issue23864 and close the latter (assuming we are not going to make all classes protocols, we I think we really shouldn't, and instead we should improve the docs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 19:02:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 00:02:26 +0000 Subject: [issue35346] Modernize Lib/platform.py code In-Reply-To: <1543455759.08.0.788709270274.issue35346@psf.upfronthosting.co.za> Message-ID: <1543536146.95.0.788709270274.issue35346@psf.upfronthosting.co.za> STINNER Victor added the comment: > Now in order to keep the module more or less up-to-date, it still > required regular updates, so the plan was to have it updated in the > current versions of Python, but allow it to be used in older Python > versions as well. That was the compromise to have it in the stdlib > and not external. Otherwise, I would have not added it to the stdlib. I don't understand if you are describing the current status or the history here. Do you know users who don't use platform form the stdlib, but use a more recent copy? These users cannot get a more recent version of Python? When you talk about copying Lib/platform.py from master to Python 2.7, are you talking about the ability to copy platform.py from master into an application to get a more recent version on Python 2.7? If yes, I don't understand how you plan to add back the linux_distribution() feature? Sorry, I'm still lost :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 19:10:01 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 30 Nov 2018 00:10:01 +0000 Subject: [issue35348] Problems with handling the file command output in platform.architecture() In-Reply-To: <1543494814.29.0.788709270274.issue35348@psf.upfronthosting.co.za> Message-ID: <1543536601.13.0.788709270274.issue35348@psf.upfronthosting.co.za> Windson Yang added the comment: I agreed with Serhiy. I also found the function decode the output with latin-1, I think it will be better to use utf-8 instead. ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 19:40:10 2018 From: report at bugs.python.org (Windson Yang) Date: Fri, 30 Nov 2018 00:40:10 +0000 Subject: [issue35325] imp.find_module() return value documentation discrepancy In-Reply-To: <1543303624.81.0.788709270274.issue35325@psf.upfronthosting.co.za> Message-ID: <1543538410.81.0.788709270274.issue35325@psf.upfronthosting.co.za> Windson Yang added the comment: If I understand correctly, this may be better. Try to find the module name. If path is omitted or None, the list of directory names given by sys.path is searched. If path is built-in or frozen modules, return None instead. BTW, the dosstring should also be updated, I will not continue search the path if the path in build-in or frozen. and this module is deprecated since version 3.4 ---------- nosy: +Windson Yang versions: +Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 19:52:26 2018 From: report at bugs.python.org (Eli_B) Date: Fri, 30 Nov 2018 00:52:26 +0000 Subject: [issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted In-Reply-To: <1502374939.75.0.688742031254.issue31177@psf.upfronthosting.co.za> Message-ID: <1543539146.98.0.788709270274.issue31177@psf.upfronthosting.co.za> Eli_B added the comment: I suggest that after reset_mock(), deleted attributes should be available again. In other words, their deletion is reset. I'm opening a PR to this effect. I reported this issue to testing-cabal's mock repo in May 2016 (https://github.com/testing-cabal/mock/pull/361), but my original PR there just avoided an exception without reinstating the deleted attribute. ---------- nosy: +Eli_B _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 19:57:17 2018 From: report at bugs.python.org (Eli_B) Date: Fri, 30 Nov 2018 00:57:17 +0000 Subject: [issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted In-Reply-To: <1502374939.75.0.688742031254.issue31177@psf.upfronthosting.co.za> Message-ID: <1543539437.78.0.788709270274.issue31177@psf.upfronthosting.co.za> Change by Eli_B : ---------- pull_requests: +10053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 20:59:47 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 01:59:47 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543543187.16.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 21:14:44 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 02:14:44 +0000 Subject: [issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted In-Reply-To: <1502374939.75.0.688742031254.issue31177@psf.upfronthosting.co.za> Message-ID: <1543544084.03.0.788709270274.issue31177@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- nosy: +cjw296, mariocj89 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 21:15:54 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 02:15:54 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543544154.76.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 21:16:51 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 02:16:51 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543544211.72.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 29 23:55:17 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 04:55:17 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543553717.36.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 00:22:06 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 05:22:06 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543555326.13.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 00:39:54 2018 From: report at bugs.python.org (Ryan G.) Date: Fri, 30 Nov 2018 05:39:54 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1543556394.02.0.788709270274.issue31956@psf.upfronthosting.co.za> Ryan G. added the comment: This functionality is useful to me. Is this issue still alive? If not, how can I help? ---------- nosy: +Ryan G. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 01:42:28 2018 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 30 Nov 2018 06:42:28 +0000 Subject: [issue35356] A possible reference leak in the nis module Message-ID: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> New submission from Zackery Spytz : In nis_maps(), the result of PyUnicode_FromString() is leaked if the PyList_Append() call fails. ---------- components: Extension Modules messages: 330747 nosy: ZackerySpytz priority: normal severity: normal status: open title: A possible reference leak in the nis module versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 01:44:32 2018 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 30 Nov 2018 06:44:32 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543560272.44.0.788709270274.issue35356@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +10054 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 01:51:19 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 06:51:19 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1543560679.13.0.788709270274.issue2771@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: test comment ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 01:52:10 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 06:52:10 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543560730.95.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 01:55:44 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 06:55:44 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543560944.17.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:05:29 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 07:05:29 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543561529.64.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:05:56 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 07:05:56 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543561556.28.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:10:00 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 07:10:00 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1543561800.7.0.788709270274.issue2771@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:19:48 2018 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 30 Nov 2018 07:19:48 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543562388.84.0.788709270274.issue35354@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. (Karthikeyan is having trouble posting, so I'm trying on his behalf.) ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:20:18 2018 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 30 Nov 2018 07:20:18 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543562418.44.0.788709270274.issue35354@psf.upfronthosting.co.za> Change by Ezio Melotti : ---------- nosy: -asdwqii _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:21:07 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 07:21:07 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543562467.08.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: > I think I have seen this bug reported elsewhere but can't find it now. Sorry, I was referring to issue6028 and issue32570 that I thought were similar to the original report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:40:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 07:40:21 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543563621.01.0.788709270274.issue35356@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a2e3585e79c93b2372dbad46a744e28fcc6dad6d by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) https://github.com/python/cpython/commit/a2e3585e79c93b2372dbad46a744e28fcc6dad6d ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:40:31 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 07:40:31 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543563631.39.0.788709270274.issue35356@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:40:40 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 07:40:40 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543563640.88.0.788709270274.issue35356@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:40:50 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 07:40:50 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543563650.48.0.788709270274.issue35356@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:55:37 2018 From: report at bugs.python.org (Chris Withers) Date: Fri, 30 Nov 2018 07:55:37 +0000 Subject: [issue35357] unittest.mock.call can't represent calls to a method called 'parent' Message-ID: <1543564537.68.0.788709270274.issue35357@psf.upfronthosting.co.za> New submission from Chris Withers : While working on https://bugs.python.org/issue35226, I stumbled upon this: >>> from unittest.mock import call >>> call.parent() Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' object is not callable Guess we need to make .parent and friends more uniquely named ;-) ---------- assignee: cjw296 messages: 330757 nosy: cjw296, mariocj89, michael.foord priority: normal severity: normal status: open title: unittest.mock.call can't represent calls to a method called 'parent' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 02:59:43 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 07:59:43 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543564783.97.0.788709270274.issue35356@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3473ca424142cb8f1453ba802ba642060b5ce779 by Miss Islington (bot) in branch '3.6': bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) https://github.com/python/cpython/commit/3473ca424142cb8f1453ba802ba642060b5ce779 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 03:00:09 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 08:00:09 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543564809.47.0.788709270274.issue35356@psf.upfronthosting.co.za> miss-islington added the comment: New changeset e604b6c53e7dce6d4cf52525f4ae57352d489cba by Miss Islington (bot) in branch '3.7': bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) https://github.com/python/cpython/commit/e604b6c53e7dce6d4cf52525f4ae57352d489cba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 03:04:45 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 08:04:45 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543565085.77.0.788709270274.issue35356@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7 by Miss Islington (bot) in branch '2.7': bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) https://github.com/python/cpython/commit/f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 03:08:58 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 08:08:58 +0000 Subject: [issue35356] A possible reference leak in the nis module In-Reply-To: <1543560148.62.0.788709270274.issue35356@psf.upfronthosting.co.za> Message-ID: <1543565338.91.0.788709270274.issue35356@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 03:28:29 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Nov 2018 08:28:29 +0000 Subject: [issue35353] Add frame command to pdb In-Reply-To: <1543511065.26.0.788709270274.issue35353@psf.upfronthosting.co.za> Message-ID: <1543566509.55.0.788709270274.issue35353@psf.upfronthosting.co.za> Change by Karthikeyan Singaravelan : ---------- title: Add frame command to pub -> Add frame command to pdb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 03:30:51 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 30 Nov 2018 08:30:51 +0000 Subject: [issue35358] avoid '-' in importlib.import_module and builtins.__import__ Message-ID: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> New submission from St?phane Wirtel : maybe related to this issue: https://bugs.python.org/issue18831 we can't import a module where the name contains '-', for example from my-module import my_function but with importlib.import_module we can import this module. import_module does not respect the python syntax for the name of the module, we should avoid that. 1. Add a DeprecationWarning for 3.8+ 2. in 3.10, remove this DeprecationWarning and remove the support of the '-' in importlib.import_module ---------- messages: 330761 nosy: matrixise priority: normal severity: normal status: open title: avoid '-' in importlib.import_module and builtins.__import__ versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 04:06:43 2018 From: report at bugs.python.org (David) Date: Fri, 30 Nov 2018 09:06:43 +0000 Subject: [issue35350] importing "ctypes" immediately causes a segmentation fault In-Reply-To: <1543504667.76.0.788709270274.issue35350@psf.upfronthosting.co.za> Message-ID: <1543568802.99.0.788709270274.issue35350@psf.upfronthosting.co.za> David added the comment: Small update: After commenting out Py_XDECREF(self->restype) in function CThunkObject_dealloc(PyObject *_self), I can import ctypes without getting a segmentation fault. static void CThunkObject_dealloc(PyObject *_self) { CThunkObject *self = (CThunkObject *)_self; PyObject_GC_UnTrack(self); Py_XDECREF(self->converters); Py_XDECREF(self->callable); //Py_XDECREF(self->restype); if (self->pcl_write) ffi_closure_free(self->pcl_write); PyObject_GC_Del(self); } But I'm afraid I don't know what other effects could result with this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 04:09:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 09:09:23 +0000 Subject: [issue35358] avoid '-' in importlib.import_module and builtins.__import__ In-Reply-To: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> Message-ID: <1543568963.2.0.788709270274.issue35358@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: '-' is not special. The import statement requires the module name been an identifier. This is just a requirement of Python syntax. But when pass the module name as a string, there is no such limitation in CPython. This is like an attribute name or keyword argument name should be identifiers in expressions, but you can pass an arbitrary string to getattr() and use a dict with arbitrary string keys as kwargs. Currently non-identifier strings are accepted, but this is an implementation detail, not a part of the language. There are reasons against adding additional checks for attribute names and keyword argument names. This will slow down execution of all code. This is less critical for importing, because it is slower than attribute access and function call. But on other side, the benefit of adding this check is not obvious. It may be worth to discuss this on mailing lists. First read previous discussions about attribute names and keyword argument names. ---------- nosy: +brett.cannon, eric.snow, gvanrossum, ncoghlan, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 04:38:07 2018 From: report at bugs.python.org (Lysandros Nikolaou) Date: Fri, 30 Nov 2018 09:38:07 +0000 Subject: [issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+ In-Reply-To: <1495270729.75.0.717879181788.issue30410@psf.upfronthosting.co.za> Message-ID: <1543570687.11.0.788709270274.issue30410@psf.upfronthosting.co.za> Lysandros Nikolaou added the comment: Ping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 04:58:49 2018 From: report at bugs.python.org (Paul Moore) Date: Fri, 30 Nov 2018 09:58:49 +0000 Subject: [issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+ In-Reply-To: <1495270729.75.0.717879181788.issue30410@psf.upfronthosting.co.za> Message-ID: <1543571929.76.0.788709270274.issue30410@psf.upfronthosting.co.za> Paul Moore added the comment: The proposed wording seems a bit over-complex to me. Maybe the following re-wording would be easier to understand? The character encoding is platform-dependent. Non-Windows platforms use the locale encoding (see locale.getpreferredencoding()). On Windows, UTF-8 is used for the console device. Non-character devices such as disk files and pipes use the system locale encoding (i.e. the ANSI codepage). Non-console character devices such as NUL (i.e. where isatty() returns True) use the value of the console input and output codepages at startup, respectively for stdin and stdout/stderr. This defaults to the system locale encoding if the process is not initially attached to a console. The special behaviour of the console can be overridden by setting the environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In that case, the console codepages are used as for any other character device. Under all platforms, you can override this value by setting the PYTHONIOENCODING environment variable before starting Python. However, for the Windows console, this only applies when PYTHONLEGACYWINDOWSSTDIO is also set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 05:02:20 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 30 Nov 2018 10:02:20 +0000 Subject: [issue35358] avoid '-' in importlib.import_module and builtins.__import__ In-Reply-To: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> Message-ID: <1543572140.23.0.788709270274.issue35358@psf.upfronthosting.co.za> St?phane Wirtel added the comment: hi @serhiy, I understand but today, by error my CI has started to run the tests of an external python package and in the tests, there was a lot of `from my-module import XYZ` but in the django project, they load this module via importlib.import_module or builtins.__import__. For the developer of this external module, he didn't execute the tests before, and for him, there was no problem, because django can load it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 05:24:02 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 30 Nov 2018 10:24:02 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543573442.58.0.788709270274.issue35352@psf.upfronthosting.co.za> Andrew Svetlov added the comment: The strange thing is these tests are passed on our build bots. In logs I see only ConnectionResetError. Can it be related to your configuration? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 05:34:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 10:34:50 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543574090.86.0.788709270274.issue35336@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 55e498058faf8c97840556f6d791c2c392732dc3 by Victor Stinner in branch 'master': bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) https://github.com/python/cpython/commit/55e498058faf8c97840556f6d791c2c392732dc3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 05:45:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 10:45:27 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543574727.31.0.788709270274.issue35336@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:09:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 11:09:12 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543576151.99.0.788709270274.issue34850@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:12:16 2018 From: report at bugs.python.org (Martin Panter) Date: Fri, 30 Nov 2018 11:12:16 +0000 Subject: [issue35327] Using skipTest with subTest gives a misleading UI. In-Reply-To: <1543332268.01.0.788709270274.issue35327@psf.upfronthosting.co.za> Message-ID: <1543576336.17.0.788709270274.issue35327@psf.upfronthosting.co.za> Martin Panter added the comment: Sounds very similar to Issue 25894, discussing how to deal with tests where different subtests errored, failed, skipped and passed. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:18:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:18:31 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543576711.78.0.788709270274.issue35336@psf.upfronthosting.co.za> STINNER Victor added the comment: > PYTHONCOERCECLOCALE=1 should not force C locale coercion, Python should still check if the LC_CTYPE locale is "C". Reference: https://docs.python.org/dev/using/cmdline.html#envvar-PYTHONCOERCECLOCALE "If (...) the current locale reported for the LC_CTYPE category is either the default C locale, or else the explicitly ASCII-based POSIX locale, (...)" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:19:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:19:50 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543576790.61.0.788709270274.issue35336@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset df738d56fe798b3586ed71775df25bf127789cf6 by Victor Stinner in branch '3.7': bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813) https://github.com/python/cpython/commit/df738d56fe798b3586ed71775df25bf127789cf6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:20:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:20:02 +0000 Subject: [issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1 In-Reply-To: <1543401736.44.0.788709270274.issue35336@psf.upfronthosting.co.za> Message-ID: <1543576802.04.0.788709270274.issue35336@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:29:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:29:27 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543577367.47.0.788709270274.issue35347@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 by Victor Stinner in branch 'master': bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) https://github.com/python/cpython/commit/ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:29:45 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 11:29:45 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543577385.56.0.788709270274.issue35347@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:29:57 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 11:29:57 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543577397.45.0.788709270274.issue35347@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:32:45 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 30 Nov 2018 11:32:45 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1543577565.18.0.788709270274.issue30167@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:38:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:38:21 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543577901.39.0.788709270274.issue35347@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:48:19 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 11:48:19 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543578499.46.0.788709270274.issue35347@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 365f21c2d3756a6768c5b0d479aaf5c2a568b80b by Miss Islington (bot) in branch '3.7': bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) https://github.com/python/cpython/commit/365f21c2d3756a6768c5b0d479aaf5c2a568b80b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:49:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:49:00 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543578540.36.0.788709270274.issue35347@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:51:45 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 11:51:45 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543578705.6.0.788709270274.issue35347@psf.upfronthosting.co.za> miss-islington added the comment: New changeset af7e81f71858519de8d2bafcb38fce8cca86aa0a by Miss Islington (bot) in branch '3.6': bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) https://github.com/python/cpython/commit/af7e81f71858519de8d2bafcb38fce8cca86aa0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:57:26 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 30 Nov 2018 11:57:26 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543579046.01.0.788709270274.issue33930@psf.upfronthosting.co.za> INADA Naoki added the comment: microbench: $ ./python.patched -m perf timeit --compare-to ./python.master -s 'o="foo"' 'o.encode' python.master: ..................... 29.3 ns +- 0.6 ns python.patched: ..................... 30.9 ns +- 1.3 ns Mean +- std dev: [python.master] 29.3 ns +- 0.6 ns -> [python.patched] 30.9 ns +- 1.3 ns: 1.05x slower (+5%) And this is perf report of python.patched: 33.17% _PyEval_EvalFrameDefault 15.25% _PyObject_GenericGetAttrWithDict 9.63% PyCFunction_NewEx 8.25% _PyType_Lookup 6.42% meth_dealloc 3.50% _Py_bytes_contains 3.22% PyObject_GC_UnTrack 3.20% method_get 2.73% PyObject_GetAttr 2.55% repeat_next 0.88% _Py_Dealloc 0.81% PyObject_GenericGetAttr 0.78% sre_ucs1_match 0.50% lookdict_unicode_nodummy ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 06:57:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 11:57:56 +0000 Subject: [issue35359] [2.7][Windows] Define _CRT_SECURE_NO_WARNINGS to build Modules\zlib\ Message-ID: <1543579076.36.0.788709270274.issue35359@psf.upfronthosting.co.za> New submission from STINNER Victor : The compilation of Modules\zlib\ on Python 2.7 emits a lot of warnings: see AppVeyor logs above. I propose to define _CRT_SECURE_NO_WARNINGS in the pythoncore project to make these warnings quiet, to spot more easily new warnings. Attached PR adds _CRT_SECURE_NO_WARNINGS to Python 2.7 pythoncore project. In the master branch, the following project also set _CRT_SECURE_NO_WARNINGS: * PCbuild/_decimal.vcxproj * PCbuild/_elementtree.vcxproj * PCbuild/_ssl.vcxproj * PCbuild/pyexpat.vcxproj Note: In the master branch, encode_current_locale() of Python/fileutils.c also uses wcstombs(), but no warning is emitted, whereas the C file is compiled by the pythoncore project which doesn't define _CRT_SECURE_NO_WARNINGS. AppVeyor logs: [00:01:51] ..\Modules\zlib\gzlib.c(193): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdlib.h(534) : see declaration of 'wcstombs' [00:01:51] ..\Modules\zlib\gzlib.c(208): warning C4996: 'wcstombs': This function or variable may be unsafe. Consider using wcstombs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdlib.h(534) : see declaration of 'wcstombs' [00:01:51] ..\Modules\zlib\gzlib.c(214): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : see declaration of '_snprintf' [00:01:51] ..\Modules\zlib\gzlib.c(245): warning C4996: '_wopen': This function or variable may be unsafe. Consider using _wsopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(276) : see declaration of '_wopen' [00:01:51] ..\Modules\zlib\gzlib.c(245): warning C4996: 'open': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _open. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(316) : see declaration of 'open' [00:01:51] ..\Modules\zlib\gzlib.c(296): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : see declaration of '_snprintf' [00:01:51] ..\Modules\zlib\gzlib.c(612): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : see declaration of '_snprintf' [00:01:51] gzread.c [00:01:51] ..\Modules\zlib\gzread.c(35): warning C4996: 'read': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _read. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(317) : see declaration of 'read' [00:01:51] ..\Modules\zlib\gzread.c(41): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror' [00:01:51] ..\Modules\zlib\gzread.c(651): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _close. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(306) : see declaration of 'close' [00:01:51] gzwrite.c [00:01:51] ..\Modules\zlib\gzwrite.c(89): warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _write. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(322) : see declaration of 'write' [00:01:51] ..\Modules\zlib\gzwrite.c(91): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror' [00:01:51] ..\Modules\zlib\gzwrite.c(110): warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _write. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(322) : see declaration of 'write' [00:01:51] ..\Modules\zlib\gzwrite.c(112): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror' [00:01:51] ..\Modules\zlib\gzwrite.c(428): warning C4996: 'vsnprintf': This function or variable may be unsafe. Consider using vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(350) : see declaration of 'vsnprintf' [00:01:51] ..\Modules\zlib\gzwrite.c(661): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _close. See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj] [00:01:51] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(306) : see declaration of 'close' ---------- components: Build messages: 330777 nosy: vstinner priority: normal severity: normal status: open title: [2.7][Windows] Define _CRT_SECURE_NO_WARNINGS to build Modules\zlib\ versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:00:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:00:04 +0000 Subject: [issue35359] [2.7][Windows] Define _CRT_SECURE_NO_WARNINGS to build Modules\zlib\ In-Reply-To: <1543579076.36.0.788709270274.issue35359@psf.upfronthosting.co.za> Message-ID: <1543579204.05.0.788709270274.issue35359@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10063 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:02:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:02:44 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543579364.43.0.788709270274.issue35347@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset dab59fa56054d6c0f75ae7013337f7baaa248076 by Victor Stinner in branch '2.7': bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817) https://github.com/python/cpython/commit/dab59fa56054d6c0f75ae7013337f7baaa248076 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:14:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:14:30 +0000 Subject: [issue35360] [Windows] Update SQLite dependency Message-ID: <1543580070.45.0.788709270274.issue35360@psf.upfronthosting.co.za> New submission from STINNER Victor : Windows and macOS installers require SQLite, but they require different versions! Windows uses 3.21 or 3.14, but macOS uses 3.22. I'm talking about the following line in PCbuild\get_externals.bat: set libraries=%libraries% sqlite-3.21.0.0 * 3.6, 3.7 and master branches: SQLite[Windows]: 3.21.0.0 SQLite[macOS]: 3.22.0 * 2.7 branch: SQLite[Windows]: 3.14.2.0 SQLite[macOS]: 3.22.0 Note: I wrote a script to get external dependencies: https://github.com/vstinner/misc/blob/master/cpython/external_versions.py ---------- components: Build messages: 330779 nosy: vstinner priority: normal severity: normal status: open title: [Windows] Update SQLite dependency versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:14:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:14:37 +0000 Subject: [issue35360] [Windows] Update SQLite dependency In-Reply-To: <1543580070.45.0.788709270274.issue35360@psf.upfronthosting.co.za> Message-ID: <1543580077.84.0.788709270274.issue35360@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:17:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 12:17:21 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543580241.63.0.788709270274.issue33930@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Inada. There is a large overhead for iterating. Try to add --duplicate=1000. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:22:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:22:47 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543580567.58.0.788709270274.issue35347@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 304315d251dbb4e85dd86056ba1925f25e646ca1 by Victor Stinner in branch 'master': bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818) https://github.com/python/cpython/commit/304315d251dbb4e85dd86056ba1925f25e646ca1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:23:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:23:15 +0000 Subject: [issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization In-Reply-To: <1543483922.25.0.788709270274.issue35347@psf.upfronthosting.co.za> Message-ID: <1543580595.09.0.788709270274.issue35347@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, test_socket should depend a little bit less on time now ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:32:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:32:05 +0000 Subject: [issue35360] [Windows] Update SQLite dependency In-Reply-To: <1543580070.45.0.788709270274.issue35360@psf.upfronthosting.co.za> Message-ID: <1543581125.0.0.788709270274.issue35360@psf.upfronthosting.co.za> STINNER Victor added the comment: First the sqlite branch should be updated in: https://github.com/python/cpython-source-deps Then a new tag should be created in this repository. I tried to update cpython-source-deps, but "git push" never completed. I will retry next week ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:37:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 12:37:15 +0000 Subject: [issue35361] Update libffi dependency to 3.2.1? Message-ID: <1543581435.81.0.788709270274.issue35361@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 2.7 and 3.6 embed a copy of libffi 3.1, whereas libffi 3.2.1 was released on November 12, 2014. Should we update libffi? I'm talking about the directory Modules/_ctypes/libffi/. It seems like Fedora 29 still uses libffi 3.1: $ rpm -q libffi libffi-3.1-18.fc29.x86_64 Note: Not only we vendor a copy of libffi and we also modify it :-/ Hopefully, libffi copy has been removed from Python 3.7! ---------- components: Build messages: 330784 nosy: vstinner priority: normal severity: normal status: open title: Update libffi dependency to 3.2.1? versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 07:54:04 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 30 Nov 2018 12:54:04 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1543582444.52.0.788709270274.issue33930@psf.upfronthosting.co.za> INADA Naoki added the comment: $ ./python.patched -m perf timeit --compare-to ./python.master -s 'o="foo"' 'o.encode' --duplicate=10000 python.master: ..................... 23.1 ns +- 0.5 ns python.patched: ..................... 24.6 ns +- 0.5 ns Mean +- std dev: [python.master] 23.1 ns +- 0.5 ns -> [python.patched] 24.6 ns +- 0.5 ns: 1.06x slower (+6%) $ perf record ./python.patched -m perf timeit -s 'o="foo"' 'o.encode' --duplicate=10000 Couldn't record kernel reference relocation symbol Symbol resolution may be skewed if relocation was used (e.g. kexec). Check /proc/kallsyms permission or run as root. ..................... Mean +- std dev: 24.9 ns +- 0.7 ns [ perf record: Woken up 9 times to write data ] [kernel.kallsyms] with build id debb7f6ce8aad7263cc6564650a88db5c8003389 not found, continuing without symbols [ perf record: Captured and wrote 2.491 MB perf.data (61787 samples) ] $ perf report | cat (snip) # Total Lost Samples: 0 # # Samples: 61K of event 'cycles:ppp' # Event count (approx.): 52880893198 # # Overhead Command Shared Object Symbol # ........ .............. ................................................ .......................................... # 18.78% python.patched python.patched [.] _PyEval_EvalFrameDefault 14.85% python.patched python.patched [.] _PyObject_GenericGetAttrWithDict 9.93% python.patched python.patched [.] PyCFunction_NewEx 8.56% python.patched python.patched [.] _PyType_Lookup 6.61% python.patched python.patched [.] meth_dealloc 4.12% python.patched python.patched [.] PyParser_AddToken 3.36% python.patched python.patched [.] PyObject_GetAttr 3.33% python.patched python.patched [.] PyObject_GC_UnTrack 3.25% python.patched python.patched [.] method_get 2.92% python.patched python.patched [.] _Py_bytes_contains 2.13% python.patched python.patched [.] freechildren 1.41% python.patched python.patched [.] pymalloc_alloc.isra.6.part.7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 08:27:43 2018 From: report at bugs.python.org (David) Date: Fri, 30 Nov 2018 13:27:43 +0000 Subject: [issue35350] importing "ctypes" immediately causes a segmentation fault In-Reply-To: <1543504667.76.0.788709270274.issue35350@psf.upfronthosting.co.za> Message-ID: <1543584463.46.0.788709270274.issue35350@psf.upfronthosting.co.za> David added the comment: Another small update: After I recompiled Python with the commented out statement, I did a small test if loading a shared library works. I compiled the following test function to testib.so: #include void test_func(void); void test_func(void) { printf("hello world\n"); } After that I used ctypes to load this library and execute the test_func(): (gdb) file python2.7 Reading symbols from python2.7...done. (gdb) run -c "import ctypes; lib_test = ctypes.cdll.LoadLibrary('/tmp/testlib.so'); lib_test.test_func();" Starting program: /usr/bin/python2.7 -c "import ctypes; lib_test = ctypes.cdll.LoadLibrary('/tmp/testlib.so'); lib_test.test_func();" warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. hello world Program received signal SIGSEGV, Segmentation fault. PyCFuncPtr_call (self=, inargs=, kwds=) at /home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/_ctypes.c:4108 4108 /home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/_ctypes.c: No such file or directory. (gdb) It prints the expected output, but again I get a segmentation fault, this time in PyCFuncPtr_call function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 09:28:46 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 30 Nov 2018 14:28:46 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543588126.21.0.788709270274.issue35352@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: It seems I can reproduce it on Fedora as well by setting stronger crypto defaults through 'update-crypto-policies --set FUTURE'. Repo located here: https://gitlab.com/redhat-crypto/fedora-crypto-policies/tree/master The changes are many, but if I compare with RHEL8, the minimal changes that could affect it are: -# DH params size: >= 1023 +# DH params size: >= 2048 -# TLS protocols: TLS >= 1.0 +# TLS protocols: TLS >= 1.2, DTLS >= 1.2 - at protocol_list = ('TLS1.3', 'TLS1.2', 'TLS1.1', 'TLS1.0', 'DTLS1.2', 'DTLS1.0'); + at protocol_list = ('TLS1.3', 'TLS1.2', 'DTLS1.2'); - $min_tls_version = 'TLS1.0'; - min_dtls_version = 'DTLS1.0'; + $min_tls_version = 'TLS1.2'; + $min_dtls_version = 'DTLS1.2'; # Parameter sizes - $min_dh_size = 1023; + $min_dh_size = 2048; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 09:44:46 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 30 Nov 2018 14:44:46 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543589086.13.0.788709270274.issue35352@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Maybe this is the reason. asycio test suite uses these ssl contexts: https://github.com/python/cpython/blob/master/Lib/test/test_asyncio/utils.py#L72-L92 Maybe bumping used protocol version will help to pass tests on your box. Would you try it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:10:12 2018 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 30 Nov 2018 15:10:12 +0000 Subject: [issue35358] avoid '-' in importlib.import_module and builtins.__import__ In-Reply-To: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> Message-ID: <1543590612.65.0.788709270274.issue35358@psf.upfronthosting.co.za> Eric V. Smith added the comment: I dynamically load a lot of modules whose names contain hyphens, or are otherwise non-identifiers (like 3rdparty.py). The suggested change would break a lot of working code. The only thing I can see being possible is to add a warning that no one would likely ever see. So I think we should take no action here. ---------- nosy: +eric.smith type: -> enhancement versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:13:00 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 30 Nov 2018 15:13:00 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543590780.11.0.788709270274.issue35352@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: I believe I figured out the issue, at least on the master branch. While checking the certificates used by asyncio tests within the test_asyncio folder I noticed they were quite outdated when compared to the more recent updated ones with the test/ folder, which take into account the stronger crypto defaults introduced in the latest openssl versions. And by looking at https://github.com/python/cpython/commit/6d8c1abb003a4cb05f1ddcf0eeddeeeed513cd57#diff-a8e7dbb528601706db0f01d01332bb76 it seems that those certs are just copied from test/ within test_asyncio/. So by copying over the old certs, the tests actually pass. The immediate workaround would be to just copy over the certs but a better approach would be to just reuse the certs within the test/ folder instead of relying on copying them over to test_asyncio/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:14:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:14:35 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543590875.48.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9eea6eaf23067880f4af3a130e3f67c9812e2f30 by Victor Stinner (Siddhesh Poyarekar) in branch 'master': bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) https://github.com/python/cpython/commit/9eea6eaf23067880f4af3a130e3f67c9812e2f30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:14:42 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 15:14:42 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543590882.18.0.788709270274.issue33015@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:21:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:21:16 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543591276.3.0.788709270274.issue33015@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:26:10 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 30 Nov 2018 15:26:10 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543591570.57.0.788709270274.issue35338@psf.upfronthosting.co.za> Josh Rosenberg added the comment: set.union() without constructing the set you call union on only happens to work for the set.union(a) case because `a` is already a set. union takes arbitrary iterables, not just sets, and you're just cheating by explicitly passing `a` as the expected self argument. If you'd set `a = [1, 2]` (a list, not a set), set.union(a) would fail, because set.union(a) was only working by accident of a being interpreted as self; any such use is misuse. Point is, the zero args case isn't a unique corner case; args = ([1, 2], ANY OTHER ITERABLES HERE) set.union(*args) fails too, because the first argument is interpreted as self, and must be a set for this to work. SilentGhost's solution of constructing the set before union-ing via set().union(*args) is the correct solution; it's free of corner cases, removing the specialness of the first element in args (because self is passed in correctly), and not having any troubles with empty args. intersection is the only interesting case here, where preconstruction of the empty set doesn't work, because that would render the result the empty set unconditionally. The solution there is set(args[0]).intersection(*args) (or *args[1:]), but that's obviously uglier. I'm -1 on making any changes to set.union to support this misuse case. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:28:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:28:33 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543591713.33.0.788709270274.issue33015@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:30:25 2018 From: report at bugs.python.org (vassilis Lemonidis) Date: Fri, 30 Nov 2018 15:30:25 +0000 Subject: [issue35362] list inheritor with abc method does not raise Message-ID: <1543591825.01.0.788709270274.issue35362@psf.upfronthosting.co.za> New submission from vassilis Lemonidis : The following does not raise: class Test(list, metaclass=ABCMeta): @abstractmethod def test(self): pass test = Test() There is not enough documentation to support this problem, so I believe this can be classified as a bug. Anyone please elaborate. ---------- components: Library (Lib) messages: 330793 nosy: vaslem priority: normal severity: normal status: open title: list inheritor with abc method does not raise versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:31:13 2018 From: report at bugs.python.org (vassilis Lemonidis) Date: Fri, 30 Nov 2018 15:31:13 +0000 Subject: [issue35362] list inheritor with abc method does not raise In-Reply-To: <1543591825.01.0.788709270274.issue35362@psf.upfronthosting.co.za> Message-ID: <1543591873.02.0.788709270274.issue35362@psf.upfronthosting.co.za> Change by vassilis Lemonidis : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:32:15 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 15:32:15 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543591935.7.0.788709270274.issue33015@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b1355352d14a0a67107aba7ec6f233336f17716a by Miss Islington (bot) in branch '3.7': bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) https://github.com/python/cpython/commit/b1355352d14a0a67107aba7ec6f233336f17716a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:32:36 2018 From: report at bugs.python.org (vassilis Lemonidis) Date: Fri, 30 Nov 2018 15:32:36 +0000 Subject: [issue35362] list inheritor with abstract content does not raise In-Reply-To: <1543591825.01.0.788709270274.issue35362@psf.upfronthosting.co.za> Message-ID: <1543591956.69.0.788709270274.issue35362@psf.upfronthosting.co.za> Change by vassilis Lemonidis : ---------- title: list inheritor with abc method does not raise -> list inheritor with abstract content does not raise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:54:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:54:17 +0000 Subject: [issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot Message-ID: <1543593257.05.0.788709270274.issue35363@psf.upfronthosting.co.za> New submission from STINNER Victor : test_open() of test_eintr hangs randomly on x86-64 El Capitan 3.x buildbot. test_eintr failed but then passed when run again. pythoninfo: platform.platform: Darwin-15.6.0-x86_64-i386-64bit # macOS 10.11 (El Capitan) https://buildbot.python.org/all/#/builders/93/builds/1574 test_all (test.test_eintr.EINTRTests) ... FAIL ====================================================================== FAIL: test_all (test.test_eintr.EINTRTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_eintr.py", line 18, in test_all script_helper.assert_python_ok("-u", tester) File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py", line 157, in assert_python_ok return _assert_python(True, *args, **env_vars) File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py", line 143, in _assert_python res.fail(cmd_line) File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py", line 70, in fail raise AssertionError("Process return code is %d\n" AssertionError: Process return code is 1 command line: ['/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/python.exe', '-X', 'faulthandler', '-I', '-u', '/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py'] stdout: --- --- stderr: --- ........ss.s.ss.Timeout (0:10:00)! Thread 0x00007fff7c082000 (most recent call first): File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py", line 349 in python_open File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py", line 345 in _test_open File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/__init__.py", line 596 in wrapper File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py", line 353 in test_open File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/case.py", line 642 in run File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/case.py", line 702 in __call__ File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py", line 122 in run File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py", line 122 in run File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/runner.py", line 176 in run File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/main.py", line 271 in runTests File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/main.py", line 101 in __init__ File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py", line 527 in --- ---------------------------------------------------------------------- Ran 1 test in 605.488s FAILED (failures=1) Warning -- files was modified by test_eintr Before: [] After: ['@test_57532_tmp'] test test_eintr failed ---------- components: Tests messages: 330795 nosy: vstinner priority: normal severity: normal status: open title: test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:59:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:59:32 +0000 Subject: [issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot In-Reply-To: <1543593257.05.0.788709270274.issue35363@psf.upfronthosting.co.za> Message-ID: <1543593572.07.0.788709270274.issue35363@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm unable to reproduce the bug on macOS 10.13.6 using: ./python.exe -m test -F test_eintr --timeout=60 I modified the test to display immediately result into stdout: diff --git a/Lib/test/test_eintr.py b/Lib/test/test_eintr.py index 25f86d3..47b89d3 100644 --- a/Lib/test/test_eintr.py +++ b/Lib/test/test_eintr.py @@ -1,6 +1,8 @@ import os +import sys import signal import unittest +import subprocess from test import support from test.support import script_helper @@ -15,7 +17,9 @@ class EINTRTests(unittest.TestCase): # thread (for reliable signal delivery). tester = support.findfile("eintr_tester.py", subdir="eintrdata") # use -u to try to get the full output if the test hangs or crash - script_helper.assert_python_ok("-u", tester) + proc = subprocess.run([sys.executable, "-u", tester, "-v"]) + if proc.returncode: + self.fail("fail") if __name__ == "__main__": ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 10:59:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 15:59:36 +0000 Subject: [issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot In-Reply-To: <1543593257.05.0.788709270274.issue35363@psf.upfronthosting.co.za> Message-ID: <1543593576.99.0.788709270274.issue35363@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:01:36 2018 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 30 Nov 2018 16:01:36 +0000 Subject: [issue35358] avoid '-' in importlib.import_module and builtins.__import__ In-Reply-To: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> Message-ID: <1543593696.58.0.788709270274.issue35358@psf.upfronthosting.co.za> Guido van Rossum added the comment: Do not change this. I'd rather see it documented that importlib can import any name as long as it doesn't contain a dot, slash or backslash. (Clearly the fact that Django loads it is an additional argument that this should be supported, not forbidden.) It's the same as for getattr etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:04:38 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:04:38 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543593878.61.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 by Victor Stinner in branch '2.7': bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823) https://github.com/python/cpython/commit/8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:04:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:04:48 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543593888.18.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 03b1200dfd03061e9ad0bff8199967bd80b9b900 by Victor Stinner in branch '3.6': bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10822) https://github.com/python/cpython/commit/03b1200dfd03061e9ad0bff8199967bd80b9b900 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:05:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:05:17 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543593917.07.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, the bug should now be fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:08:33 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:08:33 +0000 Subject: [issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot In-Reply-To: <1543593257.05.0.788709270274.issue35363@psf.upfronthosting.co.za> Message-ID: <1543594113.8.0.788709270274.issue35363@psf.upfronthosting.co.za> STINNER Victor added the comment: I stopped my manual test after 71 iterations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:20:37 2018 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 30 Nov 2018 16:20:37 +0000 Subject: [issue35338] set union/intersection/difference could accept zero arguments In-Reply-To: <1543416655.98.0.788709270274.issue35338@psf.upfronthosting.co.za> Message-ID: <1543594837.44.0.788709270274.issue35338@psf.upfronthosting.co.za> Mark Dickinson added the comment: > set.union() without constructing the set you call union on only happens to work for the set.union(a) case because `a` is already a set. Good point. I wasn't thinking clearly about the unbound-methodness of this. > I'm -1 on making any changes to set.union to support this misuse case. Agreed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:21:26 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 30 Nov 2018 16:21:26 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543594886.64.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- keywords: +patch pull_requests: +10067 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:26:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:26:56 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543595216.85.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: > The strange thing is these tests are passed on our build bots. RHEL8 has a very strict security policy by default. I'm not sure if any OS run on buildbot has a security policy as strict as RHEL8? > Maybe bumping used protocol version will help to pass tests on your box. I tried to tune the SSLContext in many different ways but it doesn't work. The problem comes from the .pem files. I confirm that copying .pem files from Lib/test/ into Lib/test/test_asyncio/ does fix the issue. > And by looking at https://github.com/python/cpython/commit/6d8c1abb003a4cb05f1ddcf0eeddeeeed513cd57#diff-a8e7dbb528601706db0f01d01332bb76 it seems that those certs are just copied from test/ within test_asyncio/. So by copying over the old certs, the tests actually pass. In this case, I don't see the point of having two copies of the same files. PR 10826 does the right fix: remove .pem files from Lib/test/test_asyncio/ and reuse .pem files from Lib/test/. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:29:15 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 30 Nov 2018 16:29:15 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543595354.99.0.788709270274.issue35352@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Also on Fedora the same set of security policies can be set as RHEL8 by utilizing 'update-crypto-policies --set NEXT' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:39:20 2018 From: report at bugs.python.org (Matej Cepl) Date: Fri, 30 Nov 2018 16:39:20 +0000 Subject: [issue31046] ensurepip does not honour the value of $(prefix) In-Reply-To: <1501087168.72.0.253170854096.issue31046@psf.upfronthosting.co.za> Message-ID: <1543595960.44.0.788709270274.issue31046@psf.upfronthosting.co.za> Matej Cepl added the comment: Per https://devguide.python.org/pullrequest/, can I ask you Xavier to prepare a proper pull request for this patch to the GitHub repo, please? ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:52:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:52:14 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543596734.7.0.788709270274.issue33015@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:54:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:54:32 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543596872.01.0.788709270274.issue33015@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:54:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:54:56 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543596896.57.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh... test_threaded_import started to crash on Python 2.7: $ ./python -m test -F -v test_threaded_import (...) 0:00:00 load avg: 1.06 [ 3] test_threaded_import Trying 20 threads ... OK. Trying 50 threads ... OK. Trying 20 threads ... OK. Segmentation fault (core dumped) The problem is that PyMem_Malloc() is not thread safe when Python is compiled in debug mode! In release mode, it's safe because PyMem_Malloc() is a thin wrapper to malloc(). But in debug mode, PyMem_Malloc() uses the debug hooks and... pymalloc allocator which is not thread-safe! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:56:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:56:08 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543596968.3.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote PR 10828 to make PyMem_Malloc() thread-safe in debug mode as well.. But I'm not sure that it's ok to push such change later in the 2.7 development cycle... So I wrote PR 10829 which only modified PyThread_start_new_thread(): use malloc/free instead of PyMem_Malloc/PyMem_Free. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:56:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 16:56:59 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543597019.21.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b062ba77b617b0f89b7ea25d14cc77c991462ad4 by Victor Stinner (stratakis) in branch 'master': bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) https://github.com/python/cpython/commit/b062ba77b617b0f89b7ea25d14cc77c991462ad4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 11:57:11 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Nov 2018 16:57:11 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543597031.33.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +10070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:04:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:04:30 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543597470.22.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:05:50 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 30 Nov 2018 17:05:50 +0000 Subject: [issue28608] Support creating hardlink using `pathlib` In-Reply-To: <1543384022.76.0.788709270274.issue28608@psf.upfronthosting.co.za> Message-ID: <1543597550.24.0.788709270274.issue28608@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Since Path already supports symlinking, it would be reasonable to add hardlinking (e.g. as `Path.link_to`). But as you said one may as well call `os.link(path1, path2)`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:08:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:08:05 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543597685.1.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bc9f53f69e8207027bf2b18e3d01b30401e76ace by Victor Stinner in branch '2.7': bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829) https://github.com/python/cpython/commit/bc9f53f69e8207027bf2b18e3d01b30401e76ace ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:24:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:24:13 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543598653.0.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:25:41 2018 From: report at bugs.python.org (Adrien) Date: Fri, 30 Nov 2018 17:25:41 +0000 Subject: =?utf-8?b?W2lzc3VlMzUzNjRdIERhdGV0aW1lIOKAnGZyb210aW1lc3RhbXAoKeKAnSBp?= =?utf-8?q?gnores_inheritance_if_timezone_is_not_None?= Message-ID: <1543598741.31.0.788709270274.issue35364@psf.upfronthosting.co.za> New submission from Adrien : Hello. I created a class inheriting from "datetime.datetime". While creating a new instance using the classmethod "fromtimestamp" it seems to work, except if I provide a timezone object. In such case, the returned object is of base type datetime. This looks like a bug, isn't it? If not, I guess this should be mentioned somewhere in the documentation. Tested on Python 3.6 and 3.7, my apologies if this has been fixed in 3.8. NB: I first opened a question on SO -> https://stackoverflow.com/questions/53561996/datetime-fromtimestamp-ignores-inheritance-if-timezone-is-not-none ---------- components: Library (Lib) files: test.py messages: 330811 nosy: Delgan priority: normal severity: normal status: open title: Datetime ?fromtimestamp()? ignores inheritance if timezone is not None type: behavior versions: Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47960/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:26:05 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 30 Nov 2018 17:26:05 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543598765.18.0.788709270274.issue35352@psf.upfronthosting.co.za> Andrew Svetlov added the comment: IIRC two copies exist from very early development times when asyncio was not a part of Python stdlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:28:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:28:16 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543598896.47.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: > IIRC two copies exist from very early development times when asyncio was not a part of Python stdlib. Yeah, that was my guess as well. Maybe data_file() could be simplified or replaced by support.findfile(), but I chose the easy solution (minimize changes) :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:30:11 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:30:11 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543599011.85.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 7212148c95947b0fdfcb0c8e37d4357287bdb4bd by Victor Stinner in branch 'master': bpo-35352: Cleanup test_asyncio/utils.py (GH-10831) https://github.com/python/cpython/commit/7212148c95947b0fdfcb0c8e37d4357287bdb4bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:32:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 17:32:15 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543599135.64.0.788709270274.issue35352@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +10073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 12:34:20 2018 From: report at bugs.python.org (Adrien) Date: Fri, 30 Nov 2018 17:34:20 +0000 Subject: =?utf-8?b?W2lzc3VlMzUzNjRdIERhdGV0aW1lIOKAnGZyb210aW1lc3RhbXAoKeKAnSBp?= =?utf-8?q?gnores_inheritance_if_timezone_is_not_None?= In-Reply-To: <1543598741.31.0.788709270274.issue35364@psf.upfronthosting.co.za> Message-ID: <1543599260.51.0.788709270274.issue35364@psf.upfronthosting.co.za> Adrien added the comment: Actually, this also occurs while using "astimezone()" on a custom child class (I suppose this method is used by "fromtimestamp()"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:34:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 19:34:39 +0000 Subject: [issue35365] Use wchar_t* buffer instead of Unicode object in code page decoder Message-ID: <1543606479.07.0.788709270274.issue35365@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently the code page decoder uses the legacy Unicode C API for creating an output buffer as a Unicode object with PyUnicode_WCHAR_KIND. Proposed PR makes it using a raw wchar_t* buffer. This is necessary for deprecating and removing the legacy Unicode C API in future. ---------- assignee: serhiy.storchaka components: Interpreter Core messages: 330816 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Use wchar_t* buffer instead of Unicode object in code page decoder versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:36:49 2018 From: report at bugs.python.org (Vijay) Date: Fri, 30 Nov 2018 19:36:49 +0000 Subject: [issue35366] Monkey Patching class derived from ctypes.Union doesn't work Message-ID: <1543606609.9.0.788709270274.issue35366@psf.upfronthosting.co.za> New submission from Vijay : I am trying to "monkey patch" a class derived from Python ctypes "Union", but I am unable to do so - getting weird errors and sometimes seg-faults. The same thing works quite well when deriving from ctypes "Structure". I have narrowed this to down to the simplest possible test case which I am posting below. I am using Python 3.6.4. I am wondering if I am doing something wrong (or is there a problem with the ctypes "Union" implementation?). The example python code is attached with this issue. Please see the output below (for the attached code in Python 3.6.4). Using Structure: ---------------- Print Type #1: [ 10, 20 ] Original : Patched : Patched (dict) : Print Type #2: ( 10, 20 ) Using Union: ------------ Print Type #1: [ 20, 20 ] Original : Patched : Patched (dict) : Traceback (most recent call last): File "ctypes_bug.py", line 54, in print(a) TypeError: 'managedbuffer' object is not callable Clearly, I am able to "patch" __str__ when the corresponding Python object was derived from "Structure", but I am unable to "patch" __str__ when the corresponding Python object was derived from "Union". Interestingly, MyUnion.__dict__[__str__] and MyUnion.__str__ shows different results - which is weird as well. Is there something I am doing wrong here, or is there an issue with ctypes.Union? I highly appreciate any help or insight! ---------- components: ctypes files: ctypes_bug.py messages: 330817 nosy: rvijayc priority: normal severity: normal status: open title: Monkey Patching class derived from ctypes.Union doesn't work type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47961/ctypes_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:44:31 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 19:44:31 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543607071.24.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 38bed786a219c65d5a51c7ef4ffd97e12653a095 by Victor Stinner in branch '3.7': [3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10834) https://github.com/python/cpython/commit/38bed786a219c65d5a51c7ef4ffd97e12653a095 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:44:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 19:44:46 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543607086.38.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 02250e57c37339ea6de08ab077a307e75eef02f5 by Victor Stinner in branch '3.6': bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10832) https://github.com/python/cpython/commit/02250e57c37339ea6de08ab077a307e75eef02f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:48:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 19:48:24 +0000 Subject: [issue35352] test_asyncio fails on RHEL8 In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543607304.51.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: I leave the issue open until someone validates manually that the issue os fixed in all branches with stricter security (ex: RHEL8). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:55:18 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 30 Nov 2018 19:55:18 +0000 Subject: [issue35358] Document that importlib.import_module accepts names that are not valid Python syntax In-Reply-To: <1543566651.92.0.788709270274.issue35358@psf.upfronthosting.co.za> Message-ID: <1543607718.32.0.788709270274.issue35358@psf.upfronthosting.co.za> Brett Cannon added the comment: I agree that this shouldn't change and at best can be a documentation update to mention the fact that importlib.import_module() doesn't restrict itself to valid syntax names on purpose. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python priority: normal -> low title: avoid '-' in importlib.import_module and builtins.__import__ -> Document that importlib.import_module accepts names that are not valid Python syntax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 14:58:45 2018 From: report at bugs.python.org (Martijn Pieters) Date: Fri, 30 Nov 2018 19:58:45 +0000 Subject: [issue35366] Monkey Patching class derived from ctypes.Union doesn't work In-Reply-To: <1543606609.9.0.788709270274.issue35366@psf.upfronthosting.co.za> Message-ID: <1543607925.36.0.788709270274.issue35366@psf.upfronthosting.co.za> Martijn Pieters added the comment: This is a repeat of old-tracker issue 1700288, see https://github.com/python/cpython/commit/08ccf202e606a066668f4ef85df9a9c0d07e1ba1#diff-998bfefaefe2ab83d5f523e18f158fa4, which fixed this for StructType_setattro but failed to do the same for UnionType_setattro ---------- nosy: +mjpieters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:00:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Nov 2018 20:00:55 +0000 Subject: [issue34867] Add mode to disable small integer and interned string caches In-Reply-To: <1538440812.47.0.545547206417.issue34867@psf.upfronthosting.co.za> Message-ID: <1543608055.02.0.788709270274.issue34867@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Steven, thank you for splitting this off for proper discussion. To me, the base issue is that CPython is both the language reference implementation and, as yet, the main production implementation. As the latter, it has unintended and unwanted bugs and intentional optimizations added for performance rather than language conformance. Some of these, like caching, affect boolean results involving 'is' and id(). Problems arise when people confuse reference features with implementation features. This issue proposes adding a mode that turns off certain optimization features. There is another proposal to turn off other optimizations (again during code analysis and testing) that affect tracing results and sometimes coverage results based thereon, giving false negatives. In either case, I see the result as a 'language reference' mode. As Steven suggested, the result is in a sense less chaotic, not more. A chaos mode for caching would randomly cache or not. Multiple comments above contain 'bug'. Given that the language leaves implementations to cache certain immutables -- or not -- the bug in code meant to be implementation independent is to depend on caching *either way*. Turning caching off only catches the 'bug' of assuming caching, not the bug of assuming no caching. >From a math viewpoint, n is n for all n, so 'is' *is* the proper comparison for ints. From this viewpoint, caching should be the default and having not caching most values of n, and having to use '==' instead of 'is', is the practice time-space tradeoff compromise. Like Raymond, I currently think that this proposal lacks sufficient justification. ---------- nosy: +terry.reedy type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:07:27 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 30 Nov 2018 20:07:27 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543608447.58.0.788709270274.issue35354@psf.upfronthosting.co.za> Brett Cannon added the comment: How did you make a recursive generator? The 'yield' would have paused execution. Do you have code you can share to reproduce? Otherwise blowing your stack out is normal behaviour in a function which you can deal with by lowering your stack depth with sys.setrecursionlimit() to one that will raise RecursionError before you blow your stack. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:28:18 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Nov 2018 20:28:18 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543609698.28.0.788709270274.issue34850@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I like this proposal better than a separate test mode. But users will see compiler warnings for main modules and for packages recompiled for a new version or for a maintenance releases with a byte code bump, and for unprecompiled packages on systems that do not allow .pyc caching. The first will not matter for packages with minimal main modules. Recompiles will be rare. I suspect that the 3rd possibility is also rare. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:43:02 2018 From: report at bugs.python.org (Rich Jones) Date: Fri, 30 Nov 2018 20:43:02 +0000 Subject: [issue35367] FileExistsError During os.symlink() Displays Arrow in the Wrong Direction Message-ID: <1543610582.95.0.788709270274.issue35367@psf.upfronthosting.co.za> New submission from Rich Jones : If I try to create a symlink which already exists, I get a FileExistsError. In this error message, the explanatory arrow is pointing in the wrong direction. This gave us a big scare in our logs! Example: ``` $ ls HELLO.txt $ python3 Python 3.7.0 (default, Jul 23 2018, 20:22:55) [Clang 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.symlink('HELLO.txt', 'GOODBYE.txt') $ ls -lah * lrwxr-xr-x 1 rjones staff 9B Nov 30 15:36 GOODBYE.txt -> HELLO.txt -rw-r--r-- 1 rjones staff 4B Nov 30 15:34 HELLO.txt $ python3 Python 3.7.0 (default, Jul 23 2018, 20:22:55) [Clang 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.symlink('HELLO.txt', 'GOODBYE.txt') Traceback (most recent call last): File "", line 1, in FileExistsError: [Errno 17] File exists: 'HELLO.txt' -> 'GOODBYE.txt' ``` Notice that the arrow in the error message is pointing from HELLO to GOODBYE, but if you if you look at the `ls` output, it is pointing from GOODBYE to HELLO, which is the correct behavior. The Python3 error message should be changed to reflect the correct direction of the symlink. This is a Python3 only bug, as the paths aren't displayed in Python2. I can PR if this is accepted as a bug. Thanks! Rich ---------- components: Library (Lib) messages: 330826 nosy: miserlou priority: normal severity: normal status: open title: FileExistsError During os.symlink() Displays Arrow in the Wrong Direction type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:56:11 2018 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Nov 2018 20:56:11 +0000 Subject: [issue35367] FileExistsError During os.symlink() Displays Arrow in the Wrong Direction In-Reply-To: <1543610582.95.0.788709270274.issue35367@psf.upfronthosting.co.za> Message-ID: <1543611371.53.0.788709270274.issue35367@psf.upfronthosting.co.za> Change by Eryk Sun : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> os.symlink: FileExistsError shows wrong message _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 15:57:25 2018 From: report at bugs.python.org (Eli_B) Date: Fri, 30 Nov 2018 20:57:25 +0000 Subject: [issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted In-Reply-To: <1502374939.75.0.688742031254.issue31177@psf.upfronthosting.co.za> Message-ID: <1543611445.94.0.788709270274.issue31177@psf.upfronthosting.co.za> Change by Eli_B : ---------- pull_requests: +10074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 16:01:43 2018 From: report at bugs.python.org (Rich Jones) Date: Fri, 30 Nov 2018 21:01:43 +0000 Subject: [issue29657] os.symlink: FileExistsError shows wrong message In-Reply-To: <1488099144.41.0.738429373533.issue29657@psf.upfronthosting.co.za> Message-ID: <1543611703.85.0.788709270274.issue29657@psf.upfronthosting.co.za> Rich Jones added the comment: @Larry - that would be an acceptable solution! I'm here because I encountered this error independently. I explain why the arrow is a problem here: https://bugs.python.org/issue35367 The issue is that the '->' notation is already used by the standard operating system utilities in this context, so for Python overload this semantically in this case is the source of all the confusion. It would avoid the scare that we've all encountered if it just said 'src'/'dst' rather than '->'. Thanks! R ---------- nosy: +miserlou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 16:03:33 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 21:03:33 +0000 Subject: [issue35365] Use wchar_t* buffer instead of Unicode object in code page decoder In-Reply-To: <1543606479.07.0.788709270274.issue35365@psf.upfronthosting.co.za> Message-ID: <1543611813.63.0.788709270274.issue35365@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +10075 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 16:18:40 2018 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 30 Nov 2018 21:18:40 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543612720.94.0.788709270274.issue34850@psf.upfronthosting.co.za> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 17:00:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 22:00:19 +0000 Subject: [issue35352] test_asyncio fails on RHEL8, or on Fedora using NEXT security policy In-Reply-To: <1543508030.73.0.788709270274.issue35352@psf.upfronthosting.co.za> Message-ID: <1543615219.77.0.788709270274.issue35352@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested on Fedora 29 using: sudo update-crypto-policies --set NEXT With this config, I was able to reproduce the test_asyncio failure on 3.6, 3.7 and master branches. I confirm that the commits fixed test_asyncio in these 3 branches. Thanks Charalampos Stratakis! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: test_asyncio fails on RHEL8 -> test_asyncio fails on RHEL8, or on Fedora using NEXT security policy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 17:38:23 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 30 Nov 2018 22:38:23 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543617503.07.0.788709270274.issue33015@psf.upfronthosting.co.za> Gregory P. Smith added the comment: why was that only an issue on 2.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 17:53:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 22:53:05 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543618385.35.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: > why was that only an issue on 2.7? I added PyMem_RawMalloc() to Python 3.4 and this function must be thread-safe. https://docs.python.org/dev/c-api/memory.html#raw-memory-interface "These functions are thread-safe, the GIL does not need to be held." I replaced PyMem_RawMalloc() with PyMem_Malloc() when I backported the change, but I didn't know that PyMem_Malloc() isn't thread-safe *in debug mode*! Gregory: do you think that it would be be crazy to fix PyMem_Malloc() to make it thread-safe in debug mode as well? I implemented a fix: PR 10828. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 17:55:54 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 30 Nov 2018 22:55:54 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543618554.1.0.788709270274.issue34850@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Would it be more acceptable to use a DeprecationWarning? It's not really the right thing because we're not planning to ever actually remove the functionality. But, we've already gone to a lot of trouble to try to show DeprecationWarnings specifically to devs and not end users (hiding them by default, except if the source was the REPL or a test, getting patches into every test framework to handle this, etc.). And the issues here seem to be identical. Or maybe LintWarning inherits from DeprecationWarning? Or the share a common superclass? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 18:06:01 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 30 Nov 2018 23:06:01 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543619161.71.0.788709270274.issue33015@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I don't think it is crazy for 2.7, but I'd move that to its own issue as you already nicely addressed the problem related to this PR without needing that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 18:07:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 23:07:48 +0000 Subject: [issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode Message-ID: <1543619268.28.0.788709270274.issue35368@psf.upfronthosting.co.za> New submission from STINNER Victor : While fixing bpo-33015, I discovered that PyMem_Malloc() isn't thread-safe when Python is compiled in debug mode: https://bugs.python.org/issue33015#msg330806 I wrote PR 10828 to make PyMem_Malloc() thread-safe when Python is compiled in debug mode. ---------- components: Interpreter Core messages: 330833 nosy: gregory.p.smith, vstinner priority: normal severity: normal status: open title: [2.7] Make PyMem_Malloc() thread-safe in debug mode versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 18:09:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 23:09:40 +0000 Subject: [issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode In-Reply-To: <1543619268.28.0.788709270274.issue35368@psf.upfronthosting.co.za> Message-ID: <1543619380.77.0.788709270274.issue35368@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +10076 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 18:10:18 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 30 Nov 2018 23:10:18 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543619418.28.0.788709270274.issue34850@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Given that linters like pylint can already detect the common case of this issue when using `is` and `is not` to compare to a literal where == or != seems more appropriate, I don't think a warning is very useful. In my experience people are more likely to run code through a linter than they are to ever run an interpreter with DeprecationWarning enabled. I do like the concept of using a not visible by default warning, but I don't think adding a LintWarning or misusing DeprecationWarning adds much value. I suggest closing this issue as won't fix / not a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 18:11:09 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Nov 2018 23:11:09 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1543619469.47.0.788709270274.issue33015@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't think it is crazy for 2.7, but I'd move that to its own issue as you already nicely addressed the problem related to this PR without needing that. Good idea. I created bpo-35368. I close this issue since it's now fixed. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 19:59:28 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 01 Dec 2018 00:59:28 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543625968.12.0.788709270274.issue34850@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Looks like we have a stand-off between core devs, and no BDFL to make a ruling. There is support for the feature from at least Barry and Raymond (although I think Guido was cool on the idea, maybe?). Gregory, do you feel strongly enough about this that you would reverse the commit if Serhiy just went ahead and committed it? Nobody wants a revert war :-) To me, this seems like a low-cost feature that will help some developers without inconveniencing anyone. As Serhiy points out, SyntaxWarning is only emitted when the code is compiled, so it is only going to be visible to the developer of the module, not the user of the module. Let's not allow the perfect be the enemy of the good enough. I think this is a helpful feature for developers, and as Raymond says it will help teach beginners the difference between `is` and equality. The people who are most prone to making this mistake are the ones least likely to be using a linter. And we know it is helpful: Serhiy already used it to find a bug in IDLE. Gregory, you wanted to close this as not a bug, but nobody says it is a bug, it is an enhancement. And I think there is consensus that this *is* an enhancement. Nobody has said that there are good use cases for using `is` on literals in production code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 20:21:02 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 01 Dec 2018 01:21:02 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543627262.69.0.788709270274.issue34850@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'm actually fine either way. Consider me a solid ?0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 20:45:00 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 01 Dec 2018 01:45:00 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1543628700.87.0.788709270274.issue34850@psf.upfronthosting.co.za> Nathaniel Smith added the comment: > In my experience people are more likely to run code through a linter than they are to ever run an interpreter with DeprecationWarning enabled. This used to be true, and it was a disaster. So there's been a lot of work to fix it, and it's not true anymore. Starting in 3.7, the built-in REPL has DeprecationWarning enabled by default, as do all standalone scripts (see PEP 565). IPython/Jupyter has enabled DeprecationWarning by default for interactive code for about 3 years now: https://github.com/ipython/ipython/issues/8478 pytest started showing DeprecationWarnings by default a few months ago, and unittest has done so for ages. I don't think I've ever met someone who skipped straight to linting, without ever having used a REPL, or written a script, or written a test :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 22:33:53 2018 From: report at bugs.python.org (David Wyde) Date: Sat, 01 Dec 2018 03:33:53 +0000 Subject: [issue35369] List sorting makes duplicate comparisons Message-ID: <1543635233.42.0.788709270274.issue35369@psf.upfronthosting.co.za> New submission from David Wyde : Python's Timsort sometimes makes the same comparison twice. This leads to extra compares, which can hurt performance. Python sorts several length-3 permutations in 4 steps, and the problem accumulates with bigger data. There are ~9,800 duplicate less-than checks when sorting a million randomly ordered numbers, and 24,386 wasted comparisons when sorting all permutations of length 8. I've attached a patch to fix this issue. Feedback and improvements are appreciated. Speed seems roughly comparable, and should be much improved for expensive comparison functions. The same problem occurs in the Chromium Browser, and probably other ports of Python's Timsort implementation. ---------- files: sort-fix.diff keywords: patch messages: 330839 nosy: dwyde, tim.peters priority: normal severity: normal status: open title: List sorting makes duplicate comparisons type: performance versions: Python 3.8 Added file: https://bugs.python.org/file47962/sort-fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 22:34:54 2018 From: report at bugs.python.org (David Wyde) Date: Sat, 01 Dec 2018 03:34:54 +0000 Subject: [issue35369] List sorting makes duplicate comparisons In-Reply-To: <1543635233.42.0.788709270274.issue35369@psf.upfronthosting.co.za> Message-ID: <1543635294.47.0.788709270274.issue35369@psf.upfronthosting.co.za> Change by David Wyde : Added file: https://bugs.python.org/file47963/sort.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 22:41:01 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 01 Dec 2018 03:41:01 +0000 Subject: [issue35354] Generator functions stack overflow In-Reply-To: <1543516829.1.0.788709270274.issue35354@psf.upfronthosting.co.za> Message-ID: <1543635661.61.0.788709270274.issue35354@psf.upfronthosting.co.za> Karthikeyan Singaravelan added the comment: Brett, the user had an invalid email address in their profile thus adding comments to the issue caused a server error while sending notification to them. So they have been removed from the issue. Please see : https://python.zulipchat.com/#narrow/stream/116501-workflow/subject/Is.20adding.20comment.20in.20bpo.20broken.20for.20anyone.3F/near/148846056 As for the issue OP attached a reproducer where they produce NameError with the "new" variable which is not defined in the try block and catch the exception to make recursive calls in https://bugs.python.org/file47958/crash.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 22:48:04 2018 From: report at bugs.python.org (Ben Finney) Date: Sat, 01 Dec 2018 03:48:04 +0000 Subject: [issue33130] functools.reduce signature uses `iterable`, documentation should use the same term In-Reply-To: <1521849944.24.0.467229070634.issue33130@psf.upfronthosting.co.za> Message-ID: <1543636084.7.0.788709270274.issue33130@psf.upfronthosting.co.za> Ben Finney added the comment: The library documentation (e.g. file:///usr/share/doc/python3/html/library/functools.html#functools.reduce ) also has this dissonance: > functools.reduce(`function`, `iterable` [, `initializer` ]) > > Apply function of two arguments cumulatively to the items of `sequence`, from left to right, so as to reduce the sequence to a single value. ---------- nosy: +bignose title: functools.reduce signature/docstring discordance -> functools.reduce signature uses `iterable`, documentation should use the same term _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 30 22:49:52 2018 From: report at bugs.python.org (Ben Finney) Date: Sat, 01 Dec 2018 03:49:52 +0000 Subject: [issue33130] functools.reduce signature uses `iterable`, documentation should use the same term In-Reply-To: <1521849944.24.0.467229070634.issue33130@psf.upfronthosting.co.za> Message-ID: <1543636192.2.0.788709270274.issue33130@psf.upfronthosting.co.za> Ben Finney added the comment: Hah, sorry to use a local-filesystem URL. (Hooray for locally-installed developer documentation!) The same section is online at https://docs.python.org/3/library/functools.html#functools.reduce . ---------- _______________________________________ Python tracker _______________________________________