From report at bugs.python.org Mon May 1 08:34:17 2017 From: report at bugs.python.org (desbma) Date: Mon, 01 May 2017 12:34:17 +0000 Subject: [New-bugs-announce] [issue30219] webbrowser.open outputs xdg-open deprecation warning Message-ID: <1493642057.46.0.399695458413.issue30219@psf.upfronthosting.co.za> New submission from desbma: Python 3.6.1 (default, Mar 27 2017, 00:27:06) [GCC 6.3.1 20170306] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import webbrowser >>> webbrowser.open("https://www.google.com") True >>> This tool has been deprecated, use 'gio open' instead. See 'gio help open' for more info. A quick test reveals it is the invocation of xdg-open that outputs the warning: $ xdg-open --version xdg-open 1.1.0 rc3 $ xdg-open https://www.google.com This tool has been deprecated, use 'gio open' instead. See 'gio help open' for more info. It can be quite annoying because in my program the message is outputted in a ncurses UI and it messes the display. Possible changes to fix this: * Silence xdg-open output (pass stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL in Popen call) * Detect and use "gio open" if available ---------- components: Library (Lib) messages: 292659 nosy: desbma priority: normal severity: normal status: open title: webbrowser.open outputs xdg-open deprecation warning versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 1 12:19:51 2017 From: report at bugs.python.org (Pedro) Date: Mon, 01 May 2017 16:19:51 +0000 Subject: [New-bugs-announce] [issue30220] Why are the custom messages for ValueError and TypeError suppressed in argparse? Message-ID: <1493655591.13.0.717623445702.issue30220@psf.upfronthosting.co.za> New submission from Pedro: ArgumentParser._get_value() has two exception handlers: one for ArgumentTypeError, and one for (TypeError, ValueError). But in the latter case, any custom message I include the TypeError or ValueError is ignored and replaced with a generic "invalid value" message. I don't see why the module wouldn't first check for a custom message in a TypeError or ValueError exception, as it does for ArgumentTypeError, and only use the generic message if a custom one is not specified. The current behavior does not let you to give the user a detailed reason for the exception unless you raise ArgumentTypeError, which is considered an implementation detail as mentioned in #20039, and also doesn't feel right for errors that are not related to the argument's type. Code to reproduce: import argparse def nonnegative_not_suppressed(arg): try: x = int(arg) if x >= 0: return x else: raise argparse.ArgumentTypeError('Enter a nonnegative integer') except: raise argparse.ArgumentTypeError('Enter a nonnegative integer') def nonnegative_suppressed(arg): try: x = int(arg) if x >= 0: return x else: raise ValueError('Enter a nonnegative integer') except: raise ValueError('Enter a nonnegative integer') p = argparse.ArgumentParser('parser') p.add_argument('--no-suppress', type=nonnegative_not_suppressed) p.add_argument('--suppress', type=nonnegative_suppressed) p.parse_args(['--no-suppress', '-4']) # Displays "Enter a nonnegative integer" p.parse_args(['--suppress', '-4']) # Displays "invalid nonnegative_suppressed value: '-4'" ---------- components: Extension Modules messages: 292669 nosy: pgacv2 priority: normal severity: normal status: open title: Why are the custom messages for ValueError and TypeError suppressed in argparse? type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 1 12:53:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 01 May 2017 16:53:21 +0000 Subject: [New-bugs-announce] [issue30221] Deprecate assertNotAlmostEqual Message-ID: <1493657601.18.0.125992832346.issue30221@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The purpose of the assertNotAlmostEqual() method of TestCase is not clear. This method is never used in the CPython testsuite (except tests for it itself), it is never mentioned in the bug tracker (except one general issue about mass renaming methods in TestCase). I have found only one usage of assertNotAlmostEqual() which is not testing its itself on GitHub [1], and in that case it would be better to use assertAlmostEqual() with correct expected result instead. It seems to me that assertNotAlmostEqual() was added just "for symmetry", and there are no real cases for it. Deprecating and following removing it will make the API simpler. [1] https://github.com/BrechtDeVlieger/Altran_courses/blob/d983b30b4dc1eac6905a71209037ed082330f7fe/Python%20fundamentals/Day1/Functions/test_temperature_ori.py ---------- components: Library (Lib) messages: 292674 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: Deprecate assertNotAlmostEqual type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 1 14:59:18 2017 From: report at bugs.python.org (Decorater) Date: Mon, 01 May 2017 18:59:18 +0000 Subject: [New-bugs-announce] [issue30222] make_zip.py had a bug when setting up full 64 bit distribution. Message-ID: <1493665158.27.0.48978585861.issue30222@psf.upfronthosting.co.za> New submission from Decorater: Basically running make_zip like this: ".\PCbuild\amd64\python.exe" ".\Tools\msi\make_zip.py" -a x64 -o ".\python36-x86-x64" Cuases make_zip mess up where none of the libs\*.lib, nor any of the assemblies are copied. And is reproducible on me. However doing something like this on the 32 bit version of python does not get this issue. ---------- components: Demos and Tools, Windows messages: 292694 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: make_zip.py had a bug when setting up full 64 bit distribution. versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 02:56:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 02 May 2017 06:56:56 +0000 Subject: [New-bugs-announce] [issue30223] Add Lib/test/__main__.py in 2.7 Message-ID: <1493708216.05.0.00341541887295.issue30223@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Following patch adds Lib/test/__main__.py in 2.7. This allows running tests with 'python -m test' as in 3.x. ---------- components: Tests messages: 292720 nosy: ezio.melotti, ncoghlan, serhiy.storchaka priority: normal severity: normal status: open title: Add Lib/test/__main__.py in 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 03:35:05 2017 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 02 May 2017 07:35:05 +0000 Subject: [New-bugs-announce] [issue30224] remove outdated checks in struct Message-ID: <1493710505.85.0.8689936336.issue30224@psf.upfronthosting.co.za> New submission from Xiang Zhang: Reading struct's code I find some checks seem outdated. They seemly exists because there are two kinds of integer in 2.x. I wrote a patch to remove them but maybe they exist for other reasons I don't see. Sorry if I misunderstand them. :-( ---------- components: Library (Lib) messages: 292724 nosy: mark.dickinson, meador.inge, xiang.zhang priority: normal severity: normal stage: patch review status: open title: remove outdated checks in struct type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 04:12:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 08:12:52 +0000 Subject: [New-bugs-announce] [issue30225] EBADF error on x86 Tiger 3.x buildbot Message-ID: <1493712772.54.0.125879756705.issue30225@psf.upfronthosting.co.za> New submission from STINNER Victor: test_http_body_pipe() of test_urllib2 uses a subprocess, no idea if it's related: cmd = [sys.executable, "-c", r"pass"] for headers in {}, {"Content-Length": 30}: with subprocess.Popen(cmd, stdout=subprocess.PIPE) as proc: req = Request("http://example.com/", proc.stdout, headers) ... See also my issue #29915 "Drop Mac OS X Tiger support in Python 3.7?" :-) http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/597/steps/test/logs/stdio ./python.exe -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform /bin/sh: line 1: pybuildbot.identify: command not found ./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --timeout=900 -j2 make: [buildbottest] Error 127 (ignored) == CPython 3.7.0a0 (heads/master:5d7a8d0, May 1 2017, 12:22:06) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] == Darwin-8.11.1-i386-32bit little-endian == hash algorithm: siphash24 32bit == cwd: /Users/db3l/buildarea/3.x.bolen-tiger/build/build/test_python_12700 == encodings: locale=UTF-8, FS=utf-8 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=2, quiet=0, hash_randomization=1, isolated=0) Using random seed 2778758 Run tests in parallel using 2 child processes 0:00:12 [ 1/405] test_deque passed 0:00:35 [ 2/405] test_trace passed (34 sec) 0:00:56 [ 3/405] test_capi passed -- running: test_socket (44 sec) 0:00:57 [ 4/405] test_pkgimport passed -- running: test_socket (45 sec) 0:01:02 [ 5/405] test_socket passed (49 sec) 0:01:07 [ 6/405] test_imaplib passed 0:01:18 [ 7/405] test_urllib2 passed Fatal Python error: Py_Initialize: can't initialize sys standard streams OSError: [Errno 9] Bad file descriptor Current thread 0xa000d000 (most recent call first): Fatal Python error: Py_Initialize: can't initialize sys standard streams OSError: [Errno 9] Bad file descriptor Current thread 0xa000d000 (most recent call first): 0:01:20 [ 8/405] test_getargs2 passed 0:01:24 [ 9/405] test_calendar passed 0:01:25 [ 10/405] test_unpack_ex passed ---------- components: Tests, macOS messages: 292725 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: EBADF error on x86 Tiger 3.x buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 04:52:51 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 02 May 2017 08:52:51 +0000 Subject: [New-bugs-announce] [issue30226] Modernize make_ssl_certs Message-ID: <1493715171.18.0.434787469545.issue30226@psf.upfronthosting.co.za> New submission from Christian Heimes: Lib/test/make_ssl_certs.py is used to generate and re-generate certificates and keys for SSL tests. The script and certificates have various smaller issues, e.g. RSA 1024bit certs with SHA-1 signature. Some certificates lack v3 extensions, too. The script fails to regenerate some files, e.g. a copy of pycacert.pem in capath. I'm going to modernize the script. ---------- assignee: christian.heimes components: SSL messages: 292729 nosy: christian.heimes priority: normal severity: normal status: open title: Modernize make_ssl_certs type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 06:15:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 10:15:21 +0000 Subject: [New-bugs-announce] [issue30227] test_site must not write outside the build directory: must not write into $HOME/.local/ Message-ID: <1493720121.71.0.343416046113.issue30227@psf.upfronthosting.co.za> New submission from STINNER Victor: test_site creates the $HOME/.local/lib/python3.7/site-packages/ directory, or parent directories if needed. That's wrong. An unit test must not modify its environment, especially the home directory! The unit test must mock $HOME environment variable and mock the home directory. Example of issue of writing into $HOME: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.5/builds/75/steps/test/logs/stdio [109/398] test_site test_site skipped -- unable to create user site directory ('/.local/lib/python3.5/site-packages'): [Errno 13] Permission denied: '/.local' On this buildbot, $HOME is set to /. The whole test_site test is skipped just because of that. Recent change on test_site related to this issue: commit b85c136903c6d2368162f7c4a58f258c9c69ead0, bpo-30108. ---------- components: Distutils, Tests messages: 292739 nosy: dstufft, haypo, merwok priority: normal severity: normal status: open title: test_site must not write outside the build directory: must not write into $HOME/.local/ versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 07:11:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 11:11:25 +0000 Subject: [New-bugs-announce] [issue30228] Open a file in text mode requires too many syscalls Message-ID: <1493723485.87.0.646779044512.issue30228@psf.upfronthosting.co.za> New submission from STINNER Victor: Example: with open("x", "w", encoding="utf-8") as fp: fp.write("HERE") fp.close() syscalls: 14249 open("x", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 3 14249 fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 14249 ioctl(3, TCGETS, 0x7fff07d43330) = -1 ENOTTY (Inappropriate ioctl for device) 14249 lseek(3, 0, SEEK_CUR) = 0 14249 lseek(3, 0, SEEK_CUR) = 0 14249 lseek(3, 0, SEEK_CUR) = 0 14249 write(3, "HERE", 4) = 4 14249 close(3) = 0 I only expected 3 syscalls: open, write, close. * fstat() is used by the FileIO constructor to check if the file is a directory or not, and to get the block size * ioctl() comes from open() which checks if the file is a TTY or not, to decide how to configure buffering * the first lseek() is used by the BuffererWriter constructor to initialize the private abs_pos attribute * the second lseek() is used by the TextIOWrapper constructor to check if the underlying file object (buffered writer) is seekable or not * the last lseek() is used to create the cookie object in TextIOWrapper constructor Can we maybe reduce the number of lseek() to a single syscall? For example, BuffererWriter constructor calls FileIO.tell(): can't this method set the seekable attribute depending on lseek() success, as the FileIO.seekable property? ---------- messages: 292744 nosy: haypo, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: Open a file in text mode requires too many syscalls type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 08:17:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 12:17:53 +0000 Subject: [New-bugs-announce] [issue30229] Closing a BufferedRandom calls lseek() mutliple times Message-ID: <1493727473.11.0.059505577548.issue30229@psf.upfronthosting.co.za> New submission from STINNER Victor: Given the following snippet: with open("x", "w+", encoding="utf-8") as fp: pass Creating the TextIOWrapper object requires many syscall: see the issue #30228. But I also noticed that *closing* such object also requires multiple lseek() syscalls, whereas the snippet doesn't read nor write anything. Attached PR avoids lseek() if read and write buffers are empty. ---------- components: IO messages: 292749 nosy: haypo, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: Closing a BufferedRandom calls lseek() mutliple times type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 10:30:45 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 02 May 2017 14:30:45 +0000 Subject: [New-bugs-announce] [issue30230] Move quick test in PyObject_IsSubClass outside if PyType_CheckExact guard Message-ID: <1493735445.03.0.987403403044.issue30230@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Currently the first lines in PyObject_IsSubClass are: /* We know what type's __subclasscheck__ does. */ if (PyType_CheckExact(cls)) { /* Quick test for an exact match */ if (derived == cls) return 1; return recursive_issubclass(derived, cls); } The if (derived == cls) runs only if PyType_CheckExact is True which doesn't hold for any classes with a custom metaclass. As a result, a check of the form issubclass(Sequence, Sequence) will take a slow path that invokes __subclasscheck__. I'm not sure if this was placed inside there due to some wild edge-case, though. PyObject_IsInstance uses the same trick and does so outside the if (PyType_CheckExact(cls)) check. I'll gladly submit a PR if this indeed needs fixing and not by design. ---------- components: Interpreter Core messages: 292764 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Move quick test in PyObject_IsSubClass outside if PyType_CheckExact guard type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 10:44:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 14:44:44 +0000 Subject: [New-bugs-announce] [issue30231] test_imaplib needs a TLS server accepting self-signed certificates Message-ID: <1493736284.13.0.622029485806.issue30231@psf.upfronthosting.co.za> New submission from STINNER Victor: The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept TLS connection using our self-signed x509 certificate. The following two tests of test_imaplib were skipped by the issue #30175: * test_logincapa_with_client_certfile() of RemoteIMAP_SSLTest * test_logincapa_with_client_ssl_context() of RemoteIMAP_SSLTest We should either remove these tests or spawn an IMAP server which accepts such certificate on pythontest.net. @Benjamin: Is there someone available to build such IMAP server on pythontest.net? Or do you suggest to just remove the 2 unit tests? ---------- components: Tests messages: 292768 nosy: benjamin.peterson, dstufft, gregory.p.smith, haypo, pitrou priority: normal severity: normal status: open title: test_imaplib needs a TLS server accepting self-signed certificates versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 11:04:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 15:04:23 +0000 Subject: [New-bugs-announce] [issue30232] configure: support Git worktree Message-ID: <1493737463.82.0.0521929731539.issue30232@psf.upfronthosting.co.za> New submission from STINNER Victor: configure.ac tests if .git/HEAD file exists to decide if it should get the git version / tag / branch. I use git worktree to get 2.7, 3.5, 3.6 and master in their own directory. When using git worktree, ".git" is a text file with a content like: haypo at selma$ cat ~/prog/python/2.7/.git gitdir: /home/haypo/prog/python/master/.git/worktrees/2.7 Git supports such file, but configure.ac doesn't to Git in that case. Attached PR fixes configure.ac to support Git worktree. ---------- components: Build messages: 292774 nosy: brett.cannon, haypo, ncoghlan priority: normal severity: normal status: open title: configure: support Git worktree versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 12:21:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 May 2017 16:21:24 +0000 Subject: [New-bugs-announce] [issue30233] [3.5] Warning -- locale was modified by test_idle Message-ID: <1493742084.38.0.422431531448.issue30233@psf.upfronthosting.co.za> New submission from STINNER Victor: Importing idlelib.IOBinding modifies the LC_CTYPE locale. For example, this module is imported by idlelib.EditorWindow which is imported by idlelib.idle_test.test_formatparagraph. As a consequence, running test_idle changes locales and the following warning is logged: [3.5] Warning -- locale was modified by test_idle http://buildbot.python.org/all/builders/AMD64%20Windows10%203.5/builds/224/steps/test/logs/warnings%20%281%29 I didn't check yet why I only see this warning on 3.5 buildbots. ---------- assignee: terry.reedy components: IDLE, Tests, Windows messages: 292783 nosy: haypo, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: [3.5] Warning -- locale was modified by test_idle versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 12:30:17 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 02 May 2017 16:30:17 +0000 Subject: [New-bugs-announce] [issue30234] Remove duplicate checks in test_isinstance Message-ID: <1493742617.78.0.160398205628.issue30234@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: The test file duplicates some isinstance and issubclass checks due to the distinction of classes in Python 2. Proposed PR removes duplicate asserts. ---------- components: Tests messages: 292784 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Remove duplicate checks in test_isinstance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 13:12:39 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 May 2017 17:12:39 +0000 Subject: [New-bugs-announce] [issue30235] Validate shutil supports path-like objects, update docs accordingly Message-ID: <1493745159.76.0.694023923588.issue30235@psf.upfronthosting.co.za> New submission from Brett Cannon: If you look at the docs for shutil (https://docs.python.org/3/library/shutil.html), you will notice all over it says things like "path names given as strings". The question is whether that statement is true in the face of path-like objects? If it is true then the corresponding function in shutil should be updated to accept path-like objects. If it's false then the docs for the function should be updated. This is a meta-issue to track working on the overall module (IOW separate PRs to fix things piecemeal is fine). Looks like the following functions need checking/updating: - copyfile - copymode - copystat - copy - copy2 - copytree - rmtree - move - disk_usage - chown - make_archive [ unpack_archive is covered by https://github.com/python/cpython/pull/1367] ---------- components: Library (Lib) messages: 292788 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Validate shutil supports path-like objects, update docs accordingly type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 13:19:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 02 May 2017 17:19:43 +0000 Subject: [New-bugs-announce] [issue30236] Add options --match and --failfast for test.regrtest in 2.7 Message-ID: <1493745583.13.0.200085000126.issue30236@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds options -m/--match and -G/--failfast for test.regrtest in 2.7. They are two the most wanted by me features absent in 2.7. I use them when add new test in long running test file. Often this needs running the test multiple times, incrementally changing the test or code until the test cover all cases and successful. Waiting running other tests in the same file is just waste of time. Other cases -- fast running tests related to some feature in different files. For example -m '*ickl*' allows to run all pickle-related tests. The code is backported from 3.3. This is the last version using getopt and the most compatible with 2.7. There was several major rewriting of regrtest in following versions. ---------- components: Tests messages: 292790 nosy: ezio.melotti, haypo, ncoghlan, serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Add options --match and --failfast for test.regrtest in 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 13:46:07 2017 From: report at bugs.python.org (Eryk Sun) Date: Tue, 02 May 2017 17:46:07 +0000 Subject: [New-bugs-announce] [issue30237] Access violation due to CancelSynchronousIo of console read Message-ID: <1493747167.63.0.66545140377.issue30237@psf.upfronthosting.co.za> New submission from Eryk Sun: When ReadConsole is canceled by CancelSynchronousIo [1], for some reason the call still succeeds. It's probably related to the hack that maps STATUS_ALERTED to ERROR_OPERATION_ABORTED when a console read is interrupted by Ctrl+C. The problem is that, when canceled, ReadConsole doesn't update the value of lpNumberOfCharsRead. Thus in read_console_w in Modules/_io/winconsoleio.c, the value of `n` is a random number that gets added to `readlen`, which is subsequently used to index into `buf`. The problem is the same for `n_read` in _PyOS_WindowsConsoleReadline. For example, in 3.6: import sys, ctypes, threading kernel32 = ctypes.WinDLL('kernel32') hMain = kernel32.OpenThread(1, 0, kernel32.GetCurrentThreadId()) t = threading.Timer(30, kernel32.CancelSynchronousIo, (hMain,)) t.start() sys.stdin.readline() Breakpoint 0 hit KERNELBASE!ReadConsoleW: 00007ffc`fb558200 4053 push rbx 0:000> pt KERNELBASE!GetImmersiveColorTypeFromName+0x49d2: 00007ffc`fb5d2672 c3 ret 0:000> r rax rax=0000000000000001 0:000> ?? @$teb->LastErrorValue == 995 bool true 0:000> gu python36!read_console_w+0x8b: 00000000`6e43a483 85c0 test eax,eax 0:000> ?? n unsigned long 0xefdc39e8 0:000> g (1154.11fc): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. python36!read_console_w+0x11f: 00000000`6e43a517 66833a0a cmp word ptr [rdx],0Ah ds:000001e8`cfb72c7e=???? If the value of `n` is initialized to (DWORD)-1, then checking for a failed or canceled call could be implemented as follows: if (!res || (n == (DWORD)-1 && GetLastError() == ERROR_OPERATION_ABORTED)) { err = GetLastError(); break; } [1]: https://msdn.microsoft.com/en-us/library/ms684958 ---------- components: IO, Windows keywords: easy (C) messages: 292791 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: Access violation due to CancelSynchronousIo of console read type: crash versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 15:31:56 2017 From: report at bugs.python.org (Daniel Lenski) Date: Tue, 02 May 2017 19:31:56 +0000 Subject: [New-bugs-announce] [issue30238] 2to3 doesn't detect or fix Exception indexing Message-ID: <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za> New submission from Daniel Lenski: Python 2.7 allows indexing an Exception object to access its args list. >>> e=Exception('foo','bar','baz') >>> assert e[0] is e.args[0] This doesn't work in 3.5: >>> e=Exception('foo','bar','baz') >>> e.args[0] 'foo' >>> e[0] TypeError: 'Exception' object is not subscriptable This conversion (e[x] -> e.args[x]) seems like it ought to be fairly straightforward to support in 2to3. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 292799 nosy: dlenski priority: normal severity: normal status: open title: 2to3 doesn't detect or fix Exception indexing type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 20:07:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 00:07:31 +0000 Subject: [New-bugs-announce] [issue30239] test_asyncore: test_handle_expt() fails on macOS Sierra Message-ID: <1493770051.35.0.665308404943.issue30239@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86-64%20Sierra%203.5/builds/39/steps/test/logs/stdio ====================================================================== FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv4Poll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.5.billenstein-sierra/build/Lib/test/test_asyncore.py", line 671, in test_handle_expt self.loop_waiting_for_flag(client) File "/Users/buildbot/buildarea/3.5.billenstein-sierra/build/Lib/test/test_asyncore.py", line 511, in loop_waiting_for_flag self.fail("flag not set") AssertionError: flag not set ====================================================================== FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv6Poll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.5.billenstein-sierra/build/Lib/test/test_asyncore.py", line 671, in test_handle_expt self.loop_waiting_for_flag(client) File "/Users/buildbot/buildarea/3.5.billenstein-sierra/build/Lib/test/test_asyncore.py", line 511, in loop_waiting_for_flag self.fail("flag not set") AssertionError: flag not set ---------- components: Tests, macOS messages: 292824 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: test_asyncore: test_handle_expt() fails on macOS Sierra versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 2 22:49:51 2017 From: report at bugs.python.org (TaoQingyun) Date: Wed, 03 May 2017 02:49:51 +0000 Subject: [New-bugs-announce] [issue30240] Add daemon keyword argument to Thread constructor Message-ID: <1493779791.43.0.580672547649.issue30240@psf.upfronthosting.co.za> New submission from TaoQingyun: create a daemon thread like this, ``` t = Thread(target=f) t.daemon = True t.start() ``` I wonder the following code is better ``` Thread(target=f, daemon=True).start() ``` ---------- components: Library (Lib) messages: 292832 nosy: qingyunha priority: normal severity: normal status: open title: Add daemon keyword argument to Thread constructor type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 00:12:21 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 03 May 2017 04:12:21 +0000 Subject: [New-bugs-announce] [issue30241] Add contextlib.AbstractAsyncContextManager Message-ID: <1493784741.35.0.949796244558.issue30241@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: It would be useful to have an abstract base class for asynchronous context managers, similar to the existing contextlib.AbstractContextManager. We can then also add this class to typing and use it as a PEP 544 Protocol. I have code ready for contextlib.AbstractAsyncContextManager and will submit the PR shortly. I'll also add support in typing and typeshed if the CPython change is accepted. ---------- components: Library (Lib) messages: 292835 nosy: Jelle Zijlstra, levkivskyi, ncoghlan, yselivanov priority: normal severity: normal status: open title: Add contextlib.AbstractAsyncContextManager type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 00:30:53 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 03 May 2017 04:30:53 +0000 Subject: [New-bugs-announce] [issue30242] resolve undefined behaviour in struct Message-ID: <1493785853.95.0.0519827037008.issue30242@psf.upfronthosting.co.za> New submission from Xiang Zhang: In struct there are several places using code like: p[--i] = (char)x; to extract the least significant byte from a long. Although this behaviour seems to apply to common implementations but it does not conform to C standard. ---------- components: Library (Lib) messages: 292836 nosy: mark.dickinson, meador.inge, serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: resolve undefined behaviour in struct type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 02:41:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 May 2017 06:41:50 +0000 Subject: [New-bugs-announce] [issue30243] Core dump when use uninitialized _json objects Message-ID: <1493793710.25.0.994343860918.issue30243@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: It is possible to get a core dump by using uninitialized _json objects. $ ./python -c "import _json; _json.make_scanner.__new__(_json.make_scanner)('', 0)" Segmentation fault (core dumped) $ ./python -c "import _json; _json.make_encoder.__new__(_json.make_encoder)([0], 0)" Segmentation fault (core dumped) The cause is that make_scanner and make_encoder classes implement __new__ and __init__. The __new__ methods create uninitialized object, with NULLs pointers, the __init__ methods initialize them. Possible solutions are: 1) set fields to Py_None rather than NULL in __new__; 2) check every pointer for NULL before using; 3) just remove __init__ methods and make initialization in __new__ methods. Since the scanner and the encoder are not inheritable classes, the latter solution look the most preferable to me. ---------- components: Extension Modules messages: 292846 nosy: bob.ippolito, ezio.melotti, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: Core dump when use uninitialized _json objects type: crash versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 03:18:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 07:18:07 +0000 Subject: [New-bugs-announce] [issue30244] Emit a ResourceWarning in concurrent.futures executor destructors Message-ID: <1493795887.73.0.860969778348.issue30244@psf.upfronthosting.co.za> New submission from STINNER Victor: Follow-up of issues: * issue #30110: test_asyncio reports reference leak, forgot to shutdown concurrent.futures.ProcessPoolExecutor() * issue #30171: Emit ResourceWarning in multiprocessing Queue destructor I propose to emit a ResourceWarning warning in concurrent.futures executor destructor if it wasn't cleaned up properly, if shutdown() wasn't called. ---------- components: Library (Lib) messages: 292849 nosy: haypo, xiang.zhang priority: normal severity: normal status: open title: Emit a ResourceWarning in concurrent.futures executor destructors type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 03:20:40 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 03 May 2017 07:20:40 +0000 Subject: [New-bugs-announce] [issue30245] possible overflow when organize struct.pack_into error message Message-ID: <1493796040.21.0.423115670823.issue30245@psf.upfronthosting.co.za> New submission from Xiang Zhang: In #29649, struct.pack_into's error message was improved. But the message could be confusing encountering a large offset due to overflow: >>> struct.pack_into('I', bytearray(10), sys.maxsize, 1) Traceback (most recent call last): File "", line 1, in struct.error: pack_into requires a buffer of at least -9223372036854775805 bytes for packing 4 bytes at offset 9223372036854775807 (actual buffer size is 10) BTW, really long the error message. ---------- messages: 292852 nosy: andrewnester, louielu, serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: needs patch status: open title: possible overflow when organize struct.pack_into error message type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 03:37:18 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 03 May 2017 07:37:18 +0000 Subject: [New-bugs-announce] [issue30246] fix several error messages in struct Message-ID: <1493797038.59.0.865593067467.issue30246@psf.upfronthosting.co.za> New submission from Xiang Zhang: There are several error messages only mention bytes. But they may also accept string or other bytes-like objects. ---------- components: Library (Lib) messages: 292854 nosy: xiang.zhang priority: normal severity: normal stage: patch review status: open title: fix several error messages in struct type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 03:42:38 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 03 May 2017 07:42:38 +0000 Subject: [New-bugs-announce] [issue30247] Make importlib.machinery class handle os.PathLike path Message-ID: <1493797358.8.0.753635690258.issue30247@psf.upfronthosting.co.za> New submission from Louie Lu: Several importlib.machinery class has 'path' attribute, make it possible to handle os.PathLike. ---------- messages: 292856 nosy: louielu priority: normal severity: normal status: open title: Make importlib.machinery class handle os.PathLike path versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 04:38:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 May 2017 08:38:15 +0000 Subject: [New-bugs-announce] [issue30248] Using boolean arguments in the _json module Message-ID: <1493800695.72.0.112994453765.issue30248@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently PyObject_IsTrue() is called every time when bool attributes (_json.Scanner.strict, _json.Encoder.sort_keys, _json.Encoder.skipkeys) are used in C acceleration of the json module. PyObject_IsTrue() is fast when the argument is a bool, but in any case this isn't efficient and is cumbersome. It is better to convert Python bool to C boolean value only once when create an object, as already is done for _json.Encoder.allow_nan and for most other boolean values in extension modules. Proposed patch simplifies and optimizes the code by making arguments strict, sort_keys and skipkeys be converted only once at argument parsing time. The patch changes behavior in the case when the boolean value of the argument is not constant. But this is very bad practice, we may ignore this obscure case (as ignore the case when the boolean value of the container doesn't consistent with its content, see issue27613). ---------- components: Extension Modules messages: 292861 nosy: bob.ippolito, ezio.melotti, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Using boolean arguments in the _json module type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 04:55:20 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 03 May 2017 08:55:20 +0000 Subject: [New-bugs-announce] [issue30249] improve struct.unpack_from's error message like struct.pack_into Message-ID: <1493801720.08.0.647129145601.issue30249@psf.upfronthosting.co.za> New submission from Xiang Zhang: In #29649, the error message of struct.pack_into was improved. Since pack_into was changed, I think it's also worth improving unpack_from. ---------- components: Library (Lib) messages: 292862 nosy: xiang.zhang priority: normal severity: normal stage: needs patch status: open title: improve struct.unpack_from's error message like struct.pack_into type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 05:21:26 2017 From: report at bugs.python.org (Albert Zeyer) Date: Wed, 03 May 2017 09:21:26 +0000 Subject: [New-bugs-announce] [issue30250] StreamIO truncate behavior of current position Message-ID: <1493803286.93.0.729183089652.issue30250@psf.upfronthosting.co.za> New submission from Albert Zeyer: The doc says that StringIO.truncate should not change the current position. Consider this code: try: import StringIO except ImportError: import io as StringIO buf = StringIO.StringIO() assert_equal(buf.getvalue(), "") print("buf: %r" % buf.getvalue()) buf.write("hello") print("buf: %r" % buf.getvalue()) assert_equal(buf.getvalue(), "hello") buf.truncate(0) print("buf: %r" % buf.getvalue()) assert_equal(buf.getvalue(), "") buf.write("hello") print("buf: %r" % buf.getvalue()) assert_equal(buf.getvalue(), "\x00\x00\x00\x00\x00hello") buf.truncate(0) print("buf: %r" % buf.getvalue()) assert_equal(buf.getvalue(), "") On Python 3.6, I get the output: buf: '' buf: 'hello' buf: '' buf: '\x00\x00\x00\x00\x00hello' On Python 2.7, I get the output: buf: '' buf: 'hello' buf: '' buf: 'hello' Thus it seems that Python 2.7 StringIO.truncate does actually resets the position for this case or there is some other bug in Python 2.7. At least from the doc, it seems that the Python 3.6 behavior is the expected behavior. ---------- components: IO messages: 292866 nosy: Albert.Zeyer priority: normal severity: normal status: open title: StreamIO truncate behavior of current position versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 05:55:08 2017 From: report at bugs.python.org (Stephen Kelly) Date: Wed, 03 May 2017 09:55:08 +0000 Subject: [New-bugs-announce] [issue30251] Windows Visual Studio solution does not have an install target Message-ID: <1493805308.24.0.584899845977.issue30251@psf.upfronthosting.co.za> New submission from Stephen Kelly: The Windows Visual Studio solution does not have an install target. As far as I understand, the configure system used on Unix does have an install target. That means that on Windows, binaries resulting from the build to not end up in the same layout as result from using the official installer. Third party modules expect the same layout. For example, Sip/PyQt requires it https://www.riverbankcomputing.com/pipermail/pyqt/2017-April/039109.html . There are probably other modules similarly affected. I don't know what else an install target should do, but I note its absence. ---------- components: Build messages: 292872 nosy: steveire priority: normal severity: normal status: open title: Windows Visual Studio solution does not have an install target versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 06:01:31 2017 From: report at bugs.python.org (Stephen Kelly) Date: Wed, 03 May 2017 10:01:31 +0000 Subject: [New-bugs-announce] [issue30252] Configuration system does not work for Windows/Visual Studio Message-ID: <1493805691.1.0.682843236937.issue30252@psf.upfronthosting.co.za> New submission from Stephen Kelly: As far as I know, there is a configuration system for python based on the configure script. Python can be configured with --without-threads to disable threading support. There is no equivalent system for Windows/Visual Studio. This makes it harder to build python with configurations. ---------- components: Build messages: 292874 nosy: steveire priority: normal severity: normal status: open title: Configuration system does not work for Windows/Visual Studio versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 06:10:00 2017 From: report at bugs.python.org (Stephen Kelly) Date: Wed, 03 May 2017 10:10:00 +0000 Subject: [New-bugs-announce] [issue30253] Python does not build without WITH_THREADS defined on Windows/Visual Studio Message-ID: <1493806200.91.0.0331403501702.issue30253@psf.upfronthosting.co.za> New submission from Stephen Kelly: As there is no configuration system for python on Windows (issue30252) I tried to change pyconfig.h to comment out some lines: // #define NT_THREADS // #define WITH_THREAD After building, I had to additionally patch * threadmodule.c and thread.c to exclude all content (I don't know if there is a way to exclude the file entirely with the Python build system - there should be something like that as part of a configure system). * Wrap uses of PyThread_get_thread_ident() in ifdefs in timemodule.c. This is surprising because I would expect it to not compile on any platform without the ifdefs. ---------- components: Build messages: 292879 nosy: steveire priority: normal severity: normal status: open title: Python does not build without WITH_THREADS defined on Windows/Visual Studio versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 06:44:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 10:44:11 +0000 Subject: [New-bugs-announce] [issue30254] [2.7] regrtest announces 401 tests, but there are 304 tests? Message-ID: <1493808251.58.0.466858427103.issue30254@psf.upfronthosting.co.za> New submission from STINNER Victor: First case: --- ... [301/401] test_with [302/401] test_import [303/401] test_xmlrpc 277 tests OK. 2 tests altered the execution environment: test_distutils test_sax 24 tests skipped: test_al test_bsddb185 test_cl test_commands test_curses test_dbm test_dl test_fork1 test_grp test_ioctl test_kqueue test_macos test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pwd test_readline test_scriptpackages test_spwd test_threadsignals test_wait3 test_wait4 1 skip unexpected on win32: test_readline --- http://buildbot.python.org/all/builders/AMD64%20Windows10%202.7/builds/133/steps/test/logs/stdio Why does regrtest count 404 tests, whereas the total is 304 tests (277+2+24+1)? Second case: --- ... [212/401] test_extcall [213/401] test_frozen [214/401] test_hotshot 190 tests OK. 2 tests altered the execution environment: test_distutils test_sax 22 tests skipped: test_al test_applesingle test_bsddb185 test_crypt test_curses test_dbm test_dl test_fcntl test_fork1 test_gdb test_gl test_mhlib test_nis test_openpty test_ossaudiodev test_pipes test_poll test_pwd test_resource test_scriptpackages test_threadsignals test_wait4 1 skip unexpected on win32: test_gdb --- http://buildbot.python.org/all/builders/AMD64%20Windows8%202.7/builds/128/steps/test/logs/stdio Here I only count 215 tests (190+2+22+1)... why not 304 or 401? where are the remaining tests? On Linux, it seems fine: --- ... [399/401] test_sets [400/401] test_bufio [401/401] test_xpickle 371 tests OK. 30 tests skipped: test_aepack test_al test_applesingle test_bsddb test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_gdb test_gl test_imgfile test_kqueue test_macos test_macostools test_msilib test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tk test_tools test_ttk_guionly test_winreg test_winsound test_zipfile64 9 skips unexpected on linux2: test_bsddb test_bsddb3 test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_gdb test_tools --- http://buildbot.python.org/all/builders/x86%20Gentoo%20Installed%20with%20X%202.7/builds/129/steps/test/logs/stdio I also expects regrtest to ends with "[401/401]" on Windows. ---------- components: Tests, Windows keywords: buildbot messages: 292886 nosy: haypo, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [2.7] regrtest announces 401 tests, but there are 304 tests? versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 07:06:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 11:06:38 +0000 Subject: [New-bugs-announce] [issue30255] test_xml_etree: python: Objects/sliceobject.c:176: _PySlice_AdjustIndices: Assertion `step >= -PY_SSIZE_T_MAX' failed. Message-ID: <1493809598.71.0.198656807245.issue30255@psf.upfronthosting.co.za> New submission from STINNER Victor: ./python -m test -v test_xml_etree ... test_getslice_negative_steps (test.test_xml_etree.ElementSlicingTest) ... python: Objects/sliceobject.c:176: _PySlice_AdjustIndices: Assertion `step >= -PY_SSIZE_T_MAX' failed. ... Traceback (most recent call first): File "/home/haypo/prog/python/2.7/Lib/xml/etree/ElementTree.py", line 266, in __getitem__ return self._children[index] File "/home/haypo/prog/python/2.7/Lib/test/test_xml_etree.py", line 2305, in test_getslice_negative_steps self.assertEqual(self._elem_tags(e[3::-sys.maxsize-1]), ['a3']) See issues: bpo-30074, bpo-27867. ---------- components: Interpreter Core messages: 292888 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: test_xml_etree: python: Objects/sliceobject.c:176: _PySlice_AdjustIndices: Assertion `step >= -PY_SSIZE_T_MAX' failed. type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 07:53:34 2017 From: report at bugs.python.org (Jeff DuMonthier) Date: Wed, 03 May 2017 11:53:34 +0000 Subject: [New-bugs-announce] [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception Message-ID: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> New submission from Jeff DuMonthier: In multiprocessing, attempting to add a Queue proxy to a dict or Namespace proxy (all returned by the same SyncManager) raises an exception indicating a keyword argument 'manager_owned=True' has been passed to the function AutoProxy() but is not an argument of that function. In lib/python3.6/multiprocessing/managers.py, in function RebuildProxy(), line 873: "kwds['manager_owned'] = True" adds this argument to a keyword argument dictionary. This function calls AutoProxy which has an argument list defined on lines 909-910 as: def AutoProxy(token, serializer, manager=None, authkey=None, exposed=None, incref=True): This raises an exception because there is no manager_owned argument defined. I added "manager_owned=False" as a keyword argument to AutoProxy which seems to have fixed the problem. There is no exception and I am able to pass Queue proxies through dict and Namespace proxies to other processes and use them. I don't know the purpose of that argument though or if the AutoProxy function should actually use it for something. My fix allows but ignores it. ---------- components: Library (Lib) messages: 292889 nosy: jjdmon priority: normal severity: normal status: open title: Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 08:04:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 12:04:41 +0000 Subject: [New-bugs-announce] [issue30257] _bsddb: else misleadingly indented Message-ID: <1493813081.42.0.70374068517.issue30257@psf.upfronthosting.co.za> New submission from STINNER Victor: building '_bsddb' extension gcc -pthread -fPIC -fno-strict-aliasing -O0 -g -O0 -Wall -Wstrict-prototypes -I/usr/include -I. -IInclude -I./Include -I/usr/local/include -I/home/haypo/prog/python/2.7/Include -I/home/haypo/prog/python/2.7 -c /home/haypo/prog/python/2.7/Modules/_bsddb.c -o build/temp.linux-x86_64-2.7-pydebug/home/haypo/prog/python/2.7/Modules/_bsddb.o /home/haypo/prog/python/2.7/Modules/_bsddb.c: Dans la fonction ??newDBObject??: /home/haypo/prog/python/2.7/Modules/_bsddb.c:936:5: attention : this ??else?? clause does not guard... [-Wmisleading-indentation] else ^~~~ /home/haypo/prog/python/2.7/Modules/_bsddb.c:938:9: note?: ...this statement, but the latter is misleadingly indented as if it is guarded by the ??else?? self->moduleFlags.cursorSetReturnsNone = DEFAULT_CURSOR_SET_RETURNS_NONE; ^~~~ gcc -pthread -shared build/temp.linux-x86_64-2.7-pydebug/home/haypo/prog/python/2.7/Modules/_bsddb.o -L/usr/lib64 -L/usr/local/lib -Wl,-R/usr/lib64 -ldb-5.3 -o build/lib.linux-x86_64-2.7-pydebug/_bsddb.so I agree that the indentation is surprising and looks like a bug. if (self->myenvobj) self->moduleFlags = self->myenvobj->moduleFlags; else self->moduleFlags.getReturnsNone = DEFAULT_GET_RETURNS_NONE; self->moduleFlags.cursorSetReturnsNone = DEFAULT_CURSOR_SET_RETURNS_NONE; Attached PR only don't set cursorSetReturnsNone to DEFAULT_CURSOR_SET_RETURNS_NONE anymore if self->myenvobj is set. ---------- components: Extension Modules messages: 292890 nosy: haypo priority: normal severity: normal status: open title: _bsddb: else misleadingly indented versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 10:25:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 14:25:28 +0000 Subject: [New-bugs-announce] [issue30258] [2.7] regrtest: handle child process crash Message-ID: <1493821528.82.0.0272255783657.issue30258@psf.upfronthosting.co.za> New submission from STINNER Victor: In the master branch, regrtest in multiprocess mode handles well crash of child processes. In 2.7, regrtest handles them badly: see issue #30254. Attached PR backports the CHILD_ERROR status from regrtest master and adds code to handle crash (or any non-zero exit code) of the child process (a worker running an unit test). ---------- components: Tests messages: 292904 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: [2.7] regrtest: handle child process crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 12:26:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 16:26:48 +0000 Subject: [New-bugs-announce] [issue30259] Test somehow that generated files are up to date: run make regen-all Message-ID: <1493828808.63.0.88408078015.issue30259@psf.upfronthosting.co.za> New submission from STINNER Victor: bpo-23404 replaced "make touch" with "make regen-all". Generated files are no more regenerated based on file modification time anymore, the action is now explicit. Zachary Ware proposed to add a buildbot to check that generated files are up to date: run "make regen-all" and test that no file was modified. ---------- components: Tests messages: 292915 nosy: haypo, zach.ware priority: normal severity: normal status: open title: Test somehow that generated files are up to date: run make regen-all versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 12:44:02 2017 From: report at bugs.python.org (asterite) Date: Wed, 03 May 2017 16:44:02 +0000 Subject: [New-bugs-announce] [issue30260] sock_dealloc() may call __repr__ when socket class is already collected by GC Message-ID: <1493829842.08.0.612214340964.issue30260@psf.upfronthosting.co.za> New submission from asterite: I faced a crash during iterpreter shutdown (Py_Finalize), in final garbage collection phase. The reason, as far as I could understand, was the following: In Python 3, when an unclosed socket is destroyed, it issues a ResourceWarning, which contains a string representation of socket object (obtained by __repr__). If socket class object and unclosed socket object (instance) are in a reference cycle, GC may collect socket class object before it collects an instance when dealing with that cycle. Then, when instance is collected, sock_dealloc() will be called, which will call PyErr_WarnFormat with %R format specifier, which triggers a call to __repr__: static void sock_dealloc(PySocketSockObject *s) { if (s->sock_fd != INVALID_SOCKET) { // ... if (PyErr_WarnFormat(PyExc_ResourceWarning, 1, "unclosed %R", s)) //... } At this moment, socket class object was already deallocated, so was __repr__, resides in it. Particularly, in my tests, when __repr__ attempted to access a global variable (getattr), it tried to take it's name from co_names tuple in it's code object. This tuple was deallocated, and co_names pointed to tuple free list. Trying to use a tuple from free list as a dict key resulted in a crash (more detailed stack trace will be provided in attachment): # gdb python3.5 test.py GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 ... Starting program: /usr/local/bin/python3.5 test.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". test Program received signal SIGSEGV, Segmentation fault. 0x000000000048998c in PyObject_Hash (v=0x0) at Objects/object.c:761 761 PyTypeObject *tp = Py_TYPE(v); (gdb) bt #0 0x000000000048998c in PyObject_Hash (v=0x0) at Objects/object.c:761 #1 0x0000000000498d96 in tuplehash (v=0x7ffff7f39948) at Objects/tupleobject.c:351 #2 0x00000000004899b2 in PyObject_Hash (v=0x7ffff7f39948) at Objects/object.c:763 ... tuplehash and PyObject_Hash here also ... #34 0x00000000004899b2 in PyObject_Hash (v=0x7ffff6801708) at Objects/object.c:763 #35 0x0000000000498d96 in tuplehash (v=0x7ffff6812ca8) at Objects/tupleobject.c:351 #36 0x00000000004899b2 in PyObject_Hash (v=0x7ffff6812ca8) at Objects/object.c:763 #37 0x000000000047a056 in PyDict_GetItemWithError (op=0x7ffff7e83608, key=0x7ffff6812ca8) at Objects/dictobject.c:1143 #38 0x000000000047a1e8 in _PyDict_LoadGlobal (globals=0x7ffff7e83608, builtins=0x7ffff6ea8a88, key=0x7ffff6812ca8) at Objects/dictobject.c:1192 #39 0x0000000000509117 in PyEval_EvalFrameEx (f=0xa196d8, throwflag=0) at Python/ceval.c:2408 #40 0x0000000000511d0b in _PyEval_EvalCodeWithName (_co=0x7ffff7e85270, globals=0x7ffff7e83608, locals=0x0, args=0x7ffff7f07c68, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:4071 #41 0x0000000000511e00 in PyEval_EvalCodeEx (_co=0x7ffff7e85270, globals=0x7ffff7e83608, locals=0x0, args=0x7ffff7f07c68, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:4092 #42 0x00000000005db41c in function_call (func=0x7ffff683ec80, arg=0x7ffff7f07c50, kw=0x0) at Objects/funcobject.c:627 #43 0x000000000043ae8f in PyObject_Call (func=0x7ffff683ec80, arg=0x7ffff7f07c50, kw=0x0) at Objects/abstract.c:2166 #44 0x00000000005cb13c in method_call (func=0x7ffff683ec80, arg=0x7ffff7f07c50, kw=0x0) at Objects/classobject.c:330 #45 0x000000000043ae8f in PyObject_Call (func=0x7ffff7eaca48, arg=0x7ffff7fa8048, kw=0x0) at Objects/abstract.c:2166 #46 0x00000000005138a9 in PyEval_CallObjectWithKeywords (func=0x7ffff7eaca48, arg=0x7ffff7fa8048, kw=0x0) at Python/ceval.c:4633 #47 0x00000000004abf3e in slot_tp_repr (self=0x7ffff684e8d0) at Objects/typeobject.c:5992 #48 0x0000000000488ef9 in PyObject_Repr (v=0x7ffff684e8d0) at Objects/object.c:482 #49 0x00000000004c03fb in unicode_fromformat_arg (writer=0x7fffffffdeb0, f=0x7ffff6ed9850 "R", vargs=0x7fffffffdef0) at Objects/unicodeobject.c:2645 #50 0x00000000004c0754 in PyUnicode_FromFormatV (format=0x7ffff6ed9846 "unclosed %R", vargs=0x7fffffffdf60) at Objects/unicodeobject.c:2710 #51 0x00000000004f90e7 in PyErr_WarnFormat (category=0x8a1a20 <_PyExc_ResourceWarning>, stack_level=1, format=0x7ffff6ed9846 "unclosed %R") at Python/_warnings.c:895 #52 0x00007ffff6ed438a in sock_dealloc (s=0x7ffff684e8d0) at /root/test/test35/cpython/Modules/socketmodule.c:4177 #53 0x000000000049d02c in subtype_dealloc (self=0x7ffff684e8d0) at Objects/typeobject.c:1209 #54 0x00000000004781c5 in free_keys_object (keys=0xa3fd90) at Objects/dictobject.c:351 #55 0x000000000047a908 in PyDict_Clear (op=0x7ffff7f55448) at Objects/dictobject.c:1388 #56 0x000000000047df02 in dict_tp_clear (op=0x7ffff7f55448) at Objects/dictobject.c:2595 #57 0x00000000005679de in delete_garbage (collectable=0x7fffffffe2f0, old=0x8ce440 ) at Modules/gcmodule.c:866 #58 0x0000000000567e30 in collect (generation=2, n_collected=0x0, n_uncollectable=0x0, nofail=1) at Modules/gcmodule.c:1014 #59 0x0000000000568e84 in _PyGC_CollectNoFail () at Modules/gcmodule.c:1605 #60 0x0000000000532023 in PyImport_Cleanup () at Python/import.c:481 #61 0x0000000000542083 in Py_Finalize () at Python/pylifecycle.c:576 #62 0x0000000000420fdf in Py_Main (argc=2, argv=0x92d010) at Modules/main.c:798 #63 0x000000000041bc4f in main (argc=2, argv=0x7fffffffe748) at ./Programs/python.c:65 (gdb) So this is something like a use-after-free. I think the root cause is that finalizer that can call some python code is called at deallocation phase, interleaving with object's deletion. As well as with objects with __del__ method, GC can't know the order in which objects should be deleted if they are in a reference cycle. This problem does not exist in 3.6 because there is a separate finalizing method sock_finalize there where a ResourceWarning is issued, and such finalizers are called for the whole reference cycle before any object in it is deallocated (at least this is how I understood, correct me if I'm wrong). So, this change with finalizers probably should be backported to previous versions of Python 3. I also could not reproduce this in 3.3, but I didn't have time to research that closely yet. ---------- components: Interpreter Core, Library (Lib) files: trace-verbose.txt messages: 292924 nosy: asterite priority: normal severity: normal status: open title: sock_dealloc() may call __repr__ when socket class is already collected by GC type: crash versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file46846/trace-verbose.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 14:44:08 2017 From: report at bugs.python.org (saumitra paul) Date: Wed, 03 May 2017 18:44:08 +0000 Subject: [New-bugs-announce] [issue30261] saumitra paul choudhury has shared a document on Google Docs with you Message-ID: New submission from saumitra paul: saumitra paul choudhury has invited you to view the following document: Open in Docs ---------- messages: 292931 nosy: saumitra1978 priority: normal severity: normal status: open title: saumitra paul choudhury has shared a document on Google Docs with you _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 15:52:10 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Wed, 03 May 2017 19:52:10 +0000 Subject: [New-bugs-announce] [issue30262] Don't expose sqlite3 Cache and Statement Message-ID: <1493841130.42.0.625787216583.issue30262@psf.upfronthosting.co.za> New submission from Aviv Palivoda: Both the Cache and Statement objects are internally used and should not be exposed to the user from the sqlite3 module. They are not mentioned in the documentation as well. ---------- components: Extension Modules messages: 292936 nosy: berker.peksag, ghaering, palaviv priority: normal severity: normal status: open title: Don't expose sqlite3 Cache and Statement type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 19:09:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 23:09:31 +0000 Subject: [New-bugs-announce] [issue30263] regrtest: log the system load? Message-ID: <1493852971.75.0.704908002937.issue30263@psf.upfronthosting.co.za> New submission from STINNER Victor: It's more and more common to get test failures only on a small group of buildbots, or even a single buildbot. In many cases, it's a race condition which depends on the system load. The system load depends on how many tests are running in parallel, if the buildbot slave allows multiple builds in parallel, etc. Sometimes, the failing test pass when it's run sequentially at the end of regrtest, sometimes it fails again. I propose to add the system load after the timestamp to ease debug. Example of output on a patched regrtest when tests are run sequentially: 0:19:37 load: 1.28 [304/405/1] test_sunau 0:19:37 load: 1.28 [305/405/1] test_ctypes ... 0:20:02 load: 1.86 [309/405/1] test__osx_support -- test_socketserver skipped (resource denied) ... 0:20:09 load: 1.79 [314/405/1] test_int_literal 0:20:09 load: 1.79 [315/405/1] test_queue 0:20:13 load: 1.73 [316/405/1] test_fork1 0:20:20 load: 1.67 [317/405/1] test_atexit ... 0:22:09 load: 1.16 [346/405/1] test_sys_setprofile 0:22:09 load: 1.16 [347/405/1] test_selectors 0:22:24 load: 0.98 [348/405/1] test_bufio 0:22:25 load: 0.98 [349/405/1] test_string_literals ---------- components: Tests messages: 292944 nosy: haypo priority: normal severity: normal status: open title: regrtest: log the system load? type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 19:50:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 03 May 2017 23:50:04 +0000 Subject: [New-bugs-announce] [issue30264] [Windows] test_sax: Warning -- files was modified by test_sax Message-ID: <1493855404.54.0.178478037782.issue30264@psf.upfronthosting.co.za> New submission from STINNER Victor: Running test_sax of Python 2.7 on Windows emits the following warning: Warning -- files was modified by test_sax The problem is that os.unlink(TESTFN) ignores all OSError: os.unlink(TESTFN) fails because there is still an open file object somewhere. The bug is in the test_parse_bytes() of test_sax, on check_parse(TESTFN) which raises an exception as expected. xml.sax.parse() should close the parser on exception. On master, test_sax explicitly expects a ResourceWarning, WTF? with support.check_warnings(('unclosed file', ResourceWarning)): # XXX Failed parser leaks an opened file. with self.assertRaises(SAXException): self.check_parse(TESTFN) # Collect leaked file. gc.collect() See also issue #15388. ---------- components: Tests, XML messages: 292946 nosy: haypo priority: normal severity: normal status: open title: [Windows] test_sax: Warning -- files was modified by test_sax versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 20:03:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 04 May 2017 00:03:15 +0000 Subject: [New-bugs-announce] [issue30265] test.support.unlink() should fail or emit a warning on WindowsError: [Error 32] The process cannot access the file ... Message-ID: <1493856195.4.0.0572132111963.issue30265@psf.upfronthosting.co.za> New submission from STINNER Victor: While working on issue #30264, I noticed that test.support.unlink() ignores *all* OSError exceptions. I suggest to add handle WindowsError: [Error 32] differently. Example of such error, issue #15388: WindowsError: [Error 32] The process cannot access the file because it is being used by another process: I suggest to either raise an exception (passthrough the original OSError), or emit/log a warning. ---------- components: Tests, Windows messages: 292949 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test.support.unlink() should fail or emit a warning on WindowsError: [Error 32] The process cannot access the file ... type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 3 23:37:32 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 04 May 2017 03:37:32 +0000 Subject: [New-bugs-announce] [issue30266] AbstractContextManager should support __method__ = None Message-ID: <1493869052.62.0.588224367521.issue30266@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: Like other ABCs, contextlib.AbstractContextManager should support the pattern where setting a method to None disables structural subtyping, which was introduced across the standard library in issue 25958. Ivan Levkivskyi suggested making AbstractContextManager support this pattern in CR comments in https://github.com/python/cpython/pull/1412/files#r114482765. Should this change be applied to 3.6 as well as master? I'm leaning towards yes, because the resolution to issue 25958 (https://hg.python.org/cpython/rev/72b9f195569c) added a general statement in the documentation that "Setting a special method to ``None`` indicates that the corresponding operation is not available". Thus, the fact that contextlib.AbstractContextManager doesn't obey this rule is a bug. I'll send a PR shortly. ---------- components: Library (Lib) messages: 292955 nosy: Jelle Zijlstra, levkivskyi, ncoghlan, yselivanov priority: normal severity: normal status: open title: AbstractContextManager should support __method__ = None versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 12:02:33 2017 From: report at bugs.python.org (ProgVal) Date: Thu, 04 May 2017 16:02:33 +0000 Subject: [New-bugs-announce] [issue30267] Deprecate os.path.commonprefix Message-ID: <1493913753.36.0.555235038331.issue30267@psf.upfronthosting.co.za> New submission from ProgVal: The function os.path.commonprefix computes the longest prefix of strings (any iterable, actually), regardless of their meaning as paths. I do not see any reason to use this function for paths, and keeping it in the os.path module makes it prone to be confused with os.path.commonpath (which was introduced in Python 3.5). I believe making this function raise a DeprecationWarning would help avoid having this kind of bugs. ---------- components: Library (Lib) messages: 292993 nosy: Valentin.Lorentz priority: normal severity: normal status: open title: Deprecate os.path.commonprefix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 12:08:06 2017 From: report at bugs.python.org (ProgVal) Date: Thu, 04 May 2017 16:08:06 +0000 Subject: [New-bugs-announce] [issue30268] Make mimetypes.guess_type accept path-like objects Message-ID: <1493914086.8.0.9964529869.issue30268@psf.upfronthosting.co.za> New submission from ProgVal: The documentation for mimetypes.guess_type says that it ?guesses the type of a file based on its filename or URL?. However, this function only accepts a string object, and not a bytes object: >>> import os >>> import mimetypes >>> mimetypes.guess_type(os.listdir(os.fsencode('./'))[0]) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.7/mimetypes.py", line 291, in guess_type return _db.guess_type(url, strict) File "/usr/lib/python3.7/mimetypes.py", line 116, in guess_type scheme, url = urllib.parse.splittype(url) File "/usr/lib/python3.7/urllib/parse.py", line 924, in splittype match = _typeprog.match(url) TypeError: cannot use a string pattern on a bytes-like object ---------- components: Library (Lib) messages: 292995 nosy: Valentin.Lorentz priority: normal severity: normal status: open title: Make mimetypes.guess_type accept path-like objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 13:19:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 04 May 2017 17:19:01 +0000 Subject: [New-bugs-announce] [issue30269] [2.7] test_release_task_refs() of test_multiprocessing.py is unstable Message-ID: <1493918341.49.0.687778990456.issue30269@psf.upfronthosting.co.za> New submission from STINNER Victor: [2.7] test_release_task_refs() of test_multiprocessing.py fails randomly. Example: http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%202.7/builds/136/steps/test/logs/stdio [116/401/1] test_multiprocessing [77069 refs] test test_multiprocessing failed -- Traceback (most recent call last): File "/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Lib/test/test_multiprocessing.py", line 1293, in test_release_task_refs self.assertEqual(set(wr() for wr in refs), {None}) AssertionError: Items in the first set but not the second: Items in the second set but not the first: None (...) Re-running test 'test_multiprocessing' in verbose mode (...) Ran 167 tests in 20.640s OK (skipped=12) ---------- components: Tests messages: 293003 nosy: haypo priority: normal severity: normal status: open title: [2.7] test_release_task_refs() of test_multiprocessing.py is unstable versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 14:49:54 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 04 May 2017 18:49:54 +0000 Subject: [New-bugs-announce] [issue30270] Remove sqlite3.Cache display method Message-ID: <1493923794.77.0.260659079397.issue30270@psf.upfronthosting.co.za> New submission from Aviv Palivoda: The display method is there for debugging and should not be in the released code. ---------- components: Extension Modules messages: 293005 nosy: berker.peksag, ghaering, palaviv priority: normal severity: normal status: open title: Remove sqlite3.Cache display method type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 15:03:50 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 04 May 2017 19:03:50 +0000 Subject: [New-bugs-announce] [issue30271] Make sqlite3 statement cache optional Message-ID: <1493924630.07.0.362744800273.issue30271@psf.upfronthosting.co.za> New submission from Aviv Palivoda: Currently the minimum size of the statement cache is 10. I suggest that it will be any value above 1 or no cache at all if the size is set to 0. ---------- components: Extension Modules messages: 293006 nosy: berker.peksag, ghaering, palaviv priority: normal severity: normal status: open title: Make sqlite3 statement cache optional type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 15:54:49 2017 From: report at bugs.python.org (Oliver Smith) Date: Thu, 04 May 2017 19:54:49 +0000 Subject: [New-bugs-announce] [issue30272] distutils.version.LooseVersion's compare raises exception in corner-case Message-ID: <1493927689.09.0.0396614156141.issue30272@psf.upfronthosting.co.za> New submission from Oliver Smith: This should return True and not raise an exception: >>> from distutils.version import LooseVersion >>> LooseVersion("22.7-r1") < LooseVersion("22.7.3-r1") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/distutils/version.py", line 52, in __lt__ c = self._cmp(other) File "/usr/lib/python3.6/distutils/version.py", line 337, in _cmp if self.version < other.version: TypeError: '<' not supported between instances of 'str' and 'int' >>> Tested with Python 3.6.1. ---------- messages: 293009 nosy: ollieparanoid2 priority: normal severity: normal status: open title: distutils.version.LooseVersion's compare raises exception in corner-case versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 16:51:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 04 May 2017 20:51:05 +0000 Subject: [New-bugs-announce] [issue30273] The coverage job is broken: distutils build_ext fails on None Message-ID: <1493931065.16.0.071760952021.issue30273@psf.upfronthosting.co.za> New submission from STINNER Victor: Bug reported by Antoine Pitrou on the python-committers mailing list. According to Brett Canon, the first failure was: https://travis-ci.org/python/cpython/jobs/228409786 And the regression is related to my commit a5c62a8e9f0de6c4133825a5710984a3cd5e102b: bpo-23404. Collecting coverage Downloading coverage-4.3.4.tar.gz (361kB) ? Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info/coverage.egg-info writing pip-egg-info/coverage.egg-info/PKG-INFO writing dependency_links to pip-egg-info/coverage.egg-info/dependency_links.txt writing entry points to pip-egg-info/coverage.egg-info/entry_points.txt writing top-level names to pip-egg-info/coverage.egg-info/top_level.txt writing manifest file 'pip-egg-info/coverage.egg-info/SOURCES.txt' warning: manifest_maker: standard file '-c' not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-ewtgqc2r/coverage/setup.py", line 204, in main() File "/tmp/pip-build-ewtgqc2r/coverage/setup.py", line 194, in main setup(**setup_args) File "/home/travis/build/python/cpython/Lib/distutils/core.py", line 148, in setup dist.run_commands() File "/home/travis/build/python/cpython/Lib/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/home/travis/build/python/cpython/Lib/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 279, in run self.find_sources() File "/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 306, in find_sources mm.run() File "/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 533, in run self.add_defaults() File "/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 562, in add_defaults sdist.add_defaults(self) File "/home/travis/build/python/cpython/Lib/distutils/command/sdist.py", line 228, in add_defaults self._add_defaults_ext() File "/home/travis/build/python/cpython/Lib/distutils/command/sdist.py", line 311, in _add_defaults_ext build_ext = self.get_finalized_command('build_ext') File "/home/travis/build/python/cpython/Lib/distutils/cmd.py", line 299, in get_finalized_command cmd_obj.ensure_finalized() File "/home/travis/build/python/cpython/Lib/distutils/cmd.py", line 107, in ensure_finalized self.finalize_options() File "/home/travis/build/python/cpython/Lib/distutils/command/build_ext.py", line 150, in finalize_options py_include = sysconfig.get_python_inc() File "/home/travis/build/python/cpython/Lib/distutils/sysconfig.py", line 100, in get_python_inc incdir = os.path.join(_sys_home, get_config_var('AST_H_DIR')) File "/home/travis/build/python/cpython/Lib/posixpath.py", line 92, in join genericpath._check_arg_types('join', a, *p) File "/home/travis/build/python/cpython/Lib/genericpath.py", line 149, in _check_arg_types (funcname, s.__class__.__name__)) from None TypeError: join() argument must be str or bytes, not 'NoneType' ---------------------------------------- ?Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ewtgqc2r/coverage/? ---------- components: Build, Tests messages: 293014 nosy: haypo, pitrou priority: normal severity: normal status: open title: The coverage job is broken: distutils build_ext fails on None versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 18:24:49 2017 From: report at bugs.python.org (Brett Cannon) Date: Thu, 04 May 2017 22:24:49 +0000 Subject: [New-bugs-announce] [issue30274] Make importlib.abc.ExtensionFileLoader.__init__() documentation match code Message-ID: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> New submission from Brett Cannon: https://docs.python.org/3/library/importlib.html#importlib.machinery.ExtensionFileLoader says "fullname, path" for __init__(), but https://github.com/python/cpython/blob/647c3d381e67490e82cdbbe6c96e46d5e1628ce2/Lib/importlib/_bootstrap_external.py#L909 says "name, path". While I would much rather change the parameter name to match the rest of the module, I don't think I'm comfortable with the backwards-compatibility breakage over just a single parameter name (although chances are no one will notice in either direction as everyone probably passes by position). ---------- assignee: docs at python components: Documentation messages: 293022 nosy: brett.cannon, docs at python priority: normal severity: normal stage: needs patch status: open title: Make importlib.abc.ExtensionFileLoader.__init__() documentation match code _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 20:20:05 2017 From: report at bugs.python.org (Jeff Zhang) Date: Fri, 05 May 2017 00:20:05 +0000 Subject: [New-bugs-announce] [issue30275] pickle doesn't work in compile/exec Message-ID: <1493943605.77.0.767455241721.issue30275@psf.upfronthosting.co.za> New submission from Jeff Zhang: I want to use pickle in compile/exec, but it doesn't work for me. It only works when I use the global namespace. But I don't want to use global namespace, is there any way for that ? Thanks >>> a = compile("def f():\n\t'hello'\nimport pickle\npickle.dumps(f)", "", "exec") >>> exec(a) # works >>> exec(a, {}) # fails Traceback (most recent call last): File "", line 1, in File "", line 4, in _pickle.PicklingError: Can't pickle : it's not the same object as __main__.f >>> exec(a, {'__name__': '__main__'}) # fails too Traceback (most recent call last): File "", line 1, in File "", line 4, in _pickle.PicklingError: Can't pickle : it's not the same object as __main__.f ---------- components: Library (Lib) messages: 293032 nosy: Jeff Zhang priority: normal severity: normal status: open title: pickle doesn't work in compile/exec type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 4 23:23:43 2017 From: report at bugs.python.org (Bernhard M. Wiedemann) Date: Fri, 05 May 2017 03:23:43 +0000 Subject: [New-bugs-announce] [issue30276] import hashlib makes many programs slow Message-ID: <1493954623.26.0.714784938457.issue30276@psf.upfronthosting.co.za> New submission from Bernhard M. Wiedemann: Steps to Reproduce: echo import hashlib > test.py time python -m cProfile -s tottime test.py 2>&1 | head Actual Results: shows 27ms spent in hashlib.py The problem goes away when dropping everything after line 133 in hashlib.py see also issue 21288 ---------- assignee: christian.heimes components: Library (Lib), SSL messages: 293039 nosy: bmwiedemann, christian.heimes priority: normal severity: normal status: open title: import hashlib makes many programs slow versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 03:03:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 05 May 2017 07:03:05 +0000 Subject: [New-bugs-announce] [issue30277] Speeds up compiling cases-insensitive regular expressions Message-ID: <1493967785.05.0.264912808117.issue30277@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently _sre.getlower() takes two arguments. Depending on the bits set in the second argument it uses one of three algorithms for determining the lower case of the character -- Unicode, ASCII-only, and locale-depended. After resolving issue30215 _sre.getlower() no longer used for locale-depended case. Proposed patch replaces _sre.getlower() with two one-argument functions: _sre.ascii_tolower() and _sre.unicode_tolower(). This slightly speeds up compiling cases-insensitive regular expressions, especially containing ranges. $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?i)ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0)' Unpatched: 2000 loops, best of 5: 180 usec per loop Patched: 2000 loops, best of 5: 173 usec per loop $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?ia)ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0)' Unpatched: 2000 loops, best of 5: 175 usec per loop Patched: 2000 loops, best of 5: 168 usec per loop $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?i)[A-Z]", 0)' Unpatched: 500 loops, best of 5: 788 usec per loop Patched: 500 loops, best of 5: 766 usec per loop $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?ia)[A-Z]", 0)' Unpatched: 5000 loops, best of 5: 92 usec per loop Patched: 5000 loops, best of 5: 83.2 usec per loop $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?i)[\u0410-\u042f]", 0)' Unpatched: 2000 loops, best of 5: 141 usec per loop Patched: 2000 loops, best of 5: 122 usec per loop $ ./python -m timeit -s 'import sre_compile' 'sre_compile.compile("(?i)[\u0000-\uffff]", 0)' Unpatched: 5 loops, best of 5: 59 msec per loop Patched: 10 loops, best of 5: 28.9 msec per loop ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 293049 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Speeds up compiling cases-insensitive regular expressions type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 03:36:46 2017 From: report at bugs.python.org (Kyle Thomas) Date: Fri, 05 May 2017 07:36:46 +0000 Subject: [New-bugs-announce] [issue30278] The element div#sidebar on documentation requires the attribute role="button". Message-ID: <1493969806.2.0.294346675831.issue30278@psf.upfronthosting.co.za> New submission from Kyle Thomas: Elements other than buttons which act as buttons require metadata to be accessible. Refer to https://www.w3.org/TR/wai-aria-practices/examples/button/button.html ---------- assignee: docs at python components: Documentation messages: 293056 nosy: Kyle Thomas, docs at python priority: normal severity: normal status: open title: The element div#sidebar on documentation requires the attribute role="button". type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 03:39:25 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Fri, 05 May 2017 07:39:25 +0000 Subject: [New-bugs-announce] [issue30279] Remove unused Python/thread_foobar.h Message-ID: <1493969965.31.0.346215953104.issue30279@psf.upfronthosting.co.za> New submission from Masayuki Yamamoto: Python/thread_foobar.h is the template code that is threading adaptation for new platforms, and it hasn't been used on actual platforms. As a matter of fact, Python/thread_pthread.h and Python/thread_nt.h give concrete examples of adaptation, therefore, I think thread_foobar.h hasn't needed no more. In addition, there was an issue that only changed thread_foobar.h to fix overlooking (issue21312). python-dev: https://mail.python.org/pipermail/python-dev/2017-May/147840.html ---------- components: Interpreter Core messages: 293057 nosy: masamoto priority: normal severity: normal status: open title: Remove unused Python/thread_foobar.h type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 05:08:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 May 2017 09:08:35 +0000 Subject: [New-bugs-announce] [issue30280] Warning -- threading._dangling was modified by test_asyncio on FreeBSD 9 Message-ID: <1493975315.11.0.159651594974.issue30280@psf.upfronthosting.co.za> New submission from STINNER Victor: On the FreeBSD 9 buildbot, I saw this warning: Warning -- threading._dangling was modified by test_asyncio http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.6/builds/124/steps/test/logs/warnings%20%281%29 http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.5/builds/78/steps/test/logs/warnings%20%281%29 ---------- components: Tests, asyncio messages: 293082 nosy: haypo, yselivanov priority: normal severity: normal status: open title: Warning -- threading._dangling was modified by test_asyncio on FreeBSD 9 versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 06:47:45 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 05 May 2017 10:47:45 +0000 Subject: [New-bugs-announce] [issue30281] set stop default to -PY_SSIZE_T_MAX-1 in PySlice_Unpack Message-ID: <1493981265.53.0.830080121255.issue30281@psf.upfronthosting.co.za> New submission from Xiang Zhang: The default value for stop in PySlice_Unpack should be -PY_SSIZE_T_MAX-1. Otherwise a sequence of length PY_SSIZE_T_MAX could get a wrong slicelength when doing L[::-1]. ---------- components: Interpreter Core messages: 293097 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: set stop default to -PY_SSIZE_T_MAX-1 in PySlice_Unpack type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 11:09:35 2017 From: report at bugs.python.org (Ondrej Kubecka) Date: Fri, 05 May 2017 15:09:35 +0000 Subject: [New-bugs-announce] [issue30282] object returned by tarfile.extractfile has an incorrect value of name attribute Message-ID: <1493996975.48.0.516954690623.issue30282@psf.upfronthosting.co.za> New submission from Ondrej Kubecka: Consider the following code snippet: import tarfile tar1 = tarfile.open('tar1.tar.gz') file_ = tar1.extractfile('FILE') print(file_.name) Up until 3.2.x, the value of name attribute would be 'FILE' as derived from tarinfo of the member. Starting with 3.3 (commits: b062a2fa 7a919e99) this value be obtained from tarfile.fileobj ("parent" tarball file) and would return 'tar1.tar.gz' instead. This does not seem to be correct as it's not a filename of the ExFileObject / _FileInFile / io.BufferedReader object itself which would otherwise be consistent with values normally found under name. There is also a problem that this information no longer appears to be accessible at all looking at the object returned from extractfile alone. And looking at release notes of 3.3, this does not seem to be intentional effect. ---------- components: Library (Lib) messages: 293111 nosy: Ondrej Kubecka priority: normal severity: normal status: open title: object returned by tarfile.extractfile has an incorrect value of name attribute type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 12:23:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 May 2017 16:23:09 +0000 Subject: [New-bugs-announce] [issue30283] [2.7] Backport test_regrtest (partially) on Python 2.7 Message-ID: <1494001389.01.0.0290337792937.issue30283@psf.upfronthosting.co.za> New submission from STINNER Victor: I would like to continue to backport enhancements of regrtest from master to 2.7. In master, regrtest has so many super useful features! This week, Serhiy and me backported some basic features, but we introduced regressions. I now would like to backport test_regrtest to reduce risk of breaking things (like buildbots and the Python CI). ---------- components: Tests messages: 293120 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: [2.7] Backport test_regrtest (partially) on Python 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 12:27:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 May 2017 16:27:13 +0000 Subject: [New-bugs-announce] [issue30284] Build CPython out of tree with a read-only source tree Message-ID: <1494001633.16.0.215498233114.issue30284@psf.upfronthosting.co.za> New submission from STINNER Victor: I tried to build CPython out of the source tree with a customized read-only source tree (chmod -R -w). I got an error when running tests: tests want to write into a build/ directory... in the source tree. Attached patch fixes this issue. ---------- components: Build messages: 293121 nosy: haypo priority: normal severity: normal status: open title: Build CPython out of tree with a read-only source tree versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 13:02:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 05 May 2017 17:02:59 +0000 Subject: [New-bugs-announce] [issue30285] Optimize case-insensitive regular expressions Message-ID: <1494003779.18.0.0568506065862.issue30285@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Matching and searching case-insensitive regular expressions is much slower than matching and searching case-sensitive regular expressions. Case-insensitivity requires converting every character in input string to lower case and disables some optimizations. But there are only 2669 cased characters (52 in ASCII mode). For all other characters in the pattern we can use case-sensitive matching. Results of microbenchmarks: $ ./python -m timeit -s "import re; p = re.compile(r'(?ai) +x'); s = ' '*10000+'x'" "p.match(s)" Unpatched: 5000 loops, best of 5: 47.1 usec per loop Patched: 20000 loops, best of 5: 17.6 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?i) +x'); s = ' '*10000+'x'" "p.match(s)" Unpatched: 2000 loops, best of 5: 109 usec per loop Patched: 20000 loops, best of 5: 17.6 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?ai)[ \t]+x'); s = ' '*10000+'x'" "p.match(s)" Unpatched: 500 loops, best of 5: 537 usec per loop Patched: 5000 loops, best of 5: 84.2 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?i)[ \t]+x'); s = ' '*10000+'x'" "p.match(s)" Unpatched: 500 loops, best of 5: 608 usec per loop Patched: 5000 loops, best of 5: 84.1 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?ai)/x'); s = ' '*10000+'/x'" "p.search(s)" Unpatched: 1000 loops, best of 5: 226 usec per loop Patched: 20000 loops, best of 5: 13.4 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?i)/x'); s = ' '*10000+'/x'" "p.search(s)" Unpatched: 1000 loops, best of 5: 284 usec per loop Patched: 20000 loops, best of 5: 13.4 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?ai)[/%]x'); s = ' '*10000+'/x'" "p.search(s)" Unpatched: 500 loops, best of 5: 483 usec per loop Patched: 1000 loops, best of 5: 279 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?i)[/%]x'); s = ' '*10000+'/x'" "p.search(s)" Unpatched: 500 loops, best of 5: 549 usec per loop Patched: 1000 loops, best of 5: 279 usec per loop The patch also optimizes searching some complex case-sensitive patterns. This is a side effect, I'll provide more comprehensive optimization in other issue. $ ./python -m timeit -s "import re; p = re.compile(r'([xy])'); s = ' '*10000+'x'" "p.search(s)" Unpatched: 500 loops, best of 5: 633 usec per loop Patched: 1000 loops, best of 5: 250 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'((x|y)z)'); s = ' '*10000+'xz'" "p.search(s)" Unpatched: 500 loops, best of 5: 716 usec per loop Patched: 1000 loops, best of 5: 250 usec per loop ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 293127 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Optimize case-insensitive regular expressions type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 14:59:55 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 05 May 2017 18:59:55 +0000 Subject: [New-bugs-announce] [issue30286] ctypes FreeLibrary fails on Windows 64-bit Message-ID: <1494010795.37.0.519448367815.issue30286@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': >>> import ctypes >>> path = 'C:\\Python35-64\\vcruntime140.dll' >>> cfile = ctypes.CDLL(path) >>> cfile._handle 140736170229760 >>> ctypes.windll.kernel32.FreeLibrary(cfile._handle) Traceback (most recent call last): ctypes.windll.kernel32.FreeLibrary(cfile._handle) ctypes.ArgumentError: argument 1: : int too long to convert Everything is fine on 32-bit. ---------- components: ctypes messages: 293135 nosy: giampaolo.rodola priority: normal severity: normal status: open title: ctypes FreeLibrary fails on Windows 64-bit versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 18:13:21 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Fri, 05 May 2017 22:13:21 +0000 Subject: [New-bugs-announce] [issue30287] cpython and Clang Static Analyzer Message-ID: <1494022401.59.0.120432906774.issue30287@psf.upfronthosting.co.za> New submission from ????? ????????: I compiled cpython using Clang 4.0 Static Analyzer with scan-build ./configure --enable-loadable-sqlite-extensions --enable-ipv6 --with-system-expat --with-system-ffi --with-system-libmpdec scan-build make and here are the results https://mail.aegee.org/dpa/scan-build-python-a1054c3b00/ Please note, that the information is only about what gets actually compiled, code disabled by #if .. #endif is not considered (e.g. when determining whether a variable assignment is useless). There are probably some false-positives. Consider this as information, I do not pretend there are any bugs found by the static analyzer. ---------- messages: 293145 nosy: dilyan.palauzov priority: normal severity: normal status: open title: cpython and Clang Static Analyzer type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 19:38:45 2017 From: report at bugs.python.org (DenSA-Inc) Date: Fri, 05 May 2017 23:38:45 +0000 Subject: [New-bugs-announce] [issue30288] ssl.wrap_ssl will fail on do_handshake if default parameters are supplied by user Message-ID: <1494027525.33.0.822182237835.issue30288@psf.upfronthosting.co.za> New submission from DenSA-Inc: After a big problem with the newest ejabberd-version and sleekxmpp I located the problem in ssl.wrap_socket. When called with no parameters the later do_handshake (method of ssl.SSLSocket) fails with an exception. When called with keyword-parameters which match the default values (except for do_handshake_on_connect), do_handshake will fail when called after that. Once I have time I will edit this post to add the required information here, but for now I refer to the issue filed on github: https://github.com/fritzy/SleekXMPP/issues/452 The important information is in comments 2 and 3. ---------- assignee: christian.heimes components: SSL messages: 293146 nosy: botter, christian.heimes priority: normal severity: normal status: open title: ssl.wrap_ssl will fail on do_handshake if default parameters are supplied by user type: crash versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 5 23:41:10 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sat, 06 May 2017 03:41:10 +0000 Subject: [New-bugs-announce] [issue30289] make distclean and Misc/python-config.sh Message-ID: <1494042070.28.0.252520928526.issue30289@psf.upfronthosting.co.za> New submission from ????? ????????: 'make distclean' forgets to delete Misc/python-config.sh . ---------- messages: 293151 nosy: dilyan.palauzov priority: normal severity: normal status: open title: make distclean and Misc/python-config.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 6 01:03:19 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 06 May 2017 05:03:19 +0000 Subject: [New-bugs-announce] [issue30290] IDLE: add tests for help_about.py Message-ID: <1494046999.85.0.702748551727.issue30290@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Initial plan. 1a. Change AboutDialog to mimic query.Query with respect to _utest and suppression of dialog display and waiting. 1b. Create AboutDialog instance. 2a. Change textview.TextViewer as with AboutDialog. Also change textview functions and AboutDialog methods to pass on _utest. 2b. Simulate keyclicks on buttons and test that root gains appropriate child. Then destroy it. 3. At some point, remove dead code and change now incorrect encoding comment. Separate issue: add simulated button click tests to test_textview and other popup dialogs. Directly calling commands does not test that buttons invoke the right command. ---------- assignee: terry.reedy components: IDLE messages: 293152 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: add tests for help_about.py type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 6 05:57:32 2017 From: report at bugs.python.org (Steve Barnes) Date: Sat, 06 May 2017 09:57:32 +0000 Subject: [New-bugs-announce] [issue30291] Allow windows launcher to specify bit lengths with & without minor version Message-ID: <1494064652.52.0.930357680293.issue30291@psf.upfronthosting.co.za> New submission from Steve Barnes: Currently you can use, assuming all are installed: py -2 # gets the latest python 2 with 64 bit as the default py -2.7 # gets python 2.7 with 64 bit as the default py -2.7-32 # gets -32 bit python 2.7 py -3 # gets the latest python 3 with 64 bit as the default py -3.5 # gets python 3.5 with 64 bit as the default py -3.5-32 # gets -32 bit python 3.5 But you cannot use: py -2-32 # Usage Error but would be handy for the latest 32 bit python 2 py -3-32 # Usage Error but would be handy for the latest 32 bit python 3 Note that you also cannot use: py -3.5-64 # Unknown option: -3 would be handy for testing with I need 64 bit python 3.5 with an error if it doesn't exist currently -3.5 defaults to 3.5 64 bit if available 32 bit otherwise. For testing packages and programs it would be very useful to be able to specify any of: - Latest available 32 bit python 2 or 3 - 64 bit python 3 fail if unavailable. ---------- messages: 293153 nosy: Steve Barnes priority: normal severity: normal status: open title: Allow windows launcher to specify bit lengths with & without minor version type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 6 09:05:43 2017 From: report at bugs.python.org (debuggy) Date: Sat, 06 May 2017 13:05:43 +0000 Subject: [New-bugs-announce] [issue30292] Why is there a concept "unbound method" in python3 version? Message-ID: <1494075943.31.0.565968699812.issue30292@psf.upfronthosting.co.za> New submission from debuggy: When I read (python 3.6.1 version), I found there is a concept of 'unbound method' in some places. However, when I referred to , it said the concept of ?unbound methods? has been removed from the language. So I wondered if there should be a change in python3 version? For instance, in this code example of the guide: >>> class D(object): ... def f(self, x): ... return x ... >>> d = D() >>> D.__dict__['f'] # Stored internally as a function >>> D.f # Get from a class becomes an unbound method >>> d.f # Get from an instance becomes a bound method > When I tested myself, the result of statement "D.f" should be not . ---------- assignee: docs at python components: Documentation messages: 293160 nosy: debuggy, docs at python priority: normal severity: normal status: open title: Why is there a concept "unbound method" in python3 version? type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 6 15:04:17 2017 From: report at bugs.python.org (Martijn Pieters) Date: Sat, 06 May 2017 19:04:17 +0000 Subject: [New-bugs-announce] [issue30293] Peephole binops folding can lead to memory and bytecache ballooning Message-ID: <1494097457.83.0.135778883063.issue30293@psf.upfronthosting.co.za> New submission from Martijn Pieters: The following expression produces 127MB in constants in `co_consts` due to two 63.5MB integer objects produced when folding: ((200*200 - 2) & ((1 << 500000000) - 1)) + ((200*200 - 2) >> 500000000) The optimizer already does not store optimized *sequences* of more than 20 elements to avoid making bytecode files too large: If the new constant is a sequence, only folds when the size is below a threshold value. That keeps pyc files from becoming large in the presence of code like: (None,)*1000. Perhaps the same should be extended to number objects? Context: https://stackoverflow.com/questions/43823807/why-does-using-arguments-make-this-function-so-much-slower ---------- messages: 293167 nosy: mjpieters priority: normal severity: normal status: open title: Peephole binops folding can lead to memory and bytecache ballooning _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 03:58:03 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sun, 07 May 2017 07:58:03 +0000 Subject: [New-bugs-announce] [issue30294] ./configure, pydebug and pymalloc Message-ID: <1494143883.23.0.254430026718.issue30294@psf.upfronthosting.co.za> New submission from ????? ????????: Providing that during ./configure Py_DEBUG can either be set or not, but there is no third state, which third state would justify calling ./configure --with-pydebug=lambda, --with-pydebug shall be renamed to --enable-pydebug . Likewise for --with-pymalloc , but it is more tricky. Currently ./configure --help emits "--with(out)-pymalloc disable/enable specialized mallocs". Usually from the output of ./configure --help one shall be able to conclude, whether a switch is on or off by default, if it is not provided. E.g. if it is by default off, then "--enable-X enable feature X" is printed; and "--disable-Y disable feature-Y" is printed when by default the feature is on. The code says, that if pymalloc is enabled implicitly, if neither --with-pymalloc nor --without-pymalloc is provided. Let's update the AS_HELP_STRING to show the default and also shorten the code, which makes it also easier to understand (for me at least) which makes it also easier to understand (for me at least): diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -3290,12 +3290,7 @@ AC_MSG_RESULT($with_doc_strings) # Check for Python-specific malloc support AC_MSG_CHECKING(for --with-pymalloc) AC_ARG_WITH(pymalloc, - AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs])) - -if test -z "$with_pymalloc" -then - with_pymalloc="yes" -fi + AS_HELP_STRING([--without-pymalloc], [disable specialized mallocs]),,with_pymalloc=yes) if test "$with_pymalloc" != "no" then AC_DEFINE(WITH_PYMALLOC, 1, configure.ac:4629 mentions "# * --with-wide-unicode (adds a 'u')", but since commit d63a3b8beb4a0841cb59fb3515347ccaab34b733 "Implement PEP 393", one cannot pass --with-wide-unicode to ./configure. ---------- components: Build messages: 293182 nosy: dilyan.palauzov priority: normal severity: normal status: open title: ./configure, pydebug and pymalloc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 08:24:20 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sun, 07 May 2017 12:24:20 +0000 Subject: [New-bugs-announce] [issue30295] msvcrt SetErrorMode not documented Message-ID: <1494159860.93.0.93225035242.issue30295@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': Also SEM_FAILCRITICALERRORS and other SEM_constants. They should as setting error mode on Windows for console applications is a pretty common use case (in fact ./Lib/test/libregrtest/setup.py uses it). ---------- assignee: docs at python components: Documentation messages: 293189 nosy: docs at python, giampaolo.rodola priority: normal severity: normal status: open title: msvcrt SetErrorMode not documented versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 09:08:04 2017 From: report at bugs.python.org (Jon Dufresne) Date: Sun, 07 May 2017 13:08:04 +0000 Subject: [New-bugs-announce] [issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib Message-ID: <1494162484.35.0.941296488498.issue30296@psf.upfronthosting.co.za> New submission from Jon Dufresne: Lib has some patterns that could be easily discovered and cleaned up. Doing so will reduce the number of unnecessary temporary lists in memory and unnecessary function calls. It will also take advantage of Python's own rich features in a way that better dog foods the language. For example: * Replace list() with list comprehension * Replace dict() with dict comprehension * Replace set() with set comprehension * Replace builtin func() with func() when supported (e.g. any(), all(), tuple(), min(), & max()) ---------- components: Library (Lib) messages: 293190 nosy: jdufresne priority: normal pull_requests: 1591 severity: normal status: open title: Remove unnecessary tuples, lists, sets, and dicts from Lib versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 09:31:52 2017 From: report at bugs.python.org (Sebastian Noack) Date: Sun, 07 May 2017 13:31:52 +0000 Subject: [New-bugs-announce] [issue30297] Recursive starmap causes Segmentation fault Message-ID: <1494163912.12.0.28043122667.issue30297@psf.upfronthosting.co.za> New submission from Sebastian Noack: If I run following code (on Python 3.5.3, Linux) the interpreter crashes with a segfault: def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None): hashfunc = hashfunc or hashlib.sha1 mac = hmac.new(data, None, hashfunc) def _pseudorandom(x, mac=mac): h = mac.copy() h.update(x) return h.digest() buf = [] for block in range(1, -(-keylen // mac.digest_size) + 1): rv = u = _pseudorandom(salt + _pack_int(block)) for i in range(iterations - 1): u = _pseudorandom(u) rv = starmap(xor, zip(rv, u)) buf.extend(rv) return bytes(buf[:keylen]) pbkdf2_bin(b'1234567890', b'1234567890', 200000, 32) I was able to track it down to the line of buf.extend(rv) which apparently is causing the segfault. Note that rv is a lazy-evaluated starmap. I also get a segfault if I evaluate it by other means (e.g. by passing it to the list constructor). However, if I evaluate it immediately by wrapping the starmap constructor with the list constructor, the code works as expected. But I wasn't able yet, to further isolate the issue. FWIW, the Python 2 version [1] of this code works just fine without forcing immediate evaluation of the starmap. Note that the code posted, except for the bits I changed in order to make it compatible with Python 3, is under the copyright of Armin Ronacher, who published it under the BSD license. [1]: https://github.com/mitsuhiko/python-pbkdf2 ---------- messages: 293192 nosy: Sebastian.Noack priority: normal severity: normal status: open title: Recursive starmap causes Segmentation fault type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 10:39:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 07 May 2017 14:39:18 +0000 Subject: [New-bugs-announce] [issue30298] Weak deprecations for inline regular expression modifiers Message-ID: <1494167958.42.0.581219852932.issue30298@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: There is a difference between handling inline modifiers in regular expressions between Python and all other regular expression engines that support inline modifiers. In other engines an inline modifier affect only the part of the pattern after it. It Python it affects also the part before it. For avoiding possible confusion and for removing this difference in distant future, using inline modifiers not at the start of the pattern was deprecated in 3.6 (see issue22493). But the condition for raising a warning is too strong. It allows using '(?is)...', but '(?i)(?s)...' emits a warning. This makes hard modifying regular expressions by prefixing them with inline modifiers. This condition is unjustifiably strong because '(?i)(?s)...' doesn't have any ambiguity. It also disallows ' (?i)...' in verbose mode despite the fact that whitespaces are not significant in verbose mode. Proposed patch weaks the condition of deprecation warnings. It allows using several subsequent inline modifiers at the start of the pattern and ignores whitespaces in verbose mode. ---------- components: Library (Lib), Regular Expressions messages: 293197 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Weak deprecations for inline regular expression modifiers type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 11:27:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 07 May 2017 15:27:38 +0000 Subject: [New-bugs-announce] [issue30299] Display the bytecode when compiled a regular expression in debug mode Message-ID: <1494170858.78.0.223872265764.issue30299@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes compiling a regular expression in debug mode (with the re.DEBUG flag) displaying the bytecode in human readable form (in addition to the syntax tree). For example: >>> re.compile('test_[a-z_]+', re.DEBUG) LITERAL 116 LITERAL 101 LITERAL 115 LITERAL 116 LITERAL 95 MAX_REPEAT 1 MAXREPEAT IN RANGE (97, 122) LITERAL 95 0. INFO 16 0b1 6 MAXREPEAT (to 17) prefix_skip 5 prefix [0x74, 0x65, 0x73, 0x74, 0x5f] ('test_') overlap [0, 0, 0, 1, 0] 17: LITERAL 0x74 ('t') 19. LITERAL 0x65 ('e') 21. LITERAL 0x73 ('s') 23. LITERAL 0x74 ('t') 25. LITERAL 0x5f ('_') 27. REPEAT_ONE 12 1 MAXREPEAT (to 40) 31. IN 7 (to 39) 33. RANGE 0x61 0x7a ('a'-'z') 36. LITERAL 0x5f ('_') 38. FAILURE 39: SUCCESS 40: SUCCESS re.compile('test_[a-z_]+', re.DEBUG) This feature is needed mainly for our own needs. It can help optimizing regular expression compilation. ---------- components: Library (Lib), Regular Expressions messages: 293198 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Display the bytecode when compiled a regular expression in debug mode type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 14:24:57 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 07 May 2017 18:24:57 +0000 Subject: [New-bugs-announce] [issue30300] asyncio.Controller Message-ID: <1494181497.37.0.0898291474199.issue30300@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: Over in https://github.com/aio-libs/aiosmtpd we have a Controller class which is very handy for testing and other cases. I realized that this isn't really aiosmtpd specific, and with just a few tweaks it could be appropriate for the stdlib. I have a branch ready for a pull request. This is the tracking/discussion issue. ---------- components: Library (Lib) messages: 293205 nosy: barry priority: normal severity: normal status: open title: asyncio.Controller versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 15:01:50 2017 From: report at bugs.python.org (Daniel Moore) Date: Sun, 07 May 2017 19:01:50 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue30301=5D_=E2=80=9CAttribute?= =?utf-8?q?Error=3A_=27SimpleQueue=27_object_has_no_attribute_=27=5Fpoll?= =?utf-8?b?J+KAnQ==?= Message-ID: <1494183710.88.0.708414094068.issue30301@psf.upfronthosting.co.za> New submission from Daniel Moore: I originally posted this as a question on StackOverflow thinking I was doing something wrong: http://stackoverflow.com/questions/43834494/python-3-6-attributeerror-simplequeue-object-has-no-attribute-poll/43835368#43835368 But I think I found the solution and answered my own question. I'm pretty sure you need to set: self._poll = self._reader.poll in the __setstate__ method in the SimpleQueue class of queues.py from the multiprocessing library. Otherwise, I'd love to know an alternative solution. Thanks! ---------- components: Library (Lib), Windows messages: 293209 nosy: Daniel Moore, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ?AttributeError: 'SimpleQueue' object has no attribute '_poll'? type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 7 15:57:26 2017 From: report at bugs.python.org (Utkarsh Upadhyay) Date: Sun, 07 May 2017 19:57:26 +0000 Subject: [New-bugs-announce] [issue30302] Improve .__repr__ implementation for datetime.datetime.timedelta Message-ID: <1494187046.46.0.90330515352.issue30302@psf.upfronthosting.co.za> New submission from Utkarsh Upadhyay: Currently, the default implementation of datetime.datetime.__repr__ (the default output string produced at the console/IPython) gives a rather cryptic output: from datetime import datetime as D D.fromtimestamp(1390953543.1) - D.fromtimestamp(1121871596) # datetime.timedelta(3114, 28747, 100000) For the uninitiated, it is not obvious that the numeric values here are `days`, `seconds` and `microsecond` respectively. Would there be any pushback against changing this to: # datetime.timedelta(days=3114, seconds=28747, microseconds=100000) ? ---------- components: Library (Lib) messages: 293212 nosy: musically_ut priority: normal severity: normal status: open title: Improve .__repr__ implementation for datetime.datetime.timedelta type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 03:58:09 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 08 May 2017 07:58:09 +0000 Subject: [New-bugs-announce] [issue30303] IDLE: Add _utest to textview Message-ID: <1494230289.92.0.930894896454.issue30303@psf.upfronthosting.co.za> New submission from Louie Lu: Relate to #30290, add _utest to textview to support direct unittest. ---------- assignee: terry.reedy components: IDLE messages: 293228 nosy: louielu, terry.reedy priority: normal severity: normal status: open title: IDLE: Add _utest to textview versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 04:50:09 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 08 May 2017 08:50:09 +0000 Subject: [New-bugs-announce] [issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7 Message-ID: <1494233409.78.0.688533240712.issue30304@psf.upfronthosting.co.za> New submission from Martin Panter: In Mercurial revision 6e5b5d1b6714, the documentation for ?assertMultiLineEqual? was changed from This method is used by default when comparing Unicode strings with ?assertEqual?. to This method is used by default when comparing strings with ?assertEqual?. The new text is misleading because ?str? objects are also strings, but the default does not apply to ?str? objects. ---------- assignee: docs at python components: Documentation, Tests keywords: easy messages: 293229 nosy: docs at python, ezio.melotti, martin.panter priority: normal severity: normal stage: needs patch status: open title: TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 06:52:56 2017 From: report at bugs.python.org (=?utf-8?b?5pa55paH5re7?=) Date: Mon, 08 May 2017 10:52:56 +0000 Subject: [New-bugs-announce] [issue30305] python 2.7.13 join issue Message-ID: <1494240776.22.0.622107687448.issue30305@psf.upfronthosting.co.za> New submission from ???: when i use str join , i find some issue, such as str_msg = 'malluin=MTg5Njk2ODIyMA==; Path=/bizmall/; HttpOnly, mallkey=9a9b172e5cac49c6b1ef970f4405c5e91712468846bb23c477c852d4987703b074ce9a48b440d92ec7dd1012275c926a41a8e76cd5a0e4b17efa705ab2d42fc85192b6542b218d2ecefc88f0f7cd7c68; Path=/bizmall/; HttpOnly, malluin=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, mallkey=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, payforreadsn=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, wxtokenkey=b7945ae2cd97e8e5d3029cd7b90a893f68ace0b498b100ff63d61d8bb2a0259c; Path=/; HttpOnly, wxticket=3510401828; Path=/; HttpOnly, wxticketkey=72a9df89b5c9460ea7507b21f5c6938068ace0b498b100ff63d61d8bb2a0259c; Path=/; HttpOnly, wap_sid=CJzgxYgHEkBVSXBfZVJUdktUVi1QV0RrSVNTR08wV3poTjE4UEpyVHU1b2JmMFZCaEhqVGVjTHJQRTVzaENzLXhWUnV2cGlFGAQg/BEo7rzXnwswpP7AyAU=; Path=/; HttpOnly, wap_sid2=CJzgxYgHEnBTM045bVNlZ0xOQmROSVNydEV4UExZZFhma1BpZVI2UVlybXc1WFlpa2NZbXRLLVpnTnl6UldVeGQxSnotbDgtR2tkVTFEek96U3ExU2VWYzQ1cTRiVmc3R0JBZWlMUEU3S1NScG9KTmhubUhBd0FBMKT+wMgF; Path=/; HttpOnly, pass_ticket=0JAIZfxQAFgv68rxGl33/gZEtmgCTyHk3Jd2pSWZOnQg0u5FKjc3BdNJABTOAyQ+; Path=/; HttpOnly'.replace( 'HttpOnly', '').replace(',', '').replace(' ', '') items = str_msg.split(';') new_item = '' for item in items: if 'wxtokenkey' in item: new_item = new_item.join((item + ';')) if 'wxticketkey' in item: new_item = new_item.join((item + ';')) if 'wap_sid=' in item: new_item = new_item.join((item + ';')) if 'wap_sid2' in item: new_item = new_item.join((item + ';')) if 'pass_ticket' in item: new_item = new_item.join((item + ';')) print new_item it would no stop !!! and such as str_msg = 'malluin=MTg5Njk2ODIyMA==; Path=/bizmall/; HttpOnly, mallkey=9a9b172e5cac49c6b1ef970f4405c5e91712468846bb23c477c852d4987703b074ce9a48b440d92ec7dd1012275c926a41a8e76cd5a0e4b17efa705ab2d42fc85192b6542b218d2ecefc88f0f7cd7c68; Path=/bizmall/; HttpOnly, malluin=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, mallkey=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, payforreadsn=EXPIRED; Path=/; Expires=Sun, 07-May-2017 09:49:24 GMT; HttpOnly, wxtokenkey=b7945ae2cd97e8e5d3029cd7b90a893f68ace0b498b100ff63d61d8bb2a0259c; Path=/; HttpOnly, wxticket=3510401828; Path=/; HttpOnly, wxticketkey=72a9df89b5c9460ea7507b21f5c6938068ace0b498b100ff63d61d8bb2a0259c; Path=/; HttpOnly, wap_sid=CJzgxYgHEkBVSXBfZVJUdktUVi1QV0RrSVNTR08wV3poTjE4UEpyVHU1b2JmMFZCaEhqVGVjTHJQRTVzaENzLXhWUnV2cGlFGAQg/BEo7rzXnwswpP7AyAU=; Path=/; HttpOnly, wap_sid2=CJzgxYgHEnBTM045bVNlZ0xOQmROSVNydEV4UExZZFhma1BpZVI2UVlybXc1WFlpa2NZbXRLLVpnTnl6UldVeGQxSnotbDgtR2tkVTFEek96U3ExU2VWYzQ1cTRiVmc3R0JBZWlMUEU3S1NScG9KTmhubUhBd0FBMKT+wMgF; Path=/; HttpOnly, pass_ticket=0JAIZfxQAFgv68rxGl33/gZEtmgCTyHk3Jd2pSWZOnQg0u5FKjc3BdNJABTOAyQ+; Path=/; HttpOnly'.replace( 'HttpOnly', '').replace(',', '').replace(' ', '') items = str_msg.split(';') new_item = '' for item in items: if 'wxtokenkey' in item: # new_item = new_item.join((item + ';')) new_item = new_item.join([item, ';']) if 'wxticketkey' in item: new_item = new_item.join([item, ';']) if 'wap_sid=' in item: new_item = new_item.join([item, ';']) if 'wap_sid2' in item: new_item = new_item.join([item, ';']) if 'pass_ticket' in item: new_item = new_item.join([item, ';']) print new_item it would be have a str and this str is pass_ticket=0JAIZfxQAFgv68rxGl33/gZEtmgCTyHk3Jd2pSWZOnQg0u5FKjc3BdNJABTOAyQ+wap_sid2=CJzgxYgHEnBTM045bVNlZ0xOQmROSVNydEV4UExZZFhma1BpZVI2UVlybXc1WFlpa2NZbXRLLVpnTnl6UldVeGQxSnotbDgtR2tkVTFEek96U3ExU2VWYzQ1cTRiVmc3R0JBZWlMUEU3S1NScG9KTmhubUhBd0FBMKT+wMgFwap_sid=CJzgxYgHEkBVSXBfZVJUdktUVi1QV0RrSVNTR08wV3poTjE4UEpyVHU1b2JmMFZCaEhqVGVjTHJQRTVzaENzLXhWUnV2cGlFGAQg/BEo7rzXnwswpP7AyAU=wxticketkey=72a9df89b5c9460ea7507b21f5c6938068ace0b498b100ff63d61d8bb2a0259cwxtokenkey=b7945ae2cd97e8e5d3029cd7b90a893f68ace0b498b100ff63d61d8bb2a0259c;;;;; but i think it should be wxtokenkey=b7945ae2cd97e8e5d3029cd7b90a893f68ace0b498b100ff63d61d8bb2a0259c;wxticketkey=72a9df89b5c9460ea7507b21f5c6938068ace0b498b100ff63d61d8bb2a0259c;wap_sid=CJzgxYgHEkBVSXBfZVJUdktUVi1QV0RrSVNTR08wV3poTjE4UEpyVHU1b2JmMFZCaEhqVGVjTHJQRTVzaENzLXhWUnV2cGlFGAQg/BEo7rzXnwswpP7AyAU=;wap_sid2=CJzgxYgHEnBTM045bVNlZ0xOQmROSVNydEV4UExZZFhma1BpZVI2UVlybXc1WFlpa2NZbXRLLVpnTnl6UldVeGQxSnotbDgtR2tkVTFEek96U3ExU2VWYzQ1cTRiVmc3R0JBZWlMUEU3S1NScG9KTmhubUhBd0FBMKT+wMgF;pass_ticket=0JAIZfxQAFgv68rxGl33/gZEtmgCTyHk3Jd2pSWZOnQg0u5FKjc3BdNJABTOAyQ+; ---------- components: macOS messages: 293231 nosy: ned.deily, ronaldoussoren, ??? priority: normal severity: normal status: open title: python 2.7.13 join issue type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 10:04:41 2017 From: report at bugs.python.org (Martin Teichmann) Date: Mon, 08 May 2017 14:04:41 +0000 Subject: [New-bugs-announce] [issue30306] release arguments of contextmanager Message-ID: <1494252281.4.0.796080303271.issue30306@psf.upfronthosting.co.za> New submission from Martin Teichmann: The arguments of a function which was decorated to be a context manager are stored inside the context manager, and are thus kept alive. This is a memory leak. Example: @contextmanager def f(a): do_something_with(a) a = None # should release the memory yield if this is now called with something big, say with f(something_really_huge): pass then this something_really_huge is kept alive during the with statement, even though the function explicitly let go of it. ---------- components: Library (Lib) messages: 293234 nosy: Martin.Teichmann priority: normal severity: normal status: open title: release arguments of contextmanager type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 14:26:22 2017 From: report at bugs.python.org (rohit singh) Date: Mon, 08 May 2017 18:26:22 +0000 Subject: [New-bugs-announce] [issue30307] https://docs.python.org/3/tutorial/introduction.html#strings Section 3.1.2 doc issue Message-ID: <1494267982.7.0.781940622722.issue30307@psf.upfronthosting.co.za> New submission from rohit singh: The documentation says: >>> '"Isn\'t," she said.' '"Isn\'t," she said.' It should be: >>> '"Isn\'t," she said.' '"Isn't," she said.' ---------- assignee: docs at python components: Documentation messages: 293246 nosy: docs at python, rohit singh priority: normal severity: normal status: open title: https://docs.python.org/3/tutorial/introduction.html#strings Section 3.1.2 doc issue versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 17:20:00 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 May 2017 21:20:00 +0000 Subject: [New-bugs-announce] [issue30308] Add code coverage for argument in random.shuffle Message-ID: <1494278400.3.0.911074987674.issue30308@psf.upfronthosting.co.za> New submission from Cheryl Sabella: Added test cases for `random` argument in random.shuffle for code coverage. Two interesting results (documented within test cases): 1. In the docs, `random` is defined as a function returning a float in the range [0, 1), but negative floats could be returned and shuffle worked using slice notation. 2. A dictionary with sequential numeric keys could be shuffled. ---------- components: Tests messages: 293253 nosy: csabella priority: normal severity: normal status: open title: Add code coverage for argument in random.shuffle type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 17:42:16 2017 From: report at bugs.python.org (Marc Culler) Date: Mon, 08 May 2017 21:42:16 +0000 Subject: [New-bugs-announce] [issue30310] tkFont.py assumes that all font families are encoded as ascii in Python 2.7 Message-ID: <1494279736.5.0.821030807704.issue30310@psf.upfronthosting.co.za> New submission from Marc Culler: And that is a very bad assumption. On Windows 10 in the Japanese locale the default TkFixedFont has family u'\uff2d\uff33 \u30b4\u30b7\u30c3\u30af' (a transliteration of MS Gothic). The error occurs on line 51: 47 def _set(self, kw): 48 options = [] 49 for k, v in kw.items(): 50 options.append("-"+k) >>>> 51 options.append(str(v)) 52 return tuple(options) I will attach a screenshot showing the crash on a Japanese Windows 10 system, running in the Python 2.7 command line application. ---------- components: Tkinter messages: 293256 nosy: culler priority: normal severity: normal status: open title: tkFont.py assumes that all font families are encoded as ascii in Python 2.7 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 8 21:34:22 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 09 May 2017 01:34:22 +0000 Subject: [New-bugs-announce] [issue30311] random.shuffle pointlessly shuffles dicts Message-ID: <1494293662.45.0.505067861838.issue30311@psf.upfronthosting.co.za> New submission from Steven D'Aprano: According to the documentation, random.shuffle() should accept a sequence. But it also accepts dicts, in which case it does nothing, expensively: py> x = dict.fromkeys(range(10**6)) py> random.shuffle(x) py> str(x)[:55] + "...}" '{0: None, 1: None, 2: None, 3: None, 4: None, 5: None, ...}' I'm not sure if it is better to explicitly test for and reject dicts and mappings, or just document that sorting dicts will apparently succeed while doing nothing. Do we want to support sorting OrderedDicts? That at least makes sense, since they have an order, but again shuffle() seemingly works but actually does nothing. I lean towards explicitly testing for dicts and raising. ---------- messages: 293265 nosy: rhettinger, steven.daprano priority: normal severity: normal status: open title: random.shuffle pointlessly shuffles dicts type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 04:47:27 2017 From: report at bugs.python.org (Oskar Weser) Date: Tue, 09 May 2017 08:47:27 +0000 Subject: [New-bugs-announce] [issue30312] Small correction in set code sample Message-ID: <1494319647.07.0.625979333092.issue30312@psf.upfronthosting.co.za> New submission from Oskar Weser: There is a code example about the set type found under: https://docs.python.org/3/tutorial/datastructures.html It reads as: ``` >>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'} >>> print(basket) # show that duplicates have been removed {'orange', 'banana', 'pear', 'apple'} >>> 'orange' in basket # fast membership testing True >>> 'crabgrass' in basket False >>> # Demonstrate set operations on unique letters from two words ... >>> a = set('abracadabra') >>> b = set('alacazam') >>> a # unique letters in a {'a', 'r', 'b', 'c', 'd'} >>> a - b # letters in a but not in b {'r', 'd', 'b'} >>> a | b # letters in either a or b ``` I read "either a or b" as "a .EXOR. b". Shouldn't it be: ``` >>> a | b # letters in a or b ``` I don't speak English as a native language, so perhaps I am wrong. ---------- assignee: docs at python components: Documentation messages: 293291 nosy: docs at python, mcocdawc priority: normal severity: normal status: open title: Small correction in set code sample versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 09:59:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 13:59:58 +0000 Subject: [New-bugs-announce] [issue30313] Tests of Python 2.7 VS9.0 buildbots must be run with -uall -rwW options Message-ID: <1494338398.28.0.940820958867.issue30313@psf.upfronthosting.co.za> New submission from STINNER Victor: After my commit d2aff607199a24182714404777c80c7f180a35af of bpo-30283, test_regrtest failed with "multiple errors occurred; run in verbose mode for details" on "x86 Windows XP VS9.0 2.7" buildbot, but tests are not re-run in verbose mode on this buildbot :-( See http://bugs.python.org/issue30283#msg293312 The "test" step of the buildbot runs directly the PC/VS9.0/rt.bat command which only pass -j2 option to regrtest.py, but not -uall -rwW. Other Windows buildbots run Tools/buildbot/test.bat which pass -uall -rwW to regrtest.py. I see different options: * Modify PC/VS9.0/rt.bat to pass extra options: I dislike this option, it changes the behaviour, some people may rely on the current behaviour (and Python 2.7 is now considered as super stable) * Copy Tools/buildbot/test.bat to PC/VS9.0/test.bat and modify the copy to run PC/VS9.0/rt.bat. I dislike this option, it duplicates code. * Modify Tools/buildbot/test.bat to add an option to specify the pass to rt.bat and then modify the buildbot config to use test.bat instead of rt.bat but also use the new option to pass PC/VS9.0/rt.bat (or just "PC/VS9.0/" depending how the option is designed). @Zach: I request your advice on this issue ;-) ---------- components: Tests, Windows keywords: buildbot messages: 293313 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Tests of Python 2.7 VS9.0 buildbots must be run with -uall -rwW options versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 10:56:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 14:56:48 +0000 Subject: [New-bugs-announce] [issue30314] Buildbots: 15 min is too low for test_tools on x86 Tiger 3.6 buildbot Message-ID: <1494341808.3.0.862589804304.issue30314@psf.upfronthosting.co.za> New submission from STINNER Victor: We should give more than 15 min to the "x86 Tiger 3.6" buildbot, since test_tools was killed by the timeout. On the previous build, test_tools took min 25 sec. The global 15 min timeout was designed to detect deadlocks issues, but here it's just that the buildbot is sometimes too slow. Maybe we should increase the timeout to 30 min on all buildbots, but also increase the timeout of the "tests" step to long than 1 hour? Otherwise, the test can be killed by buildbot without logging the Python traceback. Maybe we can configured buildbot to first send a signal (SIGUSR1? SIGINT?) before killing the process to dump a traceback, but that's something different. --- 0:15:54 [ 52/405] test_tools crashed -- running: test_zipfile (178 sec) Timeout (0:15:00)! Thread 0xa000d000 (most recent call first): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/ast.py", line 101 in ... File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/test_tools/test_unparse.py", line 124 in assertASTEqual ... --- http://buildbot.python.org/all/builders/x86%20Tiger%203.6/builds/349/steps/test/logs/stdio See also bpo-30172: "test_tools takes longer than 5 minutes on some buildbots". ---------- messages: 293316 nosy: haypo priority: normal severity: normal status: open title: Buildbots: 15 min is too low for test_tools on x86 Tiger 3.6 buildbot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 11:47:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 15:47:49 +0000 Subject: [New-bugs-announce] [issue30315] test_ftplib.TestTLS_FTPClass: "[Errno 54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot Message-ID: <1494344869.6.0.553746122368.issue30315@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/246/steps/test/logs/stdio test_check_hostname (test.test_ftplib.TestTLS_FTPClass) ... Exception in thread Thread-84: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 366, in handle_read_event super(SSLConnection, self).handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asynchat.py", line 171, in handle_read self.found_terminator() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 116, in found_terminator method(arg) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 207, in cmd_quit self.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 406, in close super(SSLConnection, self).close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 397, in close self.socket.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/socket.py", line 417, in close self._real_close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/socket.py", line 411, in _real_close _ss.close(self) ConnectionResetError: [Errno 54] Connection reset by peer During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 279, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 399, in handle_error raise Exception Exception ERROR (...) ====================================================================== ERROR: test_check_hostname (test.test_ftplib.TestTLS_FTPClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_ftplib.py", line 950, in test_check_hostname self.client.connect("localhost", self.server.port) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/ftplib.py", line 155, in connect self.welcome = self.getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/ftplib.py", line 234, in getresp resp = self.getmultiline() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/ftplib.py", line 220, in getmultiline line = self.getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/ftplib.py", line 202, in getline line = self.file.readline(self.maxline + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ---------------------------------------------------------------------- Ran 89 tests in 15.001s FAILED (errors=1) Warning -- threading_cleanup() failed to cleanup 0 threads after 4 sec (count: 0, dangling: 2) Warning -- threading._dangling was modified by test_ftplib Before: <_weakrefset.WeakSet object at 0x80577ce28> After: <_weakrefset.WeakSet object at 0x80577c810> test test_ftplib failed ---------- components: Tests messages: 293326 nosy: haypo priority: normal severity: normal status: open title: test_ftplib.TestTLS_FTPClass: "[Errno 54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 11:49:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 15:49:35 +0000 Subject: [New-bugs-announce] [issue30316] test_default_timeout() of test_threading.BarrierTests: random failures on AMD64 FreeBSD CURRENT Debug 3.x Message-ID: <1494344975.72.0.584129176678.issue30316@psf.upfronthosting.co.za> New submission from STINNER Victor: test_default_timeout() of test_threading.BarrierTests randomly fails on AMD64 FreeBSD CURRENT Debug 3.x: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/246/steps/test/logs/stdio test_default_timeout (test.test_threading.BarrierTests) ... ERROR test_reset (test.test_threading.BarrierTests) ... Unhandled exception in thread started by .task at 0x8057bed48> Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 38, in task Unhandled exception in thread started by .task at 0x8057bed48> Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 38, in task f() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 917, in f i = barrier.wait() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 603, in wait self._enter() # Block while the barrier drains. File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 627, in _enter raise BrokenBarrierError threading.BrokenBarrierError Unhandled exception in thread started by .task at 0x8057bed48> Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 38, in task f() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 917, in f i = barrier.wait() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 612, in wait self._wait(timeout) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 652, in _wait raise BrokenBarrierError threading.BrokenBarrierError Unhandled exception in thread started by .task at 0x8057bed48> Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 38, in task f() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 917, in f i = barrier.wait() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 603, in wait self._enter() # Block while the barrier drains. File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 627, in _enter raise BrokenBarrierError threading.BrokenBarrierError f() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 917, in f i = barrier.wait() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 612, in wait self._wait(timeout) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 652, in _wait raise BrokenBarrierError threading.BrokenBarrierError ok (...) test_frame_tstate_tracing (test.test_threading.ThreadTests) ... ok test_ident_of_no_threading_threads (test.test_threading.ThreadTests) ... ok test_is_alive_after_fork (test.test_threading.ThreadTests) ... Warning -- threading_cleanup() failed to cleanup 0 threads after 4 sec (count: 0, dangling: 21) ok test_join_nondaemon_on_shutdown (test.test_threading.ThreadTests) ... ok test_limbo_cleanup (test.test_threading.ThreadTests) ... ok (...) ====================================================================== ERROR: test_default_timeout (test.test_threading.BarrierTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 922, in test_default_timeout self.run_threads(f) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 751, in run_threads f() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/lock_tests.py", line 917, in f i = barrier.wait() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 612, in wait self._wait(timeout) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 650, in _wait raise BrokenBarrierError threading.BrokenBarrierError ---------- components: Tests keywords: buildbot messages: 293327 nosy: haypo priority: normal severity: normal status: open title: test_default_timeout() of test_threading.BarrierTests: random failures on AMD64 FreeBSD CURRENT Debug 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 11:52:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 15:52:59 +0000 Subject: [New-bugs-announce] [issue30317] test_timeout() of test_multiprocessing_spawn.WithManagerTestBarrier fails randomly on x86 Windows7 3.x buildbot Message-ID: <1494345179.69.0.743787858569.issue30317@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/588/steps/test/logs/stdio 0:49:08 [225/405/1] test_multiprocessing_spawn failed Process Process-59: Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 249, in _bootstrap self.run() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1179, in task self.f(*self.args) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1385, in _test_timeout_f i = barrier.wait() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 1040, in wait return self._callmethod('wait', (timeout,)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 774, in _callmethod raise convert_to_error(kind, result) threading.BrokenBarrierError Process Process-60: Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 249, in _bootstrap self.run() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1179, in task self.f(*self.args) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1385, in _test_timeout_f i = barrier.wait() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 1040, in wait return self._callmethod('wait', (timeout,)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 774, in _callmethod raise convert_to_error(kind, result) threading.BrokenBarrierError Process Process-62: Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 249, in _bootstrap self.run() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1179, in task self.f(*self.args) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1385, in _test_timeout_f i = barrier.wait() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 1040, in wait return self._callmethod('wait', (timeout,)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 774, in _callmethod raise convert_to_error(kind, result) threading.BrokenBarrierError Process Process-61: Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 249, in _bootstrap self.run() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1179, in task self.f(*self.args) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1385, in _test_timeout_f i = barrier.wait() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 1040, in wait return self._callmethod('wait', (timeout,)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 774, in _callmethod raise convert_to_error(kind, result) threading.BrokenBarrierError test_answer_challenge_auth_failure (test.test_multiprocessing_spawn.OtherTest) ... ok test_deliver_challenge_auth_failure (test.test_multiprocessing_spawn.OtherTest) ... ok (...) ====================================================================== ERROR: test_timeout (test.test_multiprocessing_spawn.WithManagerTestBarrier) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1399, in test_timeout self.run_threads(self._test_timeout_f, (self.barrier, results)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1228, in run_threads f(*args) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1385, in _test_timeout_f i = barrier.wait() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 1040, in wait return self._callmethod('wait', (timeout,)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\managers.py", line 774, in _callmethod raise convert_to_error(kind, result) threading.BrokenBarrierError ---------------------------------------------------------------------- Ran 277 tests in 762.297s FAILED (errors=1, skipped=24) test test_multiprocessing_spawn failed ---------- components: Tests keywords: buildbot messages: 293328 nosy: haypo priority: normal severity: normal status: open title: test_timeout() of test_multiprocessing_spawn.WithManagerTestBarrier fails randomly on x86 Windows7 3.x buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 11:54:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 15:54:26 +0000 Subject: [New-bugs-announce] [issue30318] test_distutils is too verbose on Windows Message-ID: <1494345266.31.0.621231206863.issue30318@psf.upfronthosting.co.za> New submission from STINNER Victor: test_distutils should only dump stdout/stderr on compilation failure, but hide them on success (by default). Example of output: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/588/steps/test/logs/stdio 0:58:52 [277/405/1] test_distutils passed (124 sec) -- running: test_tokenize (322 sec) xxmodule.c Creating library d:\temp\tmp1byjf67b\Debug\temp\tmp1byjf67b\xx_d.cp37-win32.lib and object d:\temp\tmp1byjf67b\Debug\temp\tmp1byjf67b\xx_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance foo.c Creating library d:\temp\tmp78_8qa47\tempt\temp\tmpduqip5h3\foo_d.cp37-win32.lib and object d:\temp\tmp78_8qa47\tempt\temp\tmpduqip5h3\foo_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance foo.c Creating library d:\temp\tmp78_8qa47\tempt\temp\tmpduqip5h3\foo_d.cp37-win32.lib and object d:\temp\tmp78_8qa47\tempt\temp\tmpduqip5h3\foo_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance xxmodule.c Creating library d:\temp\tmpruuda1qt\Debug\temp\tmpruuda1qt\xx_d.cp37-win32.lib and object d:\temp\tmpruuda1qt\Debug\temp\tmpruuda1qt\xx_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance foo.c Creating library d:\temp\tmpxzrh56h5\tempt\temp\tmpht642isv\foo_d.cp37-win32.lib and object d:\temp\tmpxzrh56h5\tempt\temp\tmpht642isv\foo_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance foo.c Creating library d:\temp\tmpxzrh56h5\tempt\temp\tmpht642isv\foo_d.cp37-win32.lib and object d:\temp\tmpxzrh56h5\tempt\temp\tmpht642isv\foo_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance xxmodule.c Creating library build\temp.win32-3.7-pydebug\Debug\xx_d.cp37-win32.lib and object build\temp.win32-3.7-pydebug\Debug\xx_d.cp37-win32.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\build\test_python_204>exit 1 D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\build\test_python_204>exit 0 ---------- components: Distutils, Tests, Windows messages: 293330 nosy: dstufft, haypo, merwok, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_distutils is too verbose on Windows versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 12:00:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 16:00:13 +0000 Subject: [New-bugs-announce] [issue30319] test_invalid_authentication() of test_imaplib: random failure on AMD64 FreeBSD 9.x 3.6 Message-ID: <1494345613.61.0.862517173328.issue30319@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.6/builds/128/steps/test/logs/stdio test_invalid_authentication (test.test_imaplib.NewIMAPSSLTests) ... SENT: b'* OK IMAP4rev1' GOT: b'OMOH0 CAPABILITY' SENT: b'* CAPABILITY IMAP4rev1' SENT: b'OMOH0 OK CAPABILITY completed' GOT: b'OMOH1 AUTHENTICATE MYAUTH' SENT: b'+' GOT: b'ZmFrZQ==' SENT: b'OMOH1 NO [AUTHENTICATIONFAILED] invalid' ERROR ====================================================================== ERROR: test_invalid_authentication (test.test_imaplib.NewIMAPSSLTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/test/test_imaplib.py", line 223, in _cleanup self.client.shutdown() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/imaplib.py", line 326, in shutdown self.sock.close() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/socket.py", line 417, in close self._real_close() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 1052, in _real_close socket._real_close(self) File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/socket.py", line 411, in _real_close _ss.close(self) ConnectionResetError: [Errno 54] Connection reset by peer ---------------------------------------------------------------------- Ran 95 tests in 32.694s FAILED (errors=1, skipped=2) Warning -- threading._dangling was modified by test_imaplib Before: <_weakrefset.WeakSet object at 0x805e2b608> After: <_weakrefset.WeakSet object at 0x8014a25a0> test test_imaplib failed ---------- components: Tests keywords: buildbot messages: 293331 nosy: haypo priority: normal severity: normal status: open title: test_invalid_authentication() of test_imaplib: random failure on AMD64 FreeBSD 9.x 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 12:01:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 16:01:51 +0000 Subject: [New-bugs-announce] [issue30320] test_eintr.test_sigwaitinfo(): race condition on AMD64 FreeBSD 10.x Shared 3.6 Message-ID: <1494345711.78.0.148323197443.issue30320@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.6/builds/129/steps/test/logs/stdio running: test_eintr (584 sec) 0:16:01 [405/405/1] test_eintr failed test_all (test.test_eintr.EINTRTests) ... FAIL ====================================================================== FAIL: test_all (test.test_eintr.EINTRTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_eintr.py", line 18, in test_all script_helper.assert_python_ok("-u", tester) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/script_helper.py", line 150, in assert_python_ok return _assert_python(True, *args, **env_vars) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/script_helper.py", line 136, in _assert_python err)) AssertionError: Process return code is 1 command line: ['/usr/home/buildbot/python/3.6.koobs-freebsd10/build/python', '-X', 'faulthandler', '-I', '-u', '/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py'] stdout: --- test_read (__main__.OSEINTRTest) ... ok test_wait (__main__.OSEINTRTest) ... ok test_wait3 (__main__.OSEINTRTest) ... ok test_wait4 (__main__.OSEINTRTest) ... ok test_waitpid (__main__.OSEINTRTest) ... ok test_write (__main__.OSEINTRTest) ... ok test_accept (__main__.SocketEINTRTest) ... ok test_open (__main__.SocketEINTRTest) ... ok test_os_open (__main__.SocketEINTRTest) ... ok test_recv (__main__.SocketEINTRTest) ... ok test_recvmsg (__main__.SocketEINTRTest) ... ok test_send (__main__.SocketEINTRTest) ... ok test_sendall (__main__.SocketEINTRTest) ... ok test_sendmsg (__main__.SocketEINTRTest) ... ok test_sleep (__main__.TimeEINTRTest) ... ok test_sigtimedwait (__main__.SignalEINTRTest) ... ok test_sigwaitinfo (__main__.SignalEINTRTest) ... --- stderr: --- Timeout (0:10:00)! Thread 0x0000000802006400 (most recent call first): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 422 in test_sigwaitinfo File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/case.py", line 601 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/case.py", line 649 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/runner.py", line 176 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1889 in _run_suite File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1923 in run_unittest File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 492 in test_main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 496 in --- ---------------------------------------------------------------------- Ran 1 test in 607.847s FAILED (failures=1) test test_eintr failed ---------- components: Tests messages: 293332 nosy: haypo, martin.panter priority: normal severity: normal status: open title: test_eintr.test_sigwaitinfo(): race condition on AMD64 FreeBSD 10.x Shared 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 15:45:12 2017 From: report at bugs.python.org (PradeepKumar) Date: Tue, 09 May 2017 19:45:12 +0000 Subject: [New-bugs-announce] [issue30321] format() function prints fillchar as backslash twice Message-ID: <1494359112.44.0.238269745811.issue30321@psf.upfronthosting.co.za> New submission from PradeepKumar: The output expected is, '\R\' but it shows this. >>> '{:\^3}'.format('R') '\\R\\' >>> ---------- messages: 293343 nosy: pradeepkr priority: normal severity: normal status: open title: format() function prints fillchar as backslash twice versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 16:19:39 2017 From: report at bugs.python.org (Sam De Meyer) Date: Tue, 09 May 2017 20:19:39 +0000 Subject: [New-bugs-announce] [issue30322] PyObject_GetIter does not behave as documented on dict objects Message-ID: <1494361179.47.0.337252878474.issue30322@psf.upfronthosting.co.za> New submission from Sam De Meyer: According to the docs (https://docs.python.org/3/c-api/object.html) the `PyObject_GetIter` method should be equivalent to the python call `iter()`, but, when given a dict, the `PyObject_GetIter` returns an iterator over key-value pairs whereas the `iter()` method returns an iterator over keys only. I tripped over this when giving the `.update()` a dict-like object that does not inherit from the builtin dict and implements its own `__iter__()`. The `update()` method eventually reaches the following piece of code: https://hg.python.org/cpython/file/4243df51fe43/Objects/dictobject.c#l2383 > it = PyObject_GetIter(seq2); > ... > item = PyIter_Next(it); > ... > fast = PySequence_Fast(item, ""); > ... > key = PySequence_Fast_GET_ITEM(fast, 0); > value = PySequence_Fast_GET_ITEM(fast, 1); displaying the difference in behaviour between `PyObject_GetIter` and `iter(o)`. ---------- assignee: docs at python components: Documentation messages: 293346 nosy: Sam De Meyer, docs at python priority: normal severity: normal status: open title: PyObject_GetIter does not behave as documented on dict objects versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 17:37:02 2017 From: report at bugs.python.org (Klamann) Date: Tue, 09 May 2017 21:37:02 +0000 Subject: [New-bugs-announce] [issue30323] concurrent.futures.Executor.map() consumes all memory when big generators are used Message-ID: <1494365822.25.0.431593996842.issue30323@psf.upfronthosting.co.za> New submission from Klamann: The Executor's map() function accepts a function and an iterable that holds the function arguments for each call to the function that should be made. This iterable could be a generator, and as such it could reference data that won't fit into memory. The behaviour I would expect is that the Executor requests the next element from the iterable whenever a thread, process or whatever is ready to make the next function call. But what actually happens is that the entire iterable gets converted into a list right after the map function is called and therefore any underlying generator will load all referenced data into memory. Here's where the list gets built from the iterable: https://github.com/python/cpython/blob/3.6/Lib/concurrent/futures/_base.py#L548 The way I see it, there's no reason to convert the iterable to a list in the map function (or any other place in the Executor). Just replacing the list comprehension with a generator expression would probably fix that. Here's an example that illustrates the issue: from concurrent.futures import ThreadPoolExecutor import time def generate(): for i in range(10): print("generating input", i) yield i def work(i): print("working on input", i) time.sleep(1) with ThreadPoolExecutor(max_workers=2) as executor: generator = generate() executor.map(work, generator) The output is: generating input 0 working on input 0 generating input 1 working on input 1 generating input 2 generating input 3 generating input 4 generating input 5 generating input 6 generating input 7 generating input 8 generating input 9 working on input 2 working on input 3 working on input 4 working on input 5 working on input 6 working on input 7 working on input 8 working on input 9 Ideally, the lines should alternate, but currently all input is generated immediately. ---------- messages: 293353 nosy: Klamann priority: normal severity: normal status: open title: concurrent.futures.Executor.map() consumes all memory when big generators are used type: resource usage versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 18:31:41 2017 From: report at bugs.python.org (BeamPower) Date: Tue, 09 May 2017 22:31:41 +0000 Subject: [New-bugs-announce] [issue30324] Error using newline='' when writing to CSV file Message-ID: <1494369101.21.0.974352364291.issue30324@psf.upfronthosting.co.za> New submission from BeamPower: I am using the newline='' feature in my program to avoid the extra lines being placed between each line being written?to a CSV file. This error is odd though...?I used it before on a previous rev, and it worked fine. I think the CSV file writing feature has been available since Python 2.3? Here's the error I am getting: Traceback (most recent call last): ? File "C:\Python\parser\parser.py", line 91, in ? ? write_header_to_csv() ? File "C:\Python\parser\parser.py", line 44, in write_header_to_csv ? ? csvfile = open('decodedfile.csv', 'w', newline='') TypeError: 'newline' is an invalid keyword argument for this function At the top of my program, I have the following imports: import sys import binascii import csv ---------- messages: 293356 nosy: BeamPower priority: normal severity: normal status: open title: Error using newline='' when writing to CSV file _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 9 19:37:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 May 2017 23:37:08 +0000 Subject: [New-bugs-announce] [issue30325] Buildbot: send email notifications to buildbot-status@ Message-ID: <1494373028.15.0.894136349212.issue30325@psf.upfronthosting.co.za> New submission from STINNER Victor: I created a new mailing list to get email notifications when a buildbot starts failing (state change from green/success to red/failure). It seems like the buildbot config already sends email, but I don't see them in the archives of the python-checkins list? Config: https://github.com/python/buildmaster-config/blob/master/master/master.cfg#L820-L827 python-checkins archives: https://mail.python.org/pipermail/python-checkins/2017-May/thread.html ---------- components: Tests keywords: buildbot messages: 293362 nosy: haypo, zach.ware priority: normal severity: normal status: open title: Buildbot: send email notifications to buildbot-status@ versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 02:13:15 2017 From: report at bugs.python.org (Jensen Taylor) Date: Wed, 10 May 2017 06:13:15 +0000 Subject: [New-bugs-announce] [issue30326] Version may be out of date in travis.yml Message-ID: <1494396795.74.0.364359225427.issue30326@psf.upfronthosting.co.za> New submission from Jensen Taylor: It's only 3.6. I may be talking nonsense but it didn't quite look right ---------- components: Build, Tests messages: 293380 nosy: Jensen Taylor priority: normal severity: normal status: open title: Version may be out of date in travis.yml type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 02:14:35 2017 From: report at bugs.python.org (Jensen Taylor) Date: Wed, 10 May 2017 06:14:35 +0000 Subject: [New-bugs-announce] [issue30327] Version may be out of date in travis.yml Message-ID: <1494396875.36.0.00921683522074.issue30327@psf.upfronthosting.co.za> New submission from Jensen Taylor: It's only 3.6. I may be talking nonsense but it didn't quite look right ---------- components: Build, Tests messages: 293381 nosy: Jensen Taylor priority: normal severity: normal status: open title: Version may be out of date in travis.yml type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 08:24:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 12:24:06 +0000 Subject: [New-bugs-announce] [issue30328] test_ssl.test_connect_with_context(): ConnectionResetError on AMD64 FreeBSD 9.x 3.6 Message-ID: <1494419046.55.0.785376173684.issue30328@psf.upfronthosting.co.za> New submission from STINNER Victor: See also bpo-30315 (test_ftplib) and bpo-30319 (test_imaplib). http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.6/builds/131/steps/test/logs/stdio test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 53510) server: connection cipher is now ('ECDHE-RSA-AES256-SHA', 'TLSv1/SSLv3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/test/test_ssl.py", line 1944, in run self.close() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/test/test_ssl.py", line 1919, in close self.sslconn.close() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/socket.py", line 417, in close self._real_close() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 1052, in _real_close socket._real_close(self) File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/socket.py", line 411, in _real_close _ss.close(self) ConnectionResetError: [Errno 54] Connection reset by peer ERROR ... ====================================================================== ERROR: test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/test/test_ssl.py", line 1541, in test_connect_with_context s.connect(self.server_addr) File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 1093, in connect self._real_connect(addr, False) File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 1084, in _real_connect self.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/usr/home/buildbot/python/3.6.koobs-freebsd9/build/Lib/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer ---------------------------------------------------------------------- Ran 127 tests in 12.751s FAILED (errors=1, skipped=7) test test_ssl failed ---------- components: Tests keywords: buildbot messages: 293408 nosy: haypo priority: normal severity: normal status: open title: test_ssl.test_connect_with_context(): ConnectionResetError on AMD64 FreeBSD 9.x 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 08:26:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 12:26:48 +0000 Subject: [New-bugs-announce] [issue30329] test_imaplib.test_login_cram_md5(): OSError: [WinError 10022] An invalid argument was supplied on AMD64 Windows8.1 Non-Debug 3.6 Message-ID: <1494419208.12.0.00943199066561.issue30329@psf.upfronthosting.co.za> New submission from STINNER Victor: See also bpo-30319: test_invalid_authentication() of test_imaplib: ConnectionResetError: [Errno 54] Connection reset by peer on AMD64 FreeBSD 9.x 3.6. http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.6/builds/375/steps/test/logs/stdio test_login_cram_md5 (test.test_imaplib.ThreadedNetworkedTestsSSL) ... creating server server created ADDR = ('127.0.0.1', 0) CLASS = HDLR = .AuthHandler'> server running SENT: b'* OK IMAP4rev1' GOT: b'PJGL0 CAPABILITY' SENT: b'* CAPABILITY IMAP4rev1 LOGINDISABLED AUTH=CRAM-MD5' SENT: b'PJGL0 OK CAPABILITY completed' GOT: b'PJGL1 AUTHENTICATE CRAM-MD5' SENT: b'+ PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ=' GOT: b'dGltIGYxY2E2YmU0NjRiOWVmYTFjY2E2ZmZkNmNmMmQ5ZjMy' SENT: b'PJGL1 OK CRAM-MD5 successful' GOT: b'PJGL2 LOGOUT' SENT: b'* BYE IMAP4ref1 Server logging out' SENT: b'PJGL2 OK LOGOUT completed' waiting for server done ERROR ====================================================================== ERROR: test_login_cram_md5 (test.test_imaplib.ThreadedNetworkedTestsSSL) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.6.ware-win81-release\build\lib\test\support\__init__.py", line 2035, in decorator return func(*args) File "D:\buildarea\3.6.ware-win81-release\build\lib\test\test_imaplib.py", line 796, in test_login_cram_md5 self.assertEqual(ret, "OK") File "D:\buildarea\3.6.ware-win81-release\build\lib\contextlib.py", line 89, in __exit__ next(self.gen) File "D:\buildarea\3.6.ware-win81-release\build\lib\test\test_imaplib.py", line 567, in reaped_pair client.logout() File "D:\buildarea\3.6.ware-win81-release\build\lib\imaplib.py", line 622, in logout self.shutdown() File "D:\buildarea\3.6.ware-win81-release\build\lib\imaplib.py", line 320, in shutdown self.sock.shutdown(socket.SHUT_RDWR) File "D:\buildarea\3.6.ware-win81-release\build\lib\ssl.py", line 1040, in shutdown socket.shutdown(self, how) OSError: [WinError 10022] An invalid argument was supplied ---------------------------------------------------------------------- Ran 95 tests in 6.890s FAILED (errors=1, skipped=4) test test_imaplib failed ---------- assignee: christian.heimes components: SSL, Tests, Windows keywords: buildbot messages: 293411 nosy: christian.heimes, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_imaplib.test_login_cram_md5(): OSError: [WinError 10022] An invalid argument was supplied on AMD64 Windows8.1 Non-Debug 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 08:28:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 12:28:02 +0000 Subject: [New-bugs-announce] [issue30330] test_socket.test_idna(): socket.gaierror: [Errno 11001] getaddrinfo failed on AMD64 Windows10 3.6 Message-ID: <1494419282.71.0.653200577669.issue30330@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20Windows10%203.6/builds/356/steps/test/logs/stdio ====================================================================== ERROR: test_idna (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.6.bolen-windows10\build\lib\test\test_socket.py", line 1359, in test_idna socket.getaddrinfo(domain,0,socket.AF_UNSPEC,socket.SOCK_STREAM) File "D:\buildarea\3.6.bolen-windows10\build\lib\socket.py", line 743, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed ---------------------------------------------------------------------- ---------- components: Tests, Windows keywords: buildbot messages: 293412 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_socket.test_idna(): socket.gaierror: [Errno 11001] getaddrinfo failed on AMD64 Windows10 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 10:31:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 14:31:02 +0000 Subject: [New-bugs-announce] [issue30331] TestPOP3_TLSClass: socket.timeout: timed out on AMD64 FreeBSD 10.x Shared 3.x Message-ID: <1494426662.88.0.428519662658.issue30331@psf.upfronthosting.co.za> New submission from STINNER Victor: See also bpo-30328 (test_ssl), bpo-30315 (test_ftplib) and bpo-30319 (test_imaplib). http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/246/steps/test/logs/stdio 0:07:58 load avg: 3.30 [242/405/1] test_poplib failed -- running: test_datetime (139 sec) test_apop (test.test_poplib.TestPOP3Class) ... ok test_capa (test.test_poplib.TestPOP3Class) ... ok test_dele (test.test_poplib.TestPOP3Class) ... ok test_exceptions (test.test_poplib.TestPOP3Class) ... ok test_getwelcome (test.test_poplib.TestPOP3Class) ... ok test_list (test.test_poplib.TestPOP3Class) ... ok test_noop (test.test_poplib.TestPOP3Class) ... ok test_pass_ (test.test_poplib.TestPOP3Class) ... ok test_quit (test.test_poplib.TestPOP3Class) ... ok test_retr (test.test_poplib.TestPOP3Class) ... ok test_rpop (test.test_poplib.TestPOP3Class) ... ok test_stat (test.test_poplib.TestPOP3Class) ... ok test_stls (test.test_poplib.TestPOP3Class) ... ok test_stls_capa (test.test_poplib.TestPOP3Class) ... ok test_stls_context (test.test_poplib.TestPOP3Class) ... ok test_too_long_lines (test.test_poplib.TestPOP3Class) ... ok test_top (test.test_poplib.TestPOP3Class) ... ok test_uidl (test.test_poplib.TestPOP3Class) ... ok test_user (test.test_poplib.TestPOP3Class) ... ok test_utf8 (test.test_poplib.TestPOP3Class) ... ok test_utf8_raises_if_unsupported (test.test_poplib.TestPOP3Class) ... ok testTimeoutDefault (test.test_poplib.TestTimeouts) ... ok testTimeoutNone (test.test_poplib.TestTimeouts) ... ok testTimeoutValue (test.test_poplib.TestTimeouts) ... ok test__all__ (test.test_poplib.TestPOP3_SSLClass) ... ok test_apop (test.test_poplib.TestPOP3_SSLClass) ... ok test_capa (test.test_poplib.TestPOP3_SSLClass) ... ok test_context (test.test_poplib.TestPOP3_SSLClass) ... ok test_dele (test.test_poplib.TestPOP3_SSLClass) ... ok test_exceptions (test.test_poplib.TestPOP3_SSLClass) ... ok test_getwelcome (test.test_poplib.TestPOP3_SSLClass) ... ok test_list (test.test_poplib.TestPOP3_SSLClass) ... ok test_noop (test.test_poplib.TestPOP3_SSLClass) ... ok test_pass_ (test.test_poplib.TestPOP3_SSLClass) ... ok test_quit (test.test_poplib.TestPOP3_SSLClass) ... ok test_retr (test.test_poplib.TestPOP3_SSLClass) ... ok test_rpop (test.test_poplib.TestPOP3_SSLClass) ... ok test_stat (test.test_poplib.TestPOP3_SSLClass) ... ok test_stls (test.test_poplib.TestPOP3_SSLClass) ... ok test_stls_capa (test.test_poplib.TestPOP3_SSLClass) ... ok test_stls_context (test.test_poplib.TestPOP3_SSLClass) ... ok test_too_long_lines (test.test_poplib.TestPOP3_SSLClass) ... ok test_top (test.test_poplib.TestPOP3_SSLClass) ... ok test_uidl (test.test_poplib.TestPOP3_SSLClass) ... ok test_user (test.test_poplib.TestPOP3_SSLClass) ... ok test_utf8 (test.test_poplib.TestPOP3_SSLClass) ... ok test_utf8_raises_if_unsupported (test.test_poplib.TestPOP3_SSLClass) ... ok test_apop (test.test_poplib.TestPOP3_TLSClass) ... ok test_capa (test.test_poplib.TestPOP3_TLSClass) ... ok test_dele (test.test_poplib.TestPOP3_TLSClass) ... ok test_exceptions (test.test_poplib.TestPOP3_TLSClass) ... ok test_getwelcome (test.test_poplib.TestPOP3_TLSClass) ... ok test_list (test.test_poplib.TestPOP3_TLSClass) ... ERROR test_noop (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-54: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' Exception in thread Thread-53: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 417, in handle_read_event self.handle_accept() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 494, in handle_accept self.handle_accepted(*pair) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 232, in handle_accepted self.handler_instance = self.handler(conn) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 52, in __init__ self.push('+OK dummy pop3 server ready. ') File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 79, in push asynchat.async_chat.push(self, data.encode("ISO-8859-1") + b'\r\n') File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asynchat.py", line 202, in push self.initiate_send() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asynchat.py", line 260, in initiate_send del self.producer_fifo[0] IndexError: deque index out of range ERROR test_pass_ (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-55: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_quit (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-56: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_retr (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-57: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_rpop (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-58: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_stat (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-59: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_stls (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-60: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_stls_capa (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-61: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_stls_context (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-62: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_too_long_lines (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-63: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_top (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-64: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_uidl (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-65: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_user (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-66: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_utf8 (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-67: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None test_utf8_raises_if_unsupported (test.test_poplib.TestPOP3_TLSClass) ... Exception in thread Thread-68: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 222, in run asyncore.loop(timeout=0.1, count=1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 150, in poll read(obj) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 423, in handle_read_event self.handle_read() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 188, in handle_read if self.tls_starting: AttributeError: 'DummyPOP3Handler' object has no attribute 'tls_starting' ERROR /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None ====================================================================== ERROR: test_list (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 432, in tearDown self.client.quit() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 275, in quit self.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 296, in close sock.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 417, in close self._real_close() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/ssl.py", line 1052, in _real_close socket._real_close(self) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 411, in _real_close _ss.close(self) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== ERROR: test_noop (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 427, in setUp self.client.stls() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 396, in stls caps = self.capa() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 377, in capa resp = self._longcmd('CAPA') File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 183, in _longcmd return self._getlongresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 161, in _getlongresp line, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_pass_ (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_quit (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_retr (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_rpop (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_stat (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_stls (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_stls_capa (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_stls_context (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_too_long_lines (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_top (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_uidl (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_user (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_utf8 (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ====================================================================== ERROR: test_utf8_raises_if_unsupported (test.test_poplib.TestPOP3_TLSClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_poplib.py", line 426, in setUp self.client = poplib.POP3(self.server.host, self.server.port, timeout=3) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 105, in __init__ self.welcome = self._getresp() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 149, in _getresp resp, o = self._getline() File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/poplib.py", line 128, in _getline line = self.file.readline(_MAXLINE + 1) File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed out ---------------------------------------------------------------------- Ran 68 tests in 51.800s FAILED (errors=16) Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 17) Warning -- asyncore.socket_map was modified by test_poplib Before: {} After: {4: , 5: , 7: , 8: , 9: , 10: , 11: , 12: , 13: , 14: , 15: , 16: , 17: , 18: , 19: , 20: , 21: } Warning -- threading._dangling was modified by test_poplib Before: <_weakrefset.WeakSet object at 0x805f5c9b0> After: <_weakrefset.WeakSet object at 0x805f5c6d8> test test_poplib failed /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py:657: ResourceWarning: unclosed self._sock = None ---------- assignee: christian.heimes components: SSL, Tests keywords: buildbot messages: 293421 nosy: christian.heimes, haypo priority: normal severity: normal status: open title: TestPOP3_TLSClass: socket.timeout: timed out on AMD64 FreeBSD 10.x Shared 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 10:58:51 2017 From: report at bugs.python.org (Jensen Taylor) Date: Wed, 10 May 2017 14:58:51 +0000 Subject: [New-bugs-announce] [issue30332] Errors that aren't actually definde Message-ID: <1494428331.35.0.538591805722.issue30332@psf.upfronthosting.co.za> Changes by Jensen Taylor : ---------- nosy: Jensen Taylor priority: normal severity: normal status: open title: Errors that aren't actually definde _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 11:24:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 15:24:33 +0000 Subject: [New-bugs-announce] [issue30333] test_multiprocessing_forkserver: poll() failed on AMD64 FreeBSD CURRENT Non-Debug 3.5 Message-ID: <1494429873.7.0.669335220252.issue30333@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.5/builds/97/steps/test/logs/stdio test_connection (test.test_multiprocessing_forkserver.WithThreadsTestConnection) ... FAIL ... Dangling threads: {} ====================================================================== FAIL: test_connection (test.test_multiprocessing_forkserver.WithThreadsTestConnection) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.5.koobs-freebsd-current.nondebug/build/Lib/test/_test_multiprocessing.py", line 2359, in test_connection self.assertEqual(poll(TIMEOUT1), True) AssertionError: False != True ---------------------------------------------------------------------- Ran 272 tests in 124.653s FAILED (failures=1, skipped=16) Warning -- threading._dangling was modified by test_multiprocessing_forkserver Before: <_weakrefset.WeakSet object at 0x80493d080> After: <_weakrefset.WeakSet object at 0x804956160> test test_multiprocessing_forkserver failed[105/398/1] test_multiprocessing_forkserver ---------- components: Tests messages: 293426 nosy: davin, haypo priority: normal severity: normal status: open title: test_multiprocessing_forkserver: poll() failed on AMD64 FreeBSD CURRENT Non-Debug 3.5 versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 11:50:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 May 2017 15:50:11 +0000 Subject: [New-bugs-announce] [issue30334] [Windows] support.rmtree() should retry on WindowsError: [Error 32] The process cannot access the file because it is being used by another process Message-ID: <1494431411.13.0.126195064019.issue30334@psf.upfronthosting.co.za> New submission from STINNER Victor: test_startfile uses a weak time.sleep(0.1) to wait until the process started by os.startfile() completes. Instead of a sleep, can't support.rmtree() retry on "WindowsError: [Error 32] The process cannot access the file because it is being used by another process" error? For example, retry every 100 ms during 10 seconds? It's easy to reproduce the bug on Python 2.7: just remove the time.sleep() call in tests. http://buildbot.python.org/all/builders/x86%20Windows7%202.7/builds/145/steps/test/logs/stdio 0:23:42 [363/402/1] test_startfile crashed [1, 5.638000011444092] Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\runpy.py", line 72, in _run_code exec code in run_globals File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\regrtest.py", line 1877, in main_in_temp_cwd() File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\regrtest.py", line 1864, in main_in_temp_cwd main() File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\contextlib.py", line 35, in __exit__ self.gen.throw(type, value, traceback) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 769, in temp_cwd rmtree(name) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 293, in rmtree _rmtree(path) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 249, in _rmtree _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 202, in _waitfor func(pathname) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 249, in _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\support\__init__.py", line 197, in _force_run return func(*args) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'D:\\cygwin\\home\\db3l\\buildarea\\2.7.bolen-windows7\\build\\build\\test_python_2944' -- If it's too complex to implement a retry (too complex? really?), an obvious hack is to increase the sleep in test_startfile.py from 100 ms to 200 ms... ---------- components: Tests, Windows messages: 293428 nosy: haypo, jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] support.rmtree() should retry on WindowsError: [Error 32] The process cannot access the file because it is being used by another process versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 11:53:20 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Wed, 10 May 2017 15:53:20 +0000 Subject: [New-bugs-announce] [issue30335] Document deprecated alias of assertNotRegex Message-ID: <1494431600.9.0.620975623094.issue30335@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: The assertNotRegexpMatches name was deprecated in 3.2 in favor of assertNotRegex [1]. This is currently not documented in unittest.rst. [1]: https://github.com/python/cpython/commit/ed3a7d2d601ce1e65b0bacf24676440631158ec8 ---------- components: Tests messages: 293430 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Document deprecated alias of assertNotRegex versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 14:02:47 2017 From: report at bugs.python.org (Jensen Taylor) Date: Wed, 10 May 2017 18:02:47 +0000 Subject: [New-bugs-announce] [issue30336] Pull Requests need more detail Message-ID: <1494439367.1.0.278303671769.issue30336@psf.upfronthosting.co.za> New submission from Jensen Taylor: Made a PR for this ---------- messages: 293447 nosy: Jensen Taylor priority: normal severity: normal status: open title: Pull Requests need more detail type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 16:49:49 2017 From: report at bugs.python.org (Sam Silberstein) Date: Wed, 10 May 2017 20:49:49 +0000 Subject: [New-bugs-announce] [issue30337] Vague wording of pkgutil.walk_packages parameter 'prefix' Message-ID: <1494449389.02.0.790150087603.issue30337@psf.upfronthosting.co.za> New submission from Sam Silberstein: Hi there! This is my first submission to the bug tracker, so I apologize if I'm missing some formatting here. I've found what's either vague documentation for the 'prefix' parameter of `pgkutil.walk_packages` or a bug. The method implies that it will only import submodules of the provided path, but if the prefix parameter is not filled, this method will import a module with the same name from outside the path -- so long as it exists in `sys.modules`. I'm unsure if this is due to the documentation not specifying that prefix should always be used when path is set, or if this is a bug (I can provide a fix if it's a bug). Steps to reproduce: Create a directory with a nested package with the same name as a package outside that directory, e.g.: |_ test1 |_ __init__.py |_ should_not_be_included.py |_ test2 |_ test1 |_ __init__.py |_ test1 |_ __init__.py |_ should_be_included.py `list(pkgutil.walk_packages('test2'))` will contain 'should_not_be_included.py' instead of 'should_be_included.py'. Thank you! Sam Silberstein ---------- assignee: docs at python components: Documentation messages: 293453 nosy: docs at python, smsilb priority: normal severity: normal status: open title: Vague wording of pkgutil.walk_packages parameter 'prefix' type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 18:22:18 2017 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 10 May 2017 22:22:18 +0000 Subject: [New-bugs-announce] [issue30338] LC_ALL=en_US + io.open() => LookupError: (osx) Message-ID: <1494454938.72.0.336460677547.issue30338@psf.upfronthosting.co.za> New submission from Anthony Sottile: Originally seen here: https://github.com/Microsoft/vscode/issues/26227 ``` $ LC_ALL=en_US python -c 'import io; io.open("/dev/null")' Traceback (most recent call last): File "", line 1, in LookupError: unknown encoding: ``` Admittedly, that `LC_ALL` looks malformed (should be en_US.UTF-8), but given this works on linux: ``` $ env -i LC_ALL=en_US python -c 'import io; io.open("/dev/null")' $ ``` It may be an OSX specific bug? I've only tagged py27 + py36 because I did not have a build toolchain available to try on master, though I imagine it is reproducible there as well. ---------- components: Library (Lib), macOS messages: 293457 nosy: Anthony Sottile, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: LC_ALL=en_US + io.open() => LookupError: (osx) type: crash versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 10 20:48:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 May 2017 00:48:19 +0000 Subject: [New-bugs-announce] [issue30339] test_multiprocessing_main_handling: "RuntimeError: Timed out waiting for results" on x86 Windows7 3.x Message-ID: <1494463699.01.0.364437710045.issue30339@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/597/steps/test/logs/stdio 0:26:29 [156/405/1] test_multiprocessing_main_handling failed ... test_zipfile_compiled (test.test_multiprocessing_main_handling.ForkServerCmdLineTest) ... skipped "'forkserver' start method not available" test_basic_script (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ... ok test_basic_script_no_suffix (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ... FAIL test_directory (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ... ok test_directory_compiled (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ... ok test_ipython_workaround (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ... ok ... ====================================================================== FAIL: test_basic_script_no_suffix (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 169, in test_basic_script_no_suffix self._check_script(script_name) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 157, in _check_script rc, out, err = assert_python_ok(*run_args, __isolated=False) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\script_helper.py", line 147, in assert_python_ok return _assert_python(True, *args, **env_vars) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\script_helper.py", line 133, in _assert_python err)) AssertionError: Process return code is 1 command line: ['D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\PCbuild\\win32\\python_d.exe', '-X', 'faulthandler', '-E', 'd:\\temp\\tmp3iu335w1\\script', 'spawn'] stdout: --- --- stderr: --- Traceback (most recent call last): File "d:\temp\tmp3iu335w1\script", line 34, in raise RuntimeError("Timed out waiting for results") RuntimeError: Timed out waiting for results --- ---------------------------------------------------------------------- Ran 39 tests in 81.399s FAILED (failures=1, skipped=26) test test_multiprocessing_main_handling failed ---------- components: Tests, Windows messages: 293470 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_multiprocessing_main_handling: "RuntimeError: Timed out waiting for results" on x86 Windows7 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 05:20:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 11 May 2017 09:20:53 +0000 Subject: [New-bugs-announce] [issue30340] Optimize out non-capturing groups Message-ID: <1494494453.98.0.386630329077.issue30340@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes the regular expression parser produce more optimal tree, mainly due to getting rid of non-capturing groups. This allows to apply an optimization that was forbidden before and makes the regular expression compiler producing more efficient code. For example following expressions are transformed in more optimal form: '(?:x|y)+' -> '[xy]+' '(?:ab)|(?:ac)' -> 'a[bc]' r'[a-z]|\d' -> r'[a-z\d]' This can speed up matching by 10-25 times. $ ./python -m timeit -s "import re; p = re.compile(r'(?:x|y)+'); s = 'x'*10000" "p.match(s)" Unpatched: 500 loops, best of 5: 865 usec per loop Patched: 5000 loops, best of 5: 84.5 usec per loop $ ./python -m timeit -s "import re; p = re.compile(r'(?:[a-z]|\d)+'); s = 'x'*10000" "p.match(s)" Unpatched: 100 loops, best of 5: 2.19 msec per loop Patched: 5000 loops, best of 5: 84.5 usec per loop ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 293477 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Optimize out non-capturing groups type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 06:00:26 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 11 May 2017 10:00:26 +0000 Subject: [New-bugs-announce] [issue30341] Add an explaining comment in _PyTrash_thread_destroy_chain() Message-ID: <1494496826.51.0.0986403038499.issue30341@psf.upfronthosting.co.za> New submission from Xiang Zhang: Studying how trashcan works I get puzzled about why increasing trash_delete_nesting in _PyTrash_thread_destroy_chain. I asked Antoine privately (thought he was the author). Antoine told me the reason and suggested add a comment here to help understand. ---------- assignee: pitrou messages: 293484 nosy: pitrou, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Add an explaining comment in _PyTrash_thread_destroy_chain() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 06:01:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 May 2017 10:01:02 +0000 Subject: [New-bugs-announce] [issue30342] [2.7] sysconfig.is_python_build() doesn't work if Python is built with VS 2008 Message-ID: <1494496862.21.0.272757843043.issue30342@psf.upfronthosting.co.za> New submission from STINNER Victor: When Python 2.7 is compiled by VS 2008 using PC/VS9.0/ solution, the executable is PC/VS9.0/{amd64,x86}/python(_d).exe. sysconfig.is_python_build() handles PC/VS7.1/ and PCbuild/ builds, but not PC/VS9.0/ builds. Attached PR fixes is_python_build() for VS 2008. ---------- components: Build, Library (Lib), Windows messages: 293485 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [2.7] sysconfig.is_python_build() doesn't work if Python is built with VS 2008 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 09:58:26 2017 From: report at bugs.python.org (Christopher Harrison) Date: Thu, 11 May 2017 13:58:26 +0000 Subject: [New-bugs-announce] [issue30343] Subclassed json.JSONEncoder does not respect default method for supported types Message-ID: <1494511106.37.0.544159404801.issue30343@psf.upfronthosting.co.za> New submission from Christopher Harrison: If you subclass `json.JSONEncoder` to enable serialisation of custom types beyond those supported, you are meant to transform values of said type into a serialisable version within an overridden `default` method. For example: class MyJSONEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, MyType): return str(o) # Raise TypeError when we have a type we can't serialise super().default(o) This, however, won't work if your custom type is an instance of one of the supported types. This is because, in Lib/json/encoder.py, the `_iterencode` function (defined in `_make_iterencode`) type checks against supported types before it delegates to the `default` method. The reason this came up is because I wanted to serialise a named tuple into a JSON object, with keys corresponding to the named tuple's field names. Ignoring the merits (or otherwise) of this desired outcome, this can't work because a named tuple is still a tuple and thus the `default` method is never called. In Python 2.7, the `_iterencode` method was part of the `JSONEncoder` class, so you could override it in a subclass; even if doing so is somewhat brittle. In Python 3, this method has been moved out into the module namespace (tested in 3.6; looking through the repo, it looks like this change was made in Python 3.1), so it can't easily be monkey-patched without it affecting other things. I believe this to be a bug. It seems reasonable to subclass at least named tuples, dictionaries and lists in such a way that you'd want a different JSON serialisation to their defaults. ---------- components: Library (Lib) messages: 293494 nosy: Christopher Harrison priority: normal severity: normal status: open title: Subclassed json.JSONEncoder does not respect default method for supported types type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 10:36:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 May 2017 14:36:47 +0000 Subject: [New-bugs-announce] [issue30344] test_multiprocessing.test_notify_all(): AssertionError: 6 != 5 on x86 Windows XP 2.7 Message-ID: <1494513407.28.0.645892004666.issue30344@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20Windows%20XP%202.7/builds/150/steps/test/logs/stdio 0:19:29 [214/402/1] test_multiprocessing crashed -- running: test_mmap (43 sec) [0, 0.0] [76985 refs] test test_multiprocessing failed -- Traceback (most recent call last): File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_multiprocessing.py", line 844, in test_notify_all self.assertReturnsIfImplemented(6, get_value, woken) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_multiprocessing.py", line 149, in assertReturnsIfImplemented return self.assertEqual(value, res) AssertionError: 6 != 5 Traceback (most recent call last): File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\runpy.py", line 72, in _run_code exec code in run_globals File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\regrtest.py", line 1882, in main_in_temp_cwd() File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\regrtest.py", line 1869, in main_in_temp_cwd main() File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\contextlib.py", line 35, in __exit__ self.gen.throw(type, value, traceback) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 769, in temp_cwd rmtree(name) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 293, in rmtree _rmtree(path) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 249, in _rmtree _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 202, in _waitfor func(pathname) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 249, in _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\support\__init__.py", line 197, in _force_run return func(*args) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'd:\\cygwin\\home\\db3l\\buildarea\\2.7.bolen-windows\\build\\build\\test_python_2512' ---------- components: Tests, Windows keywords: buildbot messages: 293496 nosy: davin, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_multiprocessing.test_notify_all(): AssertionError: 6 != 5 on x86 Windows XP 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 12:16:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 May 2017 16:16:32 +0000 Subject: [New-bugs-announce] [issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO Message-ID: <1494519392.85.0.668925519236.issue30345@psf.upfronthosting.co.za> New submission from STINNER Victor: cstratak reported the following test failure on Fedora 24 when building Python 3.6 with LTO + PGO: ====================================================================== FAIL: test_threads (test.test_gdb.PyBtTests) Verify that "py-bt" indicates threads that are waiting for the GIL ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.6.1/Lib/test/test_gdb.py", line 783, in test_threads cmds_after_breakpoint=['thread apply all py-bt']) File "/builddir/build/BUILD/Python-3.6.1/Lib/test/test_gdb.py", line 218, in get_stack_trace self.assertEqual(unexpected_errlines, []) AssertionError: Lists differ: ["Python Exception Va[95 chars]nd."] != [] First list contains 2 additional elements. First extra element 0: "Python Exception Variable 'func_obj' not found.: " + [] - ["Python Exception Variable 'func_obj' not found.: ", - "Error occurred in Python command: Variable 'func_obj' not found."] ---------------------------------------------------------------------- ---------- components: Build, Tests messages: 293503 nosy: haypo priority: normal severity: normal status: open title: test_gdb fails on Python 3.6 when built with LTO+PGO versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 13:33:01 2017 From: report at bugs.python.org (Matt Gilson) Date: Thu, 11 May 2017 17:33:01 +0000 Subject: [New-bugs-announce] [issue30346] Odd behavior when unpacking `itertools.groupby` Message-ID: <1494523981.5.0.726129882006.issue30346@psf.upfronthosting.co.za> New submission from Matt Gilson: There is some odd behavior when unpacking the groups from an itertools.groupby result. For example: from itertools import groupby from operator import itemgetter inputs = ((x > 5, x) for x in range(10)) (_, a), (_, b) = groupby(inputs, key=itemgetter(0)) print(list(a)) print(list(b)) On CPython, this results in: [] [(True, 9)] I would expect it to print out 2 empty lists since the second group would have to be consumed to make sure that there isn't another value yielded from groupby (If there was another value to yield, we'd get a ValueError since we couldn't unpack the correct number of items). This is the behavior that PyPy had prior to re-implementing to be consistent with CPython in https://bitbucket.org/pypy/pypy/commits/6093ff1a44e6b17f09db83aa80aea562a738c286 ---------- messages: 293511 nosy: Matt Gilson priority: normal severity: normal status: open title: Odd behavior when unpacking `itertools.groupby` type: behavior versions: Python 3.3, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 11 17:10:21 2017 From: report at bugs.python.org (Armin Rigo) Date: Thu, 11 May 2017 21:10:21 +0000 Subject: [New-bugs-announce] [issue30347] itertools.groupby() can fail a C assert() Message-ID: <1494537021.49.0.31945650773.issue30347@psf.upfronthosting.co.za> New submission from Armin Rigo: This triggers an assert() failure on debug-mode Python (or a leak in release Python): from itertools import groupby def f(n): print("enter:", n) if n == 5: list(b) print("leave:", n) return n != 6 for (k, b) in groupby(range(10), f): print(list(b)) With current trunk we get: python: ./Modules/itertoolsmodule.c:303: _grouper_next: Assertion `gbo->currkey == NULL' failed. ---------- components: Interpreter Core messages: 293517 nosy: arigo priority: normal severity: normal status: open title: itertools.groupby() can fail a C assert() type: crash versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 03:55:56 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 12 May 2017 07:55:56 +0000 Subject: [New-bugs-announce] [issue30348] IDLE: Add fetch completions and get entity unittest Message-ID: <1494575756.78.0.347326025399.issue30348@psf.upfronthosting.co.za> New submission from Louie Lu: Due to #21261, add relative unittest to test_autocomplete.py ---------- assignee: terry.reedy components: IDLE messages: 293531 nosy: louielu, terry.reedy priority: normal severity: normal status: open title: IDLE: Add fetch completions and get entity unittest type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 04:14:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 12 May 2017 08:14:13 +0000 Subject: [New-bugs-announce] [issue30349] Preparation for advanced set syntax in regular expressions Message-ID: <1494576853.44.0.660813121244.issue30349@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently the re module supports only simple sets. They can include literal characters, character ranges, some simple character classes and support the negation. The Unicode standard [1] defines set operations (union, intersection, difference and symmetric difference) and nested sets. Some regular expression engines implemented these features, for example the regex module supports all TR18 features except not-nested POSIX character classes. If replace the re module with the regex module or add support of these features in the re module and make this syntax enabled by default, this will break some code. It is very unlikely the the regular expression contains duplicated characters ('--', '||', '&&' or '~~'), but nested sets uses just '[', and non-escaped '[' is occurred in character sets in regular expressions (even the stdlib contains several occurrences). Proposed patch adds FutureWarnings emitted when possible breaking set construct ('--', '||', '&&', '~~' or '[') is occurred in a regular expression. We need one or two releases with a warning before changing syntax. The patch also makes re.escape() escaping '&' and '~' and fixes several regular expression in the stdlib. Alternatively the support of new set syntax could be enabled by special flag. I'm not sure that the support of set operations and nested sets is necessary. This complicates the syntax of regular expressions (which already is not simple). Currently set operations can be emulated with lookarounds: [set1||set2] -- (?:[set1]|[set2]) [set1&&set2] -- [set1](?<=[set2]) or (?=[set1])[set2] [set1--set2] -- [set1](? _______________________________________ From report at bugs.python.org Fri May 12 05:32:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 May 2017 09:32:47 +0000 Subject: [New-bugs-announce] [issue30350] devguide suggests to use VS 2008 to build Python 2.7, but VS 2008 is no more supported? Message-ID: <1494581567.83.0.310363881682.issue30350@psf.upfronthosting.co.za> New submission from STINNER Victor: Steve Dower wrote this comment on my PR https://github.com/python/cpython/pull/1544 : "Ah, I see. This is fine then - I have very little interest in doing much work to support the old build files (as they are explicitly unsupported)." Copy of my reply: "I have very little interest in doing much work to support the old build files (as they are explicitly unsupported)." Wait wait wait... I fail to follow progress on the Windows build system, so I rely on the devguide which I expect to be up to date, and the guide says: https://docs.python.org/devguide/setup.html#windows-compiling "Python 2.7 uses Microsoft Visual Studio 2008, which is most easily obtained through an MSDN subscription." I have a MSDN account, but after 30 min, I failed to get my MSDN number and I don't know my subscription is still valid or not (well, I guess that, it's expired). It took me 1 hour to find an old ISO of Visual Studio 2008, and not from microsoft.com :-( I didn't want to install VS 2008, but I just followed the devguide. ... Do you mean that VS 2010 must now be used and the devguide is just outdated? Moreover: we do have a buildbot using VS 2008. I'm now trying to fix all buildbots, so I had to fix issues on this VS 2008 buildbot too: http://bugs.python.org/issue30313 But I guess that it's ok to have a buildbot on a system not officially fully supported. ---------- assignee: docs at python components: Build, Documentation, Windows messages: 293536 nosy: docs at python, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: devguide suggests to use VS 2008 to build Python 2.7, but VS 2008 is no more supported? versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 07:29:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 May 2017 11:29:20 +0000 Subject: [New-bugs-announce] [issue30351] regrtest hangs on x86 Windows XP 2.7 Message-ID: <1494588560.82.0.408106199182.issue30351@psf.upfronthosting.co.za> New submission from STINNER Victor: The tests step was killed after a total of 55 min 54 sec, whereas it only took 38 min 40 sec on the previous build 150. regrtest was supposed to log "running: test_threading (xxx sec)" every 30 seconds, but it didn't!? I don't know if the main regrtest process was stuck, or the child process running test_threading was stuck? Or both? http://buildbot.python.org/all/builders/x86%20Windows%20XP%202.7/builds/151/steps/test/logs/stdio test_pty skipped -- No module named fcntl 0:35:45 [400/402] test_pep352 passed -- running: test_threading (448 sec) 0:35:47 [401/402] test_timeit passed -- running: test_threading (450 sec) command timed out: 1200 seconds without output running ['Tools\\buildbot\\test.bat', '-j2'], attempting to kill program finished with exit code 1 elapsedTime=3354.584000 ---------- messages: 293543 nosy: haypo priority: normal severity: normal status: open title: regrtest hangs on x86 Windows XP 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 08:18:04 2017 From: report at bugs.python.org (Edouard KLEIN) Date: Fri, 12 May 2017 12:18:04 +0000 Subject: [New-bugs-announce] [issue30352] The 'in' syntax should work with any object that implements __iter__ Message-ID: <1494591484.03.0.0293719381129.issue30352@psf.upfronthosting.co.za> New submission from Edouard KLEIN: In this StackOverflow question: http://stackoverflow.com/questions/43935187/how-come-an-object-that-implements-iter-is-not-recognized-as-iterable/43935360#43935360 the question of why an object that implements __iter__ through __getattr__ does not work with the "in" syntax is raised. The accepted answer is that the interpreter checks for __iter__ instead of just calling it. If that's the case, I think that: - Either the behaviour of the interpreter should be changed to accept any object that implements __iter__, regardless of how, - Or, if there is a technical reason why the interpreter can't change its behavior, the documentation https://docs.python.org/3/library/stdtypes.html#iterator-types should make it clear that __iter__ must be hard coded into the object. Here is the code of the object that arguably should be iterable but is not: class IterOrNotIter: def __init__(self): self.f = open('/tmp/toto.txt') def __getattr__(self, item): try: return self.__getattribute__(item) except AttributeError: return self.f.__getattribute__(item) IterOrNotIter().__iter__().__next__() # Works 'a' in IterOrNotIter() # Raises a TypeError ---------- components: Interpreter Core messages: 293547 nosy: Edouard KLEIN priority: normal severity: normal status: open title: The 'in' syntax should work with any object that implements __iter__ type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 12:19:48 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 12 May 2017 16:19:48 +0000 Subject: [New-bugs-announce] [issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit Message-ID: <1494605988.92.0.550577143248.issue30353@psf.upfronthosting.co.za> New submission from Erik Bray: The test ctypes.test.test_structures.StructureTestCase.test_pass_by_value fails on 64-bit Cygwin and MinGW using the system libffi with: ====================================================================== FAIL: test_pass_by_value (ctypes.test.test_structures.StructureTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/embray/src/python/cpython/Lib/ctypes/test/test_structures.py", line 416, in test_pass_by_value self.assertEqual(s.first, 0xdeadbeef) AssertionError: 195948557 != 3735928559 It seems that libffi does not handle passing structs by value properly on those platforms as I explained here: https://github.com/libffi/libffi/issues/305 The upstream bug hasn't been confirmed yet by the libffi developers so I could be wrong, but I think this is fairly clearly broken there. I have a PR forthcoming to work around the issue. ---------- components: ctypes messages: 293556 nosy: erik.bray priority: normal severity: normal status: open title: ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 15:40:13 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 May 2017 19:40:13 +0000 Subject: [New-bugs-announce] [issue30354] Change data model documentation to zero-argument super() Message-ID: <1494618013.81.0.516656587156.issue30354@psf.upfronthosting.co.za> New submission from Cheryl Sabella: Update data model documentaion to reflect the zero-argument form of super(). ---------- assignee: docs at python components: Documentation messages: 293566 nosy: csabella, docs at python priority: normal severity: normal status: open title: Change data model documentation to zero-argument super() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 17:26:00 2017 From: report at bugs.python.org (Yann Grisel) Date: Fri, 12 May 2017 21:26:00 +0000 Subject: [New-bugs-announce] [issue30355] Unicode symbols crash lib2to3.parse Message-ID: <1494624360.33.0.637905256361.issue30355@psf.upfronthosting.co.za> New submission from Yann Grisel: The code formatter YAPF relies on lib2to3 to parse the code before formatting it. The function "classify" from "lib2to3/pgen2/parse.py" returns a ParseError when encountering unicode variable names (like ?), which it should not. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 293573 nosy: Yann Grisel priority: normal severity: normal status: open title: Unicode symbols crash lib2to3.parse versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 18:30:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 May 2017 22:30:23 +0000 Subject: [New-bugs-announce] [issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x Message-ID: <1494628223.7.0.0775389696939.issue30356@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/601/steps/test/logs/stdio ====================================================================== FAIL: test_mymanager_context (test.test_multiprocessing_spawn.WithManagerTestMyManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 2232, in test_mymanager_context self.assertEqual(manager._process.exitcode, 0) AssertionError: -15 != 0 ---------------------------------------------------------------------- Ran 277 tests in 667.577s FAILED (failures=1, skipped=24) test test_multiprocessing_spawn failed ---------- components: Tests, Windows messages: 293585 nosy: davin, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 18:35:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 May 2017 22:35:04 +0000 Subject: [New-bugs-announce] [issue30357] test_thread.test_save_exception_state_on_error(): Unhandled exception in thread: AMD64 Debian root 2.7 Message-ID: <1494628504.48.0.976457186073.issue30357@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20Debian%20root%202.7/builds/154/steps/test/logs/stdio 0:04:59 [312/402/1] test_thread failed Traceback (most recent call last): File "/root/buildarea/2.7.angelico-debian-amd64/build/Lib/test/test_thread.py", line 133, in task raise SyntaxError SyntaxError: None test test_thread failed -- Traceback (most recent call last): File "/root/buildarea/2.7.angelico-debian-amd64/build/Lib/test/test_thread.py", line 150, in test_save_exception_state_on_error self.assertIn("Traceback", stderr.getvalue()) AssertionError: 'Traceback' not found in 'Unhandled exception in thread started by \n' ---------- components: Tests messages: 293586 nosy: haypo priority: normal severity: normal status: open title: test_thread.test_save_exception_state_on_error(): Unhandled exception in thread: AMD64 Debian root 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 20:58:34 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 May 2017 00:58:34 +0000 Subject: [New-bugs-announce] [issue30358] Profile documentation - include sort argument for runctx Message-ID: <1494637114.77.0.635635941945.issue30358@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- assignee: docs at python components: Documentation nosy: csabella, docs at python priority: normal severity: normal status: open title: Profile documentation - include sort argument for runctx type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 12 22:48:47 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 13 May 2017 02:48:47 +0000 Subject: [New-bugs-announce] [issue30359] A standard convention for annotating a function as returning an (async) context manager? Message-ID: <1494643727.56.0.6539898445.issue30359@psf.upfronthosting.co.za> New submission from Nathaniel Smith: sphinxcontrib-trio [1] does a few things; one of them is to enhance sphinx's autodoc support by trying to sniff out the types of functions so that it can automatically determine that something is, say, a generator, or an async classmethod. This runs into problems when it comes to context managers, for two reasons. One reason is pretty obvious: the sniffing logic would like to be able to tell by looking at a function that it should be used as a context manager, so that it can document it as such, but there's no reliable way to do this. The other reason is more subtle: the sniffing code has to walk the .__wrapped__ chain in order to detect things like async classmethods, but when it walks the chain for a @contextmanager function, it finds the underlying generator, and ends up thinking that this function should be documented as returning an iterator, which is just wrong. If we can detect context managers, we can know to ignore any Obviously this is always going to be a heuristic process; there's no 100% reliable way to tell what arbitrary wrappers are doing. But the heuristic works pretty well... it's just that right now the method of detecting context manager functions is pretty disgusting: https://github.com/python-trio/sphinxcontrib-trio/blob/2d9e65187dc7a08863b68a78bdee4fb051f0b99e/sphinxcontrib_trio/__init__.py#L80-L90 https://github.com/python-trio/sphinxcontrib-trio/blob/2d9e65187dc7a08863b68a78bdee4fb051f0b99e/sphinxcontrib_trio/__init__.py#L241-L246 So it would be really nice if contextlib.contextmanager somehow marked its functions because: - then I could (eventually) use that marker instead of making assumptions about contextmanager's internals and messing with code objects - then we could (immediately) point to how the standard library does it as a standard for other projects to follow, instead of using this weird sphinxcontrib-trio-specific __returns_contextmanager__ thing that I just made up. I don't really care what the marker is, though I suppose __returns_contextmanager__ = True is as good as anything and has the advantage of a massive installed base (2 projects). [1] http://sphinxcontrib-trio.readthedocs.io/ ---------- components: Library (Lib) messages: 293592 nosy: ncoghlan, njs, yselivanov priority: normal severity: normal status: open title: A standard convention for annotating a function as returning an (async) context manager? versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 00:05:40 2017 From: report at bugs.python.org (brent saner) Date: Sun, 14 May 2017 04:05:40 +0000 Subject: [New-bugs-announce] [issue30360] getpass.getpass() does not except stdin from an Expect script Message-ID: <1494734740.65.0.654665602133.issue30360@psf.upfronthosting.co.za> New submission from brent saner: This is reproducible on both 2.7.13 and 3.6.1. Please refer to the attached files for demonstration. It seems that when I spawn a python script using getpass.getpass() from expect (http://expect.sourceforge.net/ - I'm using version 5.45), the input is not passed. Further, it seems interactive control is handed over to the shell- however, it doesn't actually pass anything to the python script that was spawned, forcing one to break out of the expect process itself. Obviously, the proofs attached require the expect binary to be installed. To test, simply mark "poc.exp" as executable and execute it (assuming poc.py is in the same directory. If not, you'll need to edit line 4 of poc.exp). ---------- components: Library (Lib) files: expect-getpass.poc.tar messages: 293630 nosy: brent saner priority: normal severity: normal status: open title: getpass.getpass() does not except stdin from an Expect script Added file: http://bugs.python.org/file46861/expect-getpass.poc.tar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 05:08:39 2017 From: report at bugs.python.org (Mihai Borobocea) Date: Sun, 14 May 2017 09:08:39 +0000 Subject: [New-bugs-announce] [issue30361] Docs example: converting mixed types to floating point Message-ID: <1494752919.15.0.561616045601.issue30361@psf.upfronthosting.co.za> New submission from Mihai Borobocea: Section 3.1.1 in the Docs states: "operators with mixed type operands convert the integer operand to floating point" https://docs.python.org/3/tutorial/introduction.html But gives an example using the division operator: >>> 3 * 3.75 / 1.5 7.5 >>> 7.0 / 2 3.5 In Python 3, division always returns a float, e.g. when all operands are integers: >>> 3 * 3 / 1 9.0 >>> 7 / 2 3.5 To illustrate that "operators with mixed type operands convert the integer operand to floating point" the example should not use division. For example: >>> 3 * 3.75 - 1 10.25 >>> 7.0 + 2 9.0 ---------- assignee: docs at python components: Documentation messages: 293641 nosy: MihaiHimself, docs at python priority: normal severity: normal status: open title: Docs example: converting mixed types to floating point versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 05:13:17 2017 From: report at bugs.python.org (Steve Barnes) Date: Sun, 14 May 2017 09:13:17 +0000 Subject: [New-bugs-announce] [issue30362] Launcher add list and list with paths options Message-ID: <1494753197.17.0.253655325044.issue30362@psf.upfronthosting.co.za> New submission from Steve Barnes: Currently the launcher will give an error message if a matching python is not found when using the -x.y-bits notation on the command line however the user has to know which python(s) they have available. When some pythons have been installed all user and some specific user only the individual user may well not know which pythons they have available. I would like to suggest adding to the command line -l and -L options for list and Long list options. Each option would populate the installed_pythons list and then -l print the list of usable -x.y-bits options currently available. -L print the list with the paths of the executable files. In either case the launcher should terminate after printing the list. This would be useful for deciding which python(s) to test with and for producing a list to be able to deploy critical updates to all installed pythons. ---------- components: Windows messages: 293642 nosy: Steve Barnes, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Launcher add list and list with paths options type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 08:16:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 May 2017 12:16:10 +0000 Subject: [New-bugs-announce] [issue30363] Backport warnings in the re module to 2.7 Message-ID: <1494764170.53.0.794863715798.issue30363@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The life of 2.7 is so long that our common practice of releasing one or two versions with warnings before removing a feature or changing the behavior in incompatible way doesn't work. People that will start porting to Python 3 in 2020 will be surprised. Proposed patch backports warnings in the re module to 2.7 in py3k mode. Some of these warnings already are converted to errors, but the most important warnings are warnings about changing semantic. '\u' and '\U' have different meaning in 3.3+ (see issue3665). re.split() with potentially empty pattern now emits FutureWarning and will change the behavior in future versions (see issue22818). Warnings about inline flags occurred not at the start of the regular expression (see issue22493 and issue30298) was not backported. Adding them requires changing the fnmatch module, non-trivially changing distutils, and likely will break third-party libraries. Warnings are emitted only when Python is ran with the -3 option, and it is easy to fix regular expressions. ---------- components: Extension Modules, Library (Lib), Regular Expressions messages: 293645 nosy: benjamin.peterson, ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Backport warnings in the re module to 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 10:40:54 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 14 May 2017 14:40:54 +0000 Subject: [New-bugs-announce] [issue30364] Outdated function attribute to disable address sanitizer Message-ID: <1494772854.72.0.607120887618.issue30364@psf.upfronthosting.co.za> New submission from Xiang Zhang: In obmalloc, __attribute__((no_address_safety_analysis)) is used to disable address sanitizer. But this attribute is now deprecated in both clang and GCC. Related links: https://clang.llvm.org/docs/AddressSanitizer.html#disabling-instrumentation-with-attribute-no-sanitize-address https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Function-Attributes.html ---------- messages: 293648 nosy: xiang.zhang priority: normal severity: normal status: open title: Outdated function attribute to disable address sanitizer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 11:38:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 May 2017 15:38:54 +0000 Subject: [New-bugs-announce] [issue30365] Backport warnings in ElementTree/cElementTree modules and fix bugs Message-ID: <1494776334.02.0.442424547765.issue30365@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch add warnings in ElementTree and cElementTree modules (backports issue29204) when run Python with the -3 option and fixes several bugs in the etree package and its tests: The deprecation warning about the doctype() method was emitted when use xml.etree.ElementTree.XMLParser. Now it emitted only when use a subclass of XMLParser with defined doctype() method, as intended. In the test_bug_200708_close test an EchoTarget instance was incorrectly passed to XMLParser() as the html argument and silently ignored. Now it is passed as the target argument. Tests no longer failed when use the -m option for running only selected test methods. Checking warnings now is more specific, warnings are expected only when use deprecated features. ---------- components: Extension Modules, Library (Lib), XML messages: 293652 nosy: benjamin.peterson, eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Backport warnings in ElementTree/cElementTree modules and fix bugs type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 13:46:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 May 2017 17:46:42 +0000 Subject: [New-bugs-announce] [issue30366] Backport tests for test.support to 2.7 Message-ID: <1494784002.11.0.332998677492.issue30366@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch backports tests for test.support to 2.7. test_support.py is an old name of test.support, so the test is renamed to test_test_support.py. The patch also backports few useful functions in test.support for which tests are written. ---------- assignee: serhiy.storchaka components: Tests messages: 293656 nosy: ezio.melotti, haypo, michael.foord, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Backport tests for test.support to 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 14 22:55:39 2017 From: report at bugs.python.org (Nan Zhang) Date: Mon, 15 May 2017 02:55:39 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue30367=5D_Cannot_build_CPyt?= =?utf-8?q?hon3=2E6_with_module_=E2=80=9Ctestcapimodule=E2=80=9D_staticall?= =?utf-8?q?y?= Message-ID: <1494816939.58.0.996227470169.issue30367@psf.upfronthosting.co.za> New submission from Nan Zhang: up vote 0 down vote favorite I am trying to build CPython3.6 from GitHub statically with the Documentation below: https://wiki.python.org/moin/BuildStatically Changed *shared* to *static* And only uncommented the module "testcapimodule" in Modules/Setup file: _testcapi _testcapimodule.c # Python C API test module And ran with 'make LINKFORSHARED=" "' However I got errors that: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -c ./Modules/_testcapimodule.c -o Modules/_testcapimodule.o ./Modules/_testcapimodule.c: In function ?test_datetime_capi?: ./Modules/_testcapimodule.c:2191:9: error: ?PyDateTimeAPI? undeclared (first use in this function) if (PyDateTimeAPI) { ^ ./Modules/_testcapimodule.c:2191:9: note: each undeclared identifier is reported only once for each function it appears in ./Modules/_testcapimodule.c:2203:5: error: ?PyDateTime_IMPORT? undeclared (first use in this function) PyDateTime_IMPORT; ^ ./Modules/_testcapimodule.c:2208:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make: *** [Modules/_testcapimodule.o] Error 1 But when I build Cpython3.6 with *shared*, it can succeed. ---------- components: Build messages: 293664 nosy: Nan Zhang priority: normal severity: normal status: open title: Cannot build CPython3.6 with module ?testcapimodule? statically type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 04:46:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 May 2017 08:46:08 +0000 Subject: [New-bugs-announce] [issue30368] [2.7] OpenSSL compilation fails on AMD64 Windows7 SP1 VS9.0 2.7 Message-ID: <1494837968.88.0.738073393346.issue30368@psf.upfronthosting.co.za> New submission from STINNER Victor: See http://bugs.python.org/issue30350#msg293663 http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%20VS9.0%202.7/builds/83/steps/compile/logs/stdio Build started: Project: _ssl, Configuration: Debug|x64 ... No Perl installation was found. Existing Makefiles are used. ... IOError: [Errno 2] No such file or directory: 'crypto\\buildinf_amd64.h' ---------- assignee: christian.heimes components: Build, SSL, Windows messages: 293687 nosy: christian.heimes, haypo, jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [2.7] OpenSSL compilation fails on AMD64 Windows7 SP1 VS9.0 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 05:54:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 May 2017 09:54:15 +0000 Subject: [New-bugs-announce] [issue30369] test_thread crashed with SIGBUS on AMD64 FreeBSD 10.x Shared 3.6 Message-ID: <1494842055.33.0.428896000784.issue30369@psf.upfronthosting.co.za> New submission from STINNER Victor: SIGBUS on the second gc.collect() call of support.gc_collect() in test_thread. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.6/builds/136/steps/test/logs/stdio 0:07:35 [330/405] test_thread crashed -- running: test_datetime (106 sec) Fatal Python error: Bus error Current thread 0x0000000802372800 (most recent call first): Thread 0x0000000802006400 (most recent call first): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1511 in gc_collect gc.collect() if is_jython: time.sleep(0.1) gc.collect() <~~~~ HERE gc.collect() File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/save_env.py", line 271 in __exit__ support.gc_collect() # Some resources use weak references File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py", line 168 in runtest_inner File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py", line 119 in runtest File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py", line 71 in run_tests_slave File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 475 in _main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 468 in main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 532 in main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/regrtest.py", line 46 in _main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/regrtest.py", line 50 in File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 85 in _run_code File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 193 in _run_module_as_main Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/__main__.py", line 2, in main() File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 532, in main Regrtest().main(tests=tests, **kwargs) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 468, in main self._main(tests, kwargs) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 490, in _main self.run_tests() File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 416, in run_tests run_tests_multiprocess(self) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py", line 221, in run_tests_multiprocess raise Exception(msg) Exception: Child error on test_thread: Exit code -10 *** Error code 1 ---------- components: Tests messages: 293701 nosy: haypo priority: normal severity: normal status: open title: test_thread crashed with SIGBUS on AMD64 FreeBSD 10.x Shared 3.6 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 10:43:43 2017 From: report at bugs.python.org (Taylor Newton) Date: Mon, 15 May 2017 14:43:43 +0000 Subject: [New-bugs-announce] [issue30370] IPython 5.3.0 debug mode breakpoint issue Message-ID: <1494859423.96.0.57016925586.issue30370@psf.upfronthosting.co.za> New submission from Taylor Newton: Hi Python Team, I recently upgraded Python to version 2.7.8 (from 2.6.6) and IPython to version 5.3.0. I noticed that when using the magic command (%run -d) in IPython, subsequent runs of a program seem to fail with a "KeyError", apparently due to the debugger's failure to clear breakpoints from previous runs of the program. I attached a sample of output from one such failed run, where a breakpoint that had been set at line 56 in a previous call caused the program to crash, though in the current call, only one breakpoint at line 70 is requested. For the time being, I've downgraded to IPython version 4.2.0, which seems to work as expected. Cheers, Taylor ---------- files: ipython_error messages: 293712 nosy: Taylor Newton priority: normal severity: normal status: open title: IPython 5.3.0 debug mode breakpoint issue type: crash versions: Python 2.7 Added file: http://bugs.python.org/file46864/ipython_error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 12:17:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 May 2017 16:17:12 +0000 Subject: [New-bugs-announce] [issue30371] test_long_lines() fails randomly on AMD64 Windows7 SP1 3.x Message-ID: <1494865032.78.0.389289612669.issue30371@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/436/steps/test/logs/stdio ====================================================================== FAIL: test_long_lines (test.test_email.test_email.TestFeedParsers) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_email\test_email.py", line 3526, in test_long_lines self.assertEqual(m.get_payload(), 'x'*M*N) AssertionError: 'xxxx[17103482 chars]xxxxxzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[2896464 chars]xxxx' != 'xxxx[17103482 chars]xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[2896464 chars]xxxx' Notice the "z" in "...xxxxxz...". ---------- components: Tests messages: 293721 nosy: barry, haypo, r.david.murray priority: normal severity: normal status: open title: test_long_lines() fails randomly on AMD64 Windows7 SP1 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 12:20:38 2017 From: report at bugs.python.org (Malcolm Smith) Date: Mon, 15 May 2017 16:20:38 +0000 Subject: [New-bugs-announce] [issue30372] Status of __builtins__ is not totally clear Message-ID: <1494865238.41.0.458723699483.issue30372@psf.upfronthosting.co.za> New submission from Malcolm Smith: https://docs.python.org/3.6/reference/executionmodel.html#builtins-and-restricted-execution describes the various things you can do with __builtins__, but then says "Users should not touch __builtins__; it is strictly an implementation detail." If this is so, the entire section should be marked "CPython implementation detail", not just that last paragraph. Elsewhere, https://docs.python.org/3.6/reference/import.html#replacing-the-standard-import-system suggests that the __import__ function could be replaced "at the module level to only alter the behaviour of import statements within that module". Is there any way of doing this other than manipulating the module's __builtins__? If not, this is encouraging the programmer to rely on a CPython implementation detail without marking it as such. ---------- assignee: docs at python components: Documentation messages: 293722 nosy: Malcolm Smith, docs at python priority: normal severity: normal status: open title: Status of __builtins__ is not totally clear versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 13:33:23 2017 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 15 May 2017 17:33:23 +0000 Subject: [New-bugs-announce] [issue30373] Incomplete description of re.LOCALE Message-ID: <1494869603.65.0.652150578672.issue30373@psf.upfronthosting.co.za> New submission from Jakub Wilk: reads: "Make \w, \W, \b, \B, \s and \S dependent on the current locale." But this is not the only thing this flag does. When combined with re.IGNORECASE, it also makes case-insesitive matching locale-dependent. ---------- assignee: docs at python components: Documentation messages: 293726 nosy: docs at python, jwilk priority: normal severity: normal status: open title: Incomplete description of re.LOCALE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 13:48:25 2017 From: report at bugs.python.org (neeverett) Date: Mon, 15 May 2017 17:48:25 +0000 Subject: [New-bugs-announce] [issue30374] Make win_add2path.py take effect without having to log off Message-ID: <1494870505.18.0.0357720836897.issue30374@psf.upfronthosting.co.za> New submission from neeverett: I was trying to add Python to Windows PATH and found this tool. But after I ran it and restarted the Command Prompt, nothing seemed to be changed: Command Prompt still didn't recognize Python codes. Finally I got it done by manually setting the environment variables in Windows System Properties. Then I tried to figure out what was wrong with this script and found that it does not take effect until a reboot or log off. It's not mentioned in the content or output of the script, making it puzzling. The cause of this inconvenience is that though the script changes the env vars, applications don't refer to the new values automatically. It is explained in a Microsoft KB article(http://support.microsoft.com/kb/104011) -- "However, note that modifications to the environment variables do not result in immediate change. For example, if you start another Command Prompt after making the changes, the environment variables will reflect the previous (not the current) values. The changes do not take effect until you log off and then log back on." The article also provided a method to refresh the environment variables immediately -- "To effect these changes without having to log off, broadcast a WM_SETTINGCHANGE message to all windows in the system, so that any interested applications (such as Windows Explorer, Program Manager, Task Manager, Control Panel, and so forth) can perform an update." I am going to create a PR which implements it by using ctypes.windll.user32.SendMessageTimeoutW() to broadcast the WM_SETTINGCHANGE message. ---------- components: Demos and Tools, Windows, ctypes messages: 293727 nosy: neeverett, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Make win_add2path.py take effect without having to log off type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 15:47:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 15 May 2017 19:47:50 +0000 Subject: [New-bugs-announce] [issue30375] Correct stacklevel of warnings when compile regular expressions Message-ID: <1494877670.21.0.548090172972.issue30375@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: When compile a regular expression with groups or conditionals emitted warnings point on lines in the re module implementation rather than the line in user code. >>> import re >>> re.compile('x(?i)') __main__:1: DeprecationWarning: Flags not at the start of the expression x(?i) re.compile('x(?i)', re.IGNORECASE) >>> re.compile('(x(?i))') /home/serhiy/py/cpython/Lib/re.py:281: DeprecationWarning: Flags not at the start of the expression (x(?i)) p = sre_compile.compile(pattern, flags) re.compile('(x(?i))', re.IGNORECASE) >>> re.compile('((x(?i)))') /home/serhiy/py/cpython/Lib/sre_parse.py:889: DeprecationWarning: Flags not at the start of the expression ((x(?i))) p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False) re.compile('((x(?i)))', re.IGNORECASE) Proposed patch fixes this: >>> import re >>> re.compile('x(?i)') __main__:1: DeprecationWarning: Flags not at the start of the expression x(?i) re.compile('x(?i)', re.IGNORECASE) >>> re.compile('(x(?i))') __main__:1: DeprecationWarning: Flags not at the start of the expression (x(?i)) re.compile('(x(?i))', re.IGNORECASE) >>> re.compile('((x(?i)))') __main__:1: DeprecationWarning: Flags not at the start of the expression ((x(?i))) re.compile('((x(?i)))', re.IGNORECASE) ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 293736 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Correct stacklevel of warnings when compile regular expressions type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 15 17:16:05 2017 From: report at bugs.python.org (Ryan Jarvis) Date: Mon, 15 May 2017 21:16:05 +0000 Subject: [New-bugs-announce] [issue30376] Curses documentation refers to incorrect type Message-ID: <1494882965.33.0.779610991751.issue30376@psf.upfronthosting.co.za> New submission from Ryan Jarvis: Currently the Python curses documentation refers to `WindowObject` multiple times in the documentation. The actual type signature is `_curses.curses window`. WindowObject does not exist. Seen at 16.11.1. Textbox objects and curses.initscr() for both Python2 and Python3 documentation. https://docs.python.org/3/library/curses.html https://docs.python.org/2/library/curses.html There is no type information available the curses window object in the documentation. ---------- assignee: docs at python components: Documentation messages: 293740 nosy: Ryan Jarvis, docs at python priority: normal severity: normal status: open title: Curses documentation refers to incorrect type versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 09:08:09 2017 From: report at bugs.python.org (Albert-Jan Nijburg) Date: Tue, 16 May 2017 13:08:09 +0000 Subject: [New-bugs-announce] [issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines Message-ID: <1494940089.25.0.512912878732.issue30377@psf.upfronthosting.co.za> New submission from Albert-Jan Nijburg: While porting tokenize.py to javascript I stumbled upon this. The bit of code that checks if it's a newline or a comment, checks for comment twice. These can be split up, this way the code is a bit more readable. https://github.com/python/cpython/blob/master/Lib/tokenize.py#L560 It's not broken, it's just a bit more complex then it has to be. ---------- components: Library (Lib) messages: 293760 nosy: Albert-Jan Nijburg, meador.inge priority: normal severity: normal status: open title: Unnecessary complexity in tokenize.py around handling of comments and newlines type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 10:23:19 2017 From: report at bugs.python.org (Calvin Cheng) Date: Tue, 16 May 2017 14:23:19 +0000 Subject: [New-bugs-announce] [issue30378] SysLogHandler does not support IPv6 destinations Message-ID: <1494944599.91.0.527371158049.issue30378@psf.upfronthosting.co.za> New submission from Calvin Cheng: The attached test script works fine with IPv4 syslog: $ python test_syslog.py 192.168.1.4 (no errors reported) When running the attached script with python 3.5.2 on Ubuntu 16.04, received the following error: $ python3 test_syslog.py ::1 --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.5/logging/handlers.py", line 908, in emit self.socket.sendto(msg, self.address) socket.gaierror: [Errno -9] Address family for hostname not supported Call stack: File "test_syslog.py", line 16, in logging.info("Test Syslog with IPv6") Message: 'Test Syslog with IPv6' Arguments: () Similar error in python 2.7.10: $ python test_syslog.py ::1 Traceback (most recent call last): File "/usr/lib/python2.7/logging/handlers.py", line 864, in emit self.socket.sendto(msg, self.address) gaierror: [Errno -9] Address family for hostname not supported Logged from file test_syslog.py, line 16 ---------- components: Library (Lib) files: test_syslog.py messages: 293764 nosy: Calvin Cheng priority: normal severity: normal status: open title: SysLogHandler does not support IPv6 destinations type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46865/test_syslog.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 10:58:51 2017 From: report at bugs.python.org (John Schaefer) Date: Tue, 16 May 2017 14:58:51 +0000 Subject: [New-bugs-announce] [issue30379] multiprocessing Array create for ctypes.c_char, TypeError unless 1 char string arg used Message-ID: <1494946731.18.0.80959187038.issue30379@psf.upfronthosting.co.za> New submission from John Schaefer: When creating a multiprocessing Array equivalent for unsigned chars, eg from a numpy.uint8 array, the first argument: typecode_or_type must be specified as a one character string, if a typecode is used the method raises a TypeError. >>> import numpy as np, multiprocessing as mp, ctypes >>> arr = np.array(range(10), dtype=np.uint8) >>> arr array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=uint8) >>> mp.Array("B", arr) >> mp.Array(ctypes.c_char, arr) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/multiprocessing/__init__.py", line 260, in Array return Array(typecode_or_type, size_or_initializer, **kwds) File "/usr/lib/python2.7/multiprocessing/sharedctypes.py", line 120, in Array obj = RawArray(typecode_or_type, size_or_initializer) File "/usr/lib/python2.7/multiprocessing/sharedctypes.py", line 94, in RawArray result.__init__(*size_or_initializer) TypeError: one character string expected This contrasts with behavior exhibited with other types: >>> farr = np.array(range(10), dtype=np.float) >>> mp.Array(ctypes.c_double, farr) _______________________________________ From report at bugs.python.org Tue May 16 13:29:33 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 16 May 2017 17:29:33 +0000 Subject: [New-bugs-announce] [issue30380] Sphinx 1.6.1 raising new warnings in docs build Message-ID: <1494955773.64.0.780886638634.issue30380@psf.upfronthosting.co.za> New submission from Brett Cannon: The Travis file uses `make venv` which does `python3 -m pip install --upgrade sphinx` which is pulling in Sphinx 1.6.1 which was released today (under Python 2.7 the pip call is direct instead of using `make venv`). The problem is that Sphinx 1.6.1 adds some new warnings that then is flagging the docs build as failing. To fix this we should probably stop calling `make venv` in .travis.yml and instead explicitly install Sphinx 1.5.6 for the docs build. Once Travis is green again a separate PR can be done to update `master` to build cleanly under Sphinx 1.6.1. ---------- assignee: docs at python components: Documentation messages: 293775 nosy: brett.cannon, docs at python priority: critical severity: normal status: open title: Sphinx 1.6.1 raising new warnings in docs build versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 18:18:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 May 2017 22:18:35 +0000 Subject: [New-bugs-announce] [issue30381] test_smtpnet.test_connect_using_sslcontext_verified() randomly failed with "smtplib.SMTPServerDisconnected: Connection unexpectedly closed" on AMD64 FreeBSD CURRENT Debug 3.x Message-ID: <1494973115.13.0.770450788292.issue30381@psf.upfronthosting.co.za> New submission from STINNER Victor: See also bpo-30331 (test_poplib) and bpo-30328 (test_ssl): other connection reset on the FreeBSD buildbots. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/272/steps/test/logs/stdio 0:15:55 load avg: 1.77 [387/405/1] test_smtpnet failed -- running: test_subprocess (62 sec) test_connect (test.test_smtpnet.SmtpSSLTest) ... ok test_connect_default_port (test.test_smtpnet.SmtpSSLTest) ... ok test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest) ... ok test_connect_using_sslcontext_verified (test.test_smtpnet.SmtpSSLTest) ... ERROR test_connect_starttls (test.test_smtpnet.SmtpTest) ... ok ====================================================================== ERROR: test_connect_using_sslcontext_verified (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_smtpnet.py", line 77, in test_connect_using_sslcontext_verified server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/smtplib.py", line 1029, in __init__ source_address) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/smtplib.py", line 337, in connect (code, msg) = self.getreply() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/smtplib.py", line 393, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed ---------------------------------------------------------------------- Ran 5 tests in 7.470s FAILED (errors=1) test test_smtpnet failed ---------- assignee: christian.heimes components: SSL, Tests keywords: buildbot messages: 293808 nosy: christian.heimes, haypo, koobs priority: normal severity: normal status: open title: test_smtpnet.test_connect_using_sslcontext_verified() randomly failed with "smtplib.SMTPServerDisconnected: Connection unexpectedly closed" on AMD64 FreeBSD CURRENT Debug 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 19:38:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 May 2017 23:38:36 +0000 Subject: [New-bugs-announce] [issue30382] test_stdin_broken_pipe() of test_asyncio failed randomly on AMD64 FreeBSD CURRENT Non-Debug 3.x Message-ID: <1494977916.79.0.707715566505.issue30382@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/279/steps/test/logs/stdio ====================================================================== FAIL: test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncio/test_subprocess.py", line 213, in test_stdin_broken_pipe self.loop.run_until_complete, coro) AssertionError: (, ) not raised by run_until_complete ---------------------------------------------------------------------- ---------- components: Tests, asyncio messages: 293822 nosy: haypo, yselivanov priority: normal severity: normal status: open title: test_stdin_broken_pipe() of test_asyncio failed randomly on AMD64 FreeBSD CURRENT Non-Debug 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 16 20:21:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 May 2017 00:21:53 +0000 Subject: [New-bugs-announce] [issue30383] [3.5] Backport regrtest features from master to Python 3.5 Message-ID: <1494980513.83.0.0798353664416.issue30383@psf.upfronthosting.co.za> New submission from STINNER Victor: bpo-30283 backported regrtest features from master to Python 2.7. I now propose to do the same for Python 3.5, as suggested by Serhiy Storshaka. ---------- components: Tests messages: 293827 nosy: haypo priority: normal severity: normal status: open title: [3.5] Backport regrtest features from master to Python 3.5 versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 00:03:35 2017 From: report at bugs.python.org (Aaron Meurer) Date: Wed, 17 May 2017 04:03:35 +0000 Subject: [New-bugs-announce] [issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None Message-ID: <1494993815.34.0.567809017687.issue30384@psf.upfronthosting.co.za> New submission from Aaron Meurer: I'm trying to completely hide an exception from the traceback module. From reading the source, it?looks like the only way to do this is to set __traceback__ to None (I can also set __suppress_context__ to True, but that only works if I have another exception higher up in the context chain). However, this still prints the traceback itself, and the line for SyntaxErrors. Consider the attached test.py. It outputs ValueError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 8, in raise TypeError TypeError File "", line 1 a b ^ SyntaxError: unexpected EOF while parsing During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 19, in raise TypeError TypeError I suppose it should also not print the "During handling of the above exception, another exception occurred:" part. ---------- components: Library (Lib) files: test.py messages: 293837 nosy: Aaron.Meurer priority: normal severity: normal status: open title: traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None Added file: http://bugs.python.org/file46867/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 08:40:55 2017 From: report at bugs.python.org (Gunnar Aastrand Grimnes) Date: Wed, 17 May 2017 12:40:55 +0000 Subject: [New-bugs-announce] [issue30385] Segfault on OSX with 3.6.1 Message-ID: <1495024855.04.0.697140063474.issue30385@psf.upfronthosting.co.za> New submission from Gunnar Aastrand Grimnes: This script, using requests and multiprocessing, will segfault on MacOS 16.4.0 with python 3.6.1. In 3.6.0 it runs fine. The program is reduced from a much larger program, some weird things need to be present to trigger the crash. For instance the unused tornado imports on the top. Crash log: Process: Python [1510] Path: /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.6.1 (3.6.1) Code Type: X86-64 (Native) Parent Process: Python [1509] Responsible: Python [1510] User ID: 501 Date/Time: 2017-05-17 14:23:47.307 +0200 OS Version: Mac OS X 10.12.3 (16D32) Report Version: 12 Anonymous UUID: DB16C70B-F979-86B6-864C-0AC84B0E6402 Sleep/Wake UUID: 03D0B108-E764-4834-A88D-7919CAF9B786 Time Awake Since Boot: 630 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.os.log Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000000010b692832 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0] VM Regions Near 0x10b692832: VM_ALLOCATE 000000010b652000-000000010b692000 [ 256K] rw-/rwx SM=COW --> shared memory 000000010b6e3000-000000010b6eb000 [ 32K] r--/rw- SM=SHM Application Specific Information: crashed on child side of fork pre-exec Thread 0 Crashed:: Dispatch queue: com.apple.os.log 0 libsystem_trace.dylib 0x00007fffab4bb622 _os_log_cmp_key + 4 1 libsystem_c.dylib 0x00007fffab324144 rb_tree_find_node + 58 2 libsystem_trace.dylib 0x00007fffab4bbb5a __os_log_create_block_invoke + 30 3 libdispatch.dylib 0x00007fffab2460b8 _dispatch_client_callout + 8 4 libdispatch.dylib 0x00007fffab246cf2 _dispatch_barrier_sync_f_invoke + 83 5 libsystem_trace.dylib 0x00007fffab4bb8ac os_log_create + 590 6 com.apple.SystemConfiguration 0x00007fff9c8faafa __SCDynamicStoreCheckRetryAndHandleError + 167 7 com.apple.SystemConfiguration 0x00007fff9c8f9e12 SCDynamicStoreCopyValue + 189 8 com.apple.SystemConfiguration 0x00007fff9c8fe6fb SCDynamicStoreCopyProxiesWithOptions + 560 9 _scproxy.cpython-36m-darwin.so 0x000000010b536911 get_proxy_settings + 24 10 org.python.python 0x000000010a464081 _PyCFunction_FastCallDict + 526 11 org.python.python 0x000000010a4c87d7 call_function + 489 12 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 13 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 14 org.python.python 0x000000010a4c87ae call_function + 448 15 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 16 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 17 org.python.python 0x000000010a4c87ae call_function + 448 18 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 19 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 20 org.python.python 0x000000010a4c87ae call_function + 448 21 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 22 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 23 org.python.python 0x000000010a4c87ae call_function + 448 24 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 25 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 26 org.python.python 0x000000010a4c87ae call_function + 448 27 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 28 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 29 org.python.python 0x000000010a4c985e _PyFunction_FastCallDict + 444 30 org.python.python 0x000000010a42c4d9 _PyObject_FastCallDict + 196 31 org.python.python 0x000000010a42c5fc _PyObject_Call_Prepend + 156 32 org.python.python 0x000000010a42c35a PyObject_Call + 101 33 org.python.python 0x000000010a4c1825 _PyEval_EvalFrameDefault + 5603 34 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 35 org.python.python 0x000000010a4c0207 PyEval_EvalCodeEx + 52 36 org.python.python 0x000000010a44c493 function_call + 338 37 org.python.python 0x000000010a42c35a PyObject_Call + 101 38 org.python.python 0x000000010a4c1825 _PyEval_EvalFrameDefault + 5603 39 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 40 org.python.python 0x000000010a4c9693 fast_function + 227 41 org.python.python 0x000000010a4c87ae call_function + 448 42 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 43 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 44 org.python.python 0x000000010a4c0207 PyEval_EvalCodeEx + 52 45 org.python.python 0x000000010a44c493 function_call + 338 46 org.python.python 0x000000010a42c35a PyObject_Call + 101 47 org.python.python 0x000000010a4c1825 _PyEval_EvalFrameDefault + 5603 48 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 49 org.python.python 0x000000010a4c0207 PyEval_EvalCodeEx + 52 50 org.python.python 0x000000010a44c493 function_call + 338 51 org.python.python 0x000000010a42c35a PyObject_Call + 101 52 org.python.python 0x000000010a4c1825 _PyEval_EvalFrameDefault + 5603 53 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 54 org.python.python 0x000000010a4c87ae call_function + 448 55 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 56 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 57 org.python.python 0x000000010a4c87ae call_function + 448 58 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 59 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 60 org.python.python 0x000000010a4c87ae call_function + 448 61 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 62 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 63 org.python.python 0x000000010a42c4d9 _PyObject_FastCallDict + 196 64 org.python.python 0x000000010a42c5fc _PyObject_Call_Prepend + 156 65 org.python.python 0x000000010a42c35a PyObject_Call + 101 66 org.python.python 0x000000010a477052 slot_tp_init + 57 67 org.python.python 0x000000010a474072 type_call + 184 68 org.python.python 0x000000010a42c4a4 _PyObject_FastCallDict + 143 69 org.python.python 0x000000010a4c87a7 call_function + 441 70 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 71 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 72 org.python.python 0x000000010a4c87ae call_function + 448 73 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 74 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 75 org.python.python 0x000000010a4c87ae call_function + 448 76 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 77 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 78 org.python.python 0x000000010a4c87ae call_function + 448 79 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 80 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 81 org.python.python 0x000000010a4c985e _PyFunction_FastCallDict + 444 82 org.python.python 0x000000010a42c4d9 _PyObject_FastCallDict + 196 83 org.python.python 0x000000010a42c5fc _PyObject_Call_Prepend + 156 84 org.python.python 0x000000010a42c35a PyObject_Call + 101 85 org.python.python 0x000000010a477052 slot_tp_init + 57 86 org.python.python 0x000000010a474072 type_call + 184 87 org.python.python 0x000000010a42c4a4 _PyObject_FastCallDict + 143 88 org.python.python 0x000000010a42c84a _PyObject_FastCallKeywords + 97 89 org.python.python 0x000000010a4c87a7 call_function + 441 90 org.python.python 0x000000010a4c1665 _PyEval_EvalFrameDefault + 5155 91 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 92 org.python.python 0x000000010a4c9693 fast_function + 227 93 org.python.python 0x000000010a4c87ae call_function + 448 94 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 95 org.python.python 0x000000010a4c992e _PyFunction_FastCall + 121 96 org.python.python 0x000000010a4c87ae call_function + 448 97 org.python.python 0x000000010a4c15ca _PyEval_EvalFrameDefault + 5000 98 org.python.python 0x000000010a4c8fa7 _PyEval_EvalCodeWithName + 1829 99 org.python.python 0x000000010a4c01cd PyEval_EvalCode + 43 100 org.python.python 0x000000010a4e7896 run_mod + 54 101 org.python.python 0x000000010a4e7b76 PyRun_FileExFlags + 180 102 org.python.python 0x000000010a4e7103 PyRun_SimpleFileExFlags + 280 103 org.python.python 0x000000010a4fad40 Py_Main + 3268 104 org.python.python 0x000000010a41fe1d 0x10a41e000 + 7709 105 libdyld.dylib 0x00007fffab27c255 start + 1 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x00007fff557dddf0 rbx: 0x00007fb62371bda0 rcx: 0x0030000000000203 rdx: 0x00007fff557dde20 rdi: 0x000000010b692830 rsi: 0x00007fb62371bda0 rbp: 0x00007fff557ddd90 rsp: 0x00007fff557ddd58 r8: 0x0000000000000001 r9: 0x0000000000000048 r10: 0x00000000ffffffff r11: 0xffffffffb8e7ea1f r12: 0x00007fffb40ccf58 r13: 0x00007fffab4bb61e r14: 0x00007fff557dde20 r15: 0x00007fb62371bdb0 rip: 0x00007fffab4bb622 rfl: 0x0000000000010206 cr2: 0x000000010b692832 Logical CPU: 1 Error Code: 0x00000004 Trap Number: 14 Binary Images: 0x10a41e000 - 0x10a41ffff +org.python.python (3.6.1 - 3.6.1) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python 0x10a422000 - 0x10a589ff7 +org.python.python (3.6.1, [c] 2001-2017 Python Software Foundation. - 3.6.1) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/Python 0x10a93b000 - 0x10a93cfff +_heapq.cpython-36m-darwin.so (0) <54F82A35-6CF9-32FF-A3F3-AF86FA224275> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_heapq.cpython-36m-darwin.so 0x10aa41000 - 0x10aa42fff +_posixsubprocess.cpython-36m-darwin.so (0) <01E6D41B-7379-35E6-92EC-2CC21B6F5A33> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so 0x10aa45000 - 0x10aa48fff +select.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/select.cpython-36m-darwin.so 0x10aa4d000 - 0x10aa52ff7 +math.cpython-36m-darwin.so (0) <33E7F994-B390-3BE1-8198-AFCC28BC0322> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/math.cpython-36m-darwin.so 0x10aa58000 - 0x10aa5bffb +_struct.cpython-36m-darwin.so (0) <87BA4ABD-DA9A-383D-9660-4F49EC6DF92C> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_struct.cpython-36m-darwin.so 0x10aa62000 - 0x10aa62fff +_opcode.cpython-36m-darwin.so (0) <88828C22-AAD7-367B-918F-A3AAF268CCBD> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_opcode.cpython-36m-darwin.so 0x10aa65000 - 0x10aa65ff3 +speedups.cpython-36m-darwin.so (0) /usr/local/lib/python3.6/site-packages/tornado/speedups.cpython-36m-darwin.so 0x10aa69000 - 0x10aaa6267 dyld (421.2) <947FC440-80F9-32F7-A773-6FC418FE1AB7> /usr/lib/dyld 0x10abbd000 - 0x10abc5ff7 +_socket.cpython-36m-darwin.so (0) <4FE83626-F2BC-3C85-B74C-15073CBE43E8> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_socket.cpython-36m-darwin.so 0x10ac0f000 - 0x10ac1affb +_pickle.cpython-36m-darwin.so (0) <6A4A025A-358B-3E21-B00F-1BBF3BE92CC5> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_pickle.cpython-36m-darwin.so 0x10ac24000 - 0x10ac29fff +_json.cpython-36m-darwin.so (0) <5B388CD6-08FA-35FA-A82C-6B980D43F185> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_json.cpython-36m-darwin.so 0x10ac2d000 - 0x10ac32ffb +array.cpython-36m-darwin.so (0) <58EFC65F-637E-351D-83CF-6BBE1ACC4837> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/array.cpython-36m-darwin.so 0x10ac39000 - 0x10ac3cfff +zlib.cpython-36m-darwin.so (0) <20F84555-58E4-3CF3-AF2B-53BED04E60C7> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/zlib.cpython-36m-darwin.so 0x10ad41000 - 0x10ad4bff7 +_datetime.cpython-36m-darwin.so (0) <3F1F8FFB-CEA0-3C66-9D4F-F3BC5B60F725> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_datetime.cpython-36m-darwin.so 0x10ad93000 - 0x10ad9eff7 +_curses.cpython-36m-darwin.so (0) <0E85C94E-7E3F-3AC9-B332-8E373482FF9B> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_curses.cpython-36m-darwin.so 0x10ae26000 - 0x10ae27fff +_bz2.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_bz2.cpython-36m-darwin.so 0x10ae2b000 - 0x10ae2eff7 +_lzma.cpython-36m-darwin.so (0) <08D5A079-150F-31D1-AF9D-34C7CA1810FF> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_lzma.cpython-36m-darwin.so 0x10ae33000 - 0x10ae4fff3 +liblzma.5.dylib (0) /usr/local/opt/xz/lib/liblzma.5.dylib 0x10ae55000 - 0x10ae56fff +grp.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/grp.cpython-36m-darwin.so 0x10ae99000 - 0x10ae9cfff +_hashlib.cpython-36m-darwin.so (0) <3CF81ECB-BFF3-30DD-B7F4-E791ACDE01F3> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so 0x10aea0000 - 0x10aedfff7 +libssl.1.0.0.dylib (0) <79FF0E4D-0C49-3BC1-8885-6BFD213C1C3E> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib 0x10aefc000 - 0x10b06eaf7 +libcrypto.1.0.0.dylib (0) <323A70A1-8F5C-3541-9570-B46743A8CD31> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib 0x10b0e6000 - 0x10b0ebff7 +_blake2.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_blake2.cpython-36m-darwin.so 0x10b0ef000 - 0x10b0fefff +_sha3.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_sha3.cpython-36m-darwin.so 0x10b103000 - 0x10b103fff +_bisect.cpython-36m-darwin.so (0) <4D8C624C-2E17-3CE4-854E-F2EB89A4F5AB> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_bisect.cpython-36m-darwin.so 0x10b106000 - 0x10b107ffb +_random.cpython-36m-darwin.so (0) <38A84988-801D-338A-8E8F-A733F038154B> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_random.cpython-36m-darwin.so 0x10b10a000 - 0x10b10bffb +_multiprocessing.cpython-36m-darwin.so (0) <0801ABBF-9400-3D44-99F5-18BC272C7AFF> /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_multiprocessing.cpython-36m-darwin.so 0x10b10e000 - 0x10b10ffff +fcntl.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/fcntl.cpython-36m-darwin.so 0x10b193000 - 0x10b197fff +_asyncio.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_asyncio.cpython-36m-darwin.so 0x10b25f000 - 0x10b26bfff +_ssl.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so 0x10b278000 - 0x10b27bff7 +binascii.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/binascii.cpython-36m-darwin.so 0x10b450000 - 0x10b45fff7 +_ctypes.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ctypes.cpython-36m-darwin.so 0x10b4aa000 - 0x10b4b1ff7 +libuuid.dylib (0) <13A6DC18-3265-3CA7-8848-2F4A16F6333A> /usr/local/lib/libuuid.dylib 0x10b535000 - 0x10b536fff +_scproxy.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so 0x10b579000 - 0x10b64dff3 +unicodedata.cpython-36m-darwin.so (0) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/unicodedata.cpython-36m-darwin.so 0x7fff95ca7000 - 0x7fff96141fff com.apple.CoreFoundation (6.9 - 1348.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff97c89000 - 0x7fff97d1eff7 com.apple.framework.IOKit (2.0.2 - 1324.30.13) <163BE7FA-B29A-348F-8B5F-E301F2E8C964> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x7fff9c1ad000 - 0x7fff9c4ccfff com.apple.security (7.0 - 57740.31.2) /System/Library/Frameworks/Security.framework/Versions/A/Security 0x7fff9c8f7000 - 0x7fff9c968ff7 com.apple.SystemConfiguration (1.14 - 1.14) /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 0x7fffa9a9a000 - 0x7fffa9a9bff3 libDiagnosticMessagesClient.dylib (102) <422911A4-E273-3E88-BFC4-DF6470E48242> /usr/lib/libDiagnosticMessagesClient.dylib 0x7fffa9cd3000 - 0x7fffa9cd3fff libOpenScriptingUtil.dylib (172) /usr/lib/libOpenScriptingUtil.dylib 0x7fffa9cd9000 - 0x7fffa9cdaff3 libSystem.B.dylib (1238) <9CB018AF-54E9-300F-82BE-81FE553C9154> /usr/lib/libSystem.B.dylib 0x7fffa9df2000 - 0x7fffa9df2ff3 libauto.dylib (187) <5BBF6A00-CC76-389D-84E7-CA88EDADE683> /usr/lib/libauto.dylib 0x7fffa9df3000 - 0x7fffa9e03ff3 libbsm.0.dylib (34) <20084796-B04D-3B35-A003-EA11459557A9> /usr/lib/libbsm.0.dylib 0x7fffa9e04000 - 0x7fffa9e12ff7 libbz2.1.0.dylib (38) <6FD3B63F-0F86-3A25-BD5B-E243F58792C9> /usr/lib/libbz2.1.0.dylib 0x7fffa9e13000 - 0x7fffa9e69ff7 libc++.1.dylib (307.4) /usr/lib/libc++.1.dylib 0x7fffa9e6a000 - 0x7fffa9e94fff libc++abi.dylib (307.2) <1CEF8ABB-7E6D-3C2F-8E0A-E7884478DD23> /usr/lib/libc++abi.dylib 0x7fffa9ebc000 - 0x7fffa9ebcff7 libcoretls.dylib (121.31.1) /usr/lib/libcoretls.dylib 0x7fffa9ebd000 - 0x7fffa9ebeff3 libcoretls_cfhelpers.dylib (121.31.1) <6F37C5AD-7999-3D31-A52F-7AEED935F32D> /usr/lib/libcoretls_cfhelpers.dylib 0x7fffaa2c9000 - 0x7fffaa2c9fff libenergytrace.dylib (15) /usr/lib/libenergytrace.dylib 0x7fffaa3d2000 - 0x7fffaa5f7ffb libicucore.A.dylib (57149.0.1) <6B5FDA93-AA88-318F-9608-C2A33D602EC7> /usr/lib/libicucore.A.dylib 0x7fffaa5ff000 - 0x7fffaa618ffb liblzma.5.dylib (10) <44BD0279-99DD-36B5-8A6E-C11432E2098D> /usr/lib/liblzma.5.dylib 0x7fffaa8d8000 - 0x7fffaa909ffb libncurses.5.4.dylib (51.30.1) /usr/lib/libncurses.5.4.dylib 0x7fffaa90a000 - 0x7fffaa983ff7 libnetwork.dylib (856.30.16) <66C6E4D6-B39C-3309-80C1-CBBE170DDD51> /usr/lib/libnetwork.dylib 0x7fffaa984000 - 0x7fffaad54d97 libobjc.A.dylib (706) /usr/lib/libobjc.A.dylib 0x7fffaad57000 - 0x7fffaad5bfff libpam.2.dylib (21.30.1) <71EB0D88-DE84-3C8D-A2C5-58AA282BC5BC> /usr/lib/libpam.2.dylib 0x7fffaad5c000 - 0x7fffaad8cff7 libpcap.A.dylib (67) <450DB888-2C0C-3085-A5F1-69324DFE902C> /usr/lib/libpcap.A.dylib 0x7fffaae16000 - 0x7fffaaf5efe3 libsqlite3.dylib (253) /usr/lib/libsqlite3.dylib 0x7fffab053000 - 0x7fffab060fff libxar.1.dylib (357) <58BFB84B-66FE-3299-AA3D-BBA178ADEE39> /usr/lib/libxar.1.dylib 0x7fffab064000 - 0x7fffab153ffb libxml2.2.dylib (30.11) /usr/lib/libxml2.2.dylib 0x7fffab17e000 - 0x7fffab18fff3 libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib 0x7fffab19e000 - 0x7fffab1a2ff7 libcache.dylib (79) <0C8092D3-600F-3ADD-A036-F225B6CDCA43> /usr/lib/system/libcache.dylib 0x7fffab1a3000 - 0x7fffab1aeff7 libcommonCrypto.dylib (60092.30.2) /usr/lib/system/libcommonCrypto.dylib 0x7fffab1af000 - 0x7fffab1b6fff libcompiler_rt.dylib (62) /usr/lib/system/libcompiler_rt.dylib 0x7fffab1b7000 - 0x7fffab1bffff libcopyfile.dylib (138) <64E285D9-5485-333B-AEE7-8B0C8FB9275F> /usr/lib/system/libcopyfile.dylib 0x7fffab1c0000 - 0x7fffab243fdf libcorecrypto.dylib (442.30.20) <2074B932-FD79-30A9-8E90-AF25C49F2AF1> /usr/lib/system/libcorecrypto.dylib 0x7fffab244000 - 0x7fffab276fff libdispatch.dylib (703.30.5) /usr/lib/system/libdispatch.dylib 0x7fffab277000 - 0x7fffab27cff3 libdyld.dylib (421.2) <6F506653-FFF6-3DB8-84F1-109AE3C52F32> /usr/lib/system/libdyld.dylib 0x7fffab27d000 - 0x7fffab27dffb libkeymgr.dylib (28) <1A318923-1200-3B06-B432-5007D82F195D> /usr/lib/system/libkeymgr.dylib 0x7fffab27e000 - 0x7fffab28affb libkxld.dylib (3789.41.3) <87550136-9353-348B-9CD9-C342B48C5AAF> /usr/lib/system/libkxld.dylib 0x7fffab28b000 - 0x7fffab28bfff liblaunch.dylib (972.30.7) <15FACC21-079A-3BDF-9AFB-4253EFDEB587> /usr/lib/system/liblaunch.dylib 0x7fffab28c000 - 0x7fffab291fff libmacho.dylib (894) /usr/lib/system/libmacho.dylib 0x7fffab292000 - 0x7fffab294ff3 libquarantine.dylib (85) /usr/lib/system/libquarantine.dylib 0x7fffab295000 - 0x7fffab296ffb libremovefile.dylib (45) /usr/lib/system/libremovefile.dylib 0x7fffab297000 - 0x7fffab2afff7 libsystem_asl.dylib (349.30.2) /usr/lib/system/libsystem_asl.dylib 0x7fffab2b0000 - 0x7fffab2b0ff7 libsystem_blocks.dylib (67) /usr/lib/system/libsystem_blocks.dylib 0x7fffab2b1000 - 0x7fffab33efef libsystem_c.dylib (1158.30.7) <2F881962-03CB-3B9D-A782-D98C1BBA4E3D> /usr/lib/system/libsystem_c.dylib 0x7fffab33f000 - 0x7fffab342ffb libsystem_configuration.dylib (888.30.2) <4FE3983C-E4ED-3939-A578-03AD29C99788> /usr/lib/system/libsystem_configuration.dylib 0x7fffab343000 - 0x7fffab346fff libsystem_coreservices.dylib (41.4) <1A572B9E-0C47-320F-8C64-7990D0A5FB5A> /usr/lib/system/libsystem_coreservices.dylib 0x7fffab347000 - 0x7fffab35fff3 libsystem_coretls.dylib (121.31.1) <4676F06D-274D-31BE-B61C-4D7A4AEF4858> /usr/lib/system/libsystem_coretls.dylib 0x7fffab360000 - 0x7fffab366fff libsystem_dnssd.dylib (765.30.11) /usr/lib/system/libsystem_dnssd.dylib 0x7fffab367000 - 0x7fffab390ff7 libsystem_info.dylib (503.30.1) <9ED9121C-F111-3FAD-BC2F-C95DEE1C9362> /usr/lib/system/libsystem_info.dylib 0x7fffab391000 - 0x7fffab3b3ff7 libsystem_kernel.dylib (3789.41.3) /usr/lib/system/libsystem_kernel.dylib 0x7fffab3b4000 - 0x7fffab3fbfe7 libsystem_m.dylib (3121.4) <266DB92B-A86F-3691-80FB-1B26AD73CFF3> /usr/lib/system/libsystem_m.dylib 0x7fffab3fc000 - 0x7fffab41aff7 libsystem_malloc.dylib (116.30.3) /usr/lib/system/libsystem_malloc.dylib 0x7fffab41b000 - 0x7fffab472ffb libsystem_network.dylib (856.30.16) <4AE368E9-605D-379D-B04C-2AC7455B8250> /usr/lib/system/libsystem_network.dylib 0x7fffab473000 - 0x7fffab47cff3 libsystem_networkextension.dylib (563.30.15) /usr/lib/system/libsystem_networkextension.dylib 0x7fffab47d000 - 0x7fffab486ff3 libsystem_notify.dylib (165.20.1) /usr/lib/system/libsystem_notify.dylib 0x7fffab487000 - 0x7fffab48ffe7 libsystem_platform.dylib (126.1.2) <3CA06D4E-C00A-36DE-AA65-3A390097D1F6> /usr/lib/system/libsystem_platform.dylib 0x7fffab490000 - 0x7fffab49aff7 libsystem_pthread.dylib (218.30.1) /usr/lib/system/libsystem_pthread.dylib 0x7fffab49b000 - 0x7fffab49eff7 libsystem_sandbox.dylib (592.31.1) <7BBFDF96-293F-3DD9-B3A4-7C168280B441> /usr/lib/system/libsystem_sandbox.dylib 0x7fffab49f000 - 0x7fffab4a0fff libsystem_secinit.dylib (24) <5C1F1E47-0F7D-3E25-8DEB-D9DB1F902281> /usr/lib/system/libsystem_secinit.dylib 0x7fffab4a1000 - 0x7fffab4a8fff libsystem_symptoms.dylib (532.30.6) <5D990CF5-B58F-39F7-B375-99B4EC62CFBD> /usr/lib/system/libsystem_symptoms.dylib 0x7fffab4a9000 - 0x7fffab4c9ff7 libsystem_trace.dylib (518.30.7) <6D34D1EA-2A3C-3D2D-803E-A666E6AEEE52> /usr/lib/system/libsystem_trace.dylib 0x7fffab4ca000 - 0x7fffab4cfffb libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib 0x7fffab4d0000 - 0x7fffab4f9ff7 libxpc.dylib (972.30.7) <65E41BB6-EBD5-3D93-B0BE-B190CEE4DD93> /usr/lib/system/libxpc.dylib External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 871 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=139.6M resident=0K(0%) swapped_out_or_unallocated=139.6M(100%) Writable regions: Total=76.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=76.8M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Activity Tracing 256K 2 Dispatch continuations 8192K 2 Kernel Alloc Once 8K 2 MALLOC 40.7M 14 MALLOC guard page 16K 4 MALLOC_LARGE (reserved) 128K 2 reserved VM address space (unallocated) STACK GUARD 4K 2 Stack 17.5M 5 Stack Guard 12K 4 VM_ALLOCATE 10.0M 25 __DATA 4416K 100 __LINKEDIT 112.5M 39 __TEXT 27.1M 99 __UNICODE 556K 2 shared memory 44K 5 =========== ======= ======= TOTAL 221.1M 292 TOTAL, minus reserved VM space 221.0M 292 Model: MacBookPro12,1, BootROM MBP121.0167.B21, 2 processors, Intel Core i5, 2,9 GHz, 16 GB, SMC 2.28f7 Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464232333241314D412D4A442D460000 Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464232333241314D412D4A442D460000 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.21.171.68.1a5) Bluetooth: Version 5.0.3f1, 3 services, 17 devices, 1 incoming serial ports Network Service: Wi-Fi, AirPort, en0 Serial ATA Device: APPLE SSD SM0512G, 500,28 GB USB Device: USB 3.0 Bus USB Device: Hub USB Device: Hub USB Device: Bluetooth USB Host Controller USB Device: Hub USB Device: Microsoft USB Optical Mouse USB Device: USB2.0 Hub USB Device: daskeyboard USB Device: Hub Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1 ---------- components: macOS files: request_multiprocessing_crash.py messages: 293849 nosy: gromgull, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Segfault on OSX with 3.6.1 type: crash versions: Python 3.6 Added file: http://bugs.python.org/file46868/request_multiprocessing_crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 09:57:53 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 17 May 2017 13:57:53 +0000 Subject: [New-bugs-announce] [issue30386] Add a build infrastructure for Android Message-ID: <1495029473.85.0.224153889861.issue30386@psf.upfronthosting.co.za> New submission from Xavier de Gaye: This PR adds a build infrastructure for Android on linux that allows a developer to check that source code changes do not break the existing state of this support by testing the changes on Android with a simple command. For example after a change to the socket module: $ /path/to/python_src/Android/makesetup && make python PYTHON_ARGS="-m test test_socket" The README in the PR describes how to install the Android NDK and SDK, how to cross-compile Python, how to run python interactively or to run the Python test suite on the emulator, how to debug python on the emulator with gdb. This build system has been tested with android-ndk-r13 and android-ndk-r14 which is the latest stable release of the NDK. UnifiedHeaders [1] introduced in android-ndk-r14 is not yet used by this version of the build system. [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md ---------- components: Cross-Build messages: 293852 nosy: Alex.Willmer, haypo, martin.panter, ncoghlan, xdegaye priority: normal severity: normal stage: patch review status: open title: Add a build infrastructure for Android type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 11:01:59 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 17 May 2017 15:01:59 +0000 Subject: [New-bugs-announce] [issue30387] warning of threading_cleanup in test_threading Message-ID: <1495033319.08.0.193009058305.issue30387@psf.upfronthosting.co.za> New submission from Xiang Zhang: Running test_threading throws a warning now. ./python -m test test_threading Run tests sequentially 0:00:00 load avg: 0.22 [1/1] test_threading Warning -- threading_cleanup() failed to cleanup 0 threads after 2 sec (count: 0, dangling: 21) 1 test OK. Total duration: 13 sec Tests result: SUCCESS Seems related to 79ef7f8e88a4972c4aecf95cfc5cd934f1861e08. ---------- components: Tests messages: 293857 nosy: haypo, xiang.zhang priority: normal severity: normal status: open title: warning of threading_cleanup in test_threading _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 12:03:55 2017 From: report at bugs.python.org (Forest Gregg) Date: Wed, 17 May 2017 16:03:55 +0000 Subject: [New-bugs-announce] [issue30388] ndbm can't iterate through values on OS X Message-ID: <1495037035.06.0.766456965201.issue30388@psf.upfronthosting.co.za> New submission from Forest Gregg: On Mac OS 10.12.4, a large shelve, backed by ndbm, can be created. But when I attempt to iterate through the values of the shelve it raises this exception: File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/dedupe/api.py", line 281, in _blockData for block in viewvalues(blocks): File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_collections_abc.py", line 693, in __iter__ for key in self._mapping: File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/shelve.py", line 95, in __iter__ for k in self.dict.keys(): SystemError: Negative size passed to PyBytes_FromStringAndSize I've confirmed that this works with Python 3.6.1. All the Python versions were installed from homebrew. I cannot reproduce on linux on windows machines. I've attached a zip file of the ndbm files that python created. ---------- components: Library (Lib) files: ndbm.zip messages: 293858 nosy: Forest Gregg priority: normal severity: normal status: open title: ndbm can't iterate through values on OS X versions: Python 3.5 Added file: http://bugs.python.org/file46872/ndbm.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 13:54:52 2017 From: report at bugs.python.org (Steve Dower) Date: Wed, 17 May 2017 17:54:52 +0000 Subject: [New-bugs-announce] [issue30389] distutils._msvccompiler cannot find VS 2017 Message-ID: <1495043692.59.0.408402212012.issue30389@psf.upfronthosting.co.za> New submission from Steve Dower: Visual Studio 2017 (including VC 14.1) cannot be discovered by the old registry key method. There is a new method that requires instantiating a COM class and querying for all installs, then selecting one. My pyfindvs library (https://github.com/zooba/pyfindvs) can find a VS 2017 installation, and I propose porting the core C function into Python so that distutils._msvccompiler can use it. This would be internal and not for public use (except via the normal build_ext API). ---------- assignee: steve.dower components: Distutils, Windows messages: 293862 nosy: dstufft, merwok, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: patch review status: open title: distutils._msvccompiler cannot find VS 2017 type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 13:56:45 2017 From: report at bugs.python.org (Decorater) Date: Wed, 17 May 2017 17:56:45 +0000 Subject: [New-bugs-announce] [issue30390] Document how to make classes in the C API. Message-ID: <1495043805.38.0.403862403913.issue30390@psf.upfronthosting.co.za> New submission from Decorater: On the C API, it tells how to make modules, functions, variables, and other things, but what about classes? Like for example if you wanted to make a class with all of the methods having to use direct C Code which would then be converted to PyObject *'s for returning the information the C Code would normally return. Not only that but also being able to create class instance variables using the C API as well. Like for example here is an example class (As it would be if it was written in python): class Example: def __init__(self): self.data = None # None being a place holder for now. def somefunction(self): # C Code here. self.data = ret # return value for the C Code. return self.data Yes, there are better ways than writing the return data to the instance variable and returning it. That is just an example, I have classes that uses them for other things that does not return anything making the instance variables be the only way to get the data. But yeah long story short I think creating classes with the C API should be documented if not already, or at least an example of doing one to be added as an guide for others wondering how to use the C API to make their own (non exception) classes. ---------- assignee: docs at python components: Documentation, Extension Modules messages: 293863 nosy: Decorater, docs at python priority: normal severity: normal status: open title: Document how to make classes in the C API. versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 15:07:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 May 2017 19:07:04 +0000 Subject: [New-bugs-announce] [issue30391] test_socketserver killed after 15 min on AMD64 FreeBSD 10.x Shared 3.6 Message-ID: <1495048024.31.0.0717718671213.issue30391@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.6/builds/142/steps/test/logs/stdio ... 0:10:10 [396/405] test_pulldom passed -- running: test_socketserver (487 sec) 0:10:11 [397/405] test_dictcomps passed -- running: test_socketserver (488 sec) 0:10:11 [398/405] test_support passed -- running: test_socketserver (488 sec) 0:10:22 [399/405] test_email passed -- running: test_socketserver (499 sec) 0:10:44 [400/405] test_buffer passed -- running: test_socketserver (521 sec), test_concurrent_futures (40 sec), test_datetime (49 sec) 0:10:53 [401/405] test_ftplib passed -- running: test_socketserver (530 sec), test_concurrent_futures (49 sec), test_datetime (58 sec) 0:10:55 [402/405] test_ucn passed -- running: test_socketserver (532 sec), test_concurrent_futures (51 sec), test_datetime (60 sec) fetching http://www.pythontest.net/unicode/9.0.0/NamedSequences.txt ... 0:11:09 [403/405] test_concurrent_futures passed (65 sec) -- running: test_socketserver (546 sec), test_datetime (74 sec) 0:11:16 [404/405] test_datetime passed (81 sec) -- running: test_socketserver (553 sec) running: test_socketserver (583 sec) running: test_socketserver (613 sec) running: test_socketserver (643 sec) running: test_socketserver (673 sec) running: test_socketserver (703 sec) running: test_socketserver (733 sec) running: test_socketserver (763 sec) running: test_socketserver (793 sec) running: test_socketserver (823 sec) running: test_socketserver (853 sec) running: test_socketserver (883 sec) 0:17:04 [405/405] test_socketserver crashed Timeout (0:15:00)! Thread 0x0000000802006400 (most recent call first): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/threading.py", line 295 in wait File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/threading.py", line 551 in wait File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 369 in wait_done File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 341 in __init__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 362 in __init__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 307 in test_threading_handled File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/case.py", line 601 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/case.py", line 649 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/unittest/runner.py", line 176 in run File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1889 in _run_suite File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1923 in run_unittest File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py", line 164 in test_runner File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py", line 165 in runtest_inner File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py", line 119 in runtest File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py", line 71 in run_tests_slave File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 475 in _main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 468 in main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 532 in main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/regrtest.py", line 46 in _main File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/regrtest.py", line 50 in File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 85 in _run_code File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 193 in _run_module_as_main Traceback (most recent call last): File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/__main__.py", line 2, in main() File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 532, in main Regrtest().main(tests=tests, **kwargs) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 468, in main self._main(tests, kwargs) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 490, in _main self.run_tests() File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/main.py", line 416, in run_tests run_tests_multiprocess(self) File "/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py", line 221, in run_tests_multiprocess raise Exception(msg) Exception: Child error on test_socketserver: Exit code 1 *** Error code 1 Stop. make: stopped in /usr/home/buildbot/python/3.6.koobs-freebsd10/build program finished with exit code 1 elapsedTime=1026.162135 ---------- components: Tests keywords: buildbot messages: 293879 nosy: haypo priority: normal severity: normal status: open title: test_socketserver killed after 15 min on AMD64 FreeBSD 10.x Shared 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 15:44:16 2017 From: report at bugs.python.org (Andrew Jaffe) Date: Wed, 17 May 2017 19:44:16 +0000 Subject: [New-bugs-announce] [issue30392] default webbrowser macOS Sierra 10.12.5 Message-ID: <1495050256.02.0.645481549853.issue30392@psf.upfronthosting.co.za> Changes by Andrew Jaffe : ---------- components: Library (Lib), macOS nosy: Andrew.Jaffe, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: default webbrowser macOS Sierra 10.12.5 type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 17:37:35 2017 From: report at bugs.python.org (wmayner) Date: Wed, 17 May 2017 21:37:35 +0000 Subject: [New-bugs-announce] [issue30393] test_readline hangs Message-ID: <1495057055.24.0.281941215032.issue30393@psf.upfronthosting.co.za> New submission from wmayner: I'm trying to build Python 3.6.1 from source with the `--enable-optimizations` configuration option. As I understand it, this entails running and profiling all the tests for PGO. When `test_readline` is run, it hangs. OS: Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux Please let me know what other information I should provide. ---------- components: Tests messages: 293888 nosy: wmayner priority: normal severity: normal status: open title: test_readline hangs type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 19:25:01 2017 From: report at bugs.python.org (Joel Hillacre) Date: Wed, 17 May 2017 23:25:01 +0000 Subject: [New-bugs-announce] [issue30394] smtplib leaves open sockets around if SMTPConnectError is raised in __init__ Message-ID: <1495063501.64.0.551060830389.issue30394@psf.upfronthosting.co.za> New submission from Joel Hillacre: I am encountering a ResourceWarning about an unclosed socket when getting a non 220 response during connect() in __init__() of smtplib.SMTP. Attached are a client script causing this warning for me, a server script to cause the client to the warning and a patch that fixes the warning for me. My python version is Python 3.6.1 (default, Apr 7 2017, 09:32:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux. I had found previous related issue with similar symptom and remedy in issue #21641. $ python3.6 test_server.py connected by ('127.0.0.1', 53630) $ $ python3.6 test_client.py Traceback (most recent call last): File "test_client.py", line 2, in smtp = smtplib.SMTP('127.0.0.1', 8025) File "/usr/lib64/python3.6/smtplib.py", line 253, in __init__ raise SMTPConnectError(code, msg) smtplib.SMTPConnectError: (554, b'Nope.') /usr/lib64/python3.6/socket.py:657: ResourceWarning: unclosed $ RFC 2821 states that servers responding with non 220 greetings must not close the connection. It is this behaviour that test_server.py is using to trigger the warning in test_client.py. RFC 2821 Section 3.1 Paragraph 3 https://tools.ietf.org/html/rfc2821#section-3.1 '... a 554 response MAY be given in the initial connection opening message instead of the 220. A server taking this approach MUST still wait for the client to send a QUIT (see section 4.1.1.10) before closing the connection and SHOULD respond to any intervening commands with "503 bad sequence of commands".' The ResourceWarning is no longer caused for me after applying this change. ---------- components: Library (Lib) files: smtplib.patch keywords: patch messages: 293905 nosy: jhillacre priority: normal severity: normal status: open title: smtplib leaves open sockets around if SMTPConnectError is raised in __init__ type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file46873/smtplib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 19:25:58 2017 From: report at bugs.python.org (Louis Brandy) Date: Wed, 17 May 2017 23:25:58 +0000 Subject: [New-bugs-announce] [issue30395] deadlocked child process after forking on pystate.c's head_mutex Message-ID: <1495063558.63.0.859469853078.issue30395@psf.upfronthosting.co.za> New submission from Louis Brandy: A forked process (via os.fork) can inherit a locked `head_mutex` from its parent process and will promptly deadlock in this stack (on my linux box): Child Process (deadlocked): #0 0x00007f1a4da82e3c in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7f1a4c2964e0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205 #1 0x00007f1a4da82e3c in do_futex_wait (sem=sem at entry=0x7f1a4c2964e0, abstime=0x0) at sem_waitcommon.c:111 #2 0x00007f1a4da82efc in __new_sem_wait_slow (sem=0x7f1a4c2964e0, abstime=0x0) at sem_waitcommon.c:181 #3 0x00007f1a4da82fb9 in __new_sem_wait (sem=) at sem_wait.c:29 #4 0x00007f1a4de4c605 in PyThread_acquire_lock_timed (lock=0x7f1a4c2964e0, microseconds=-1, intr_flag=0) at Python/thread_pthread.h:352 #5 0x00007f1a4de4c4b4 in PyThread_acquire_lock (lock=, waitflag=waitflag at entry=1) at Python/thread_pthread.h:556 #6 0x00007f1a4dd59e08 in _PyThreadState_DeleteExcept (tstate=0x7f19f2301800) at Python/pystate.c:483 #7 0x00007f1a4dd46af4 in PyEval_ReInitThreads () at Python/ceval.c:326 #8 0x00007f1a4dd78b0b in PyOS_AfterFork () at ./Modules/signalmodule.c:1608 The parent process has a race between one thread calling `os.fork` (and holding the GIL) and another (in our case C++) thread trying to use PyGILState_Ensure. PyGILState_Ensure will grab the head_mutex before it tries to get the GIL. So if a fork happens in this critical section, the child process will get the locked head_mutex. The path from PyGILState_Ensure -> head_mutex looks like this: #0 new_threadstate (interp=0x7fb5fd483d80, init=init at entry=1) at Python/pystate.c:183 #1 0x00007fb5ff149027 in PyThreadState_New (interp=) at Python/pystate.c:250 #2 0x00007fb5ff006ac7 in PyGILState_Ensure () at Python/pystate.c:838 ---- Possible fix? A simple fix would be to, inside PyOS_AfterFork, reset/unlock pystate.c's head_mutex if it's already locked. Unclear if this is related to: https://bugs.python.org/issue28812 ---------- components: Interpreter Core messages: 293906 nosy: Louis Brandy priority: normal severity: normal status: open title: deadlocked child process after forking on pystate.c's head_mutex versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 17 21:49:31 2017 From: report at bugs.python.org (Decorater) Date: Thu, 18 May 2017 01:49:31 +0000 Subject: [New-bugs-announce] [issue30396] Document the PyClassMethod* C API functions. Message-ID: <1495072171.73.0.812244452186.issue30396@psf.upfronthosting.co.za> New submission from Decorater: The way the documentation currently is set up there is no way to know what these functions in the C API actually do or what all the parameters are to call it unless someone source dives into python. Because of this I think making an C API page or a section for the functions like these or similar capabilities would be an Great an huge help to others as well as an example small module using said PyClassMethod* functions. I will need to look at how far down in python versions that these functions exist for though. ---------- assignee: docs at python components: Documentation, Extension Modules messages: 293907 nosy: Decorater, docs at python priority: normal severity: normal status: open title: Document the PyClassMethod* C API functions. versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 05:17:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 18 May 2017 09:17:51 +0000 Subject: [New-bugs-announce] [issue30397] Expose regular expression and match objects types in the re module Message-ID: <1495099071.76.0.78537158998.issue30397@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds re.Patter and re.Match types (names are conforming with the typing module) that represent the types of compiled regular expressin objects and match objects. The purpose of this is exposing the documentation of the methods of these objects in the module documentation produced by pydoc. The patch also changes the __module__ attribute of these classes and re.error (this enhances the help and repr and increases pickle compatibility of re.error), adds docstrings for re.error and many descriptors, and fixes few other docstrings. ---------- assignee: serhiy.storchaka components: Extension Modules, Library (Lib), Regular Expressions messages: 293914 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Expose regular expression and match objects types in the re module type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 05:44:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 18 May 2017 09:44:45 +0000 Subject: [New-bugs-announce] [issue30398] Add a docstring for re.error Message-ID: <1495100685.75.0.311779362479.issue30398@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: re.error doesn't have its own docstring and inherits it from Exception when format pydoc output: "Common base class for all non-exit exceptions." This is wrong of course. Proposed patch adds a docstring for re.error. It overrides Exception docstring and documents additional re.error attributes. ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 293916 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add a docstring for re.error type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 11:32:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 18 May 2017 15:32:17 +0000 Subject: [New-bugs-announce] [issue30399] Get rid of trailing comma if the repr() of BaseException Message-ID: <1495121537.81.0.536306192808.issue30399@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The repr() of BaseException (and all exceptions that don't override __repr__) with a single argument contains a redundant trailing comma: >>> BaseException('spam') BaseException('spam',) This is just an artefact of the implementation. Proposed patch removes this comma. ---------- components: Interpreter Core messages: 293928 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Get rid of trailing comma if the repr() of BaseException type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 16:22:00 2017 From: report at bugs.python.org (Preston Moore) Date: Thu, 18 May 2017 20:22:00 +0000 Subject: [New-bugs-announce] [issue30400] Race condition in shutil.copyfile() Message-ID: <1495138920.07.0.300372261513.issue30400@psf.upfronthosting.co.za> New submission from Preston Moore: A race condition exists in shutil.copyfile() that allows the file being copied to be replaced between the time it was initially checked with stat() in this function and when it is actually open()'d and copied. This issue can be triggered from shutil.move() (and likely other places) when attempting to move a file from one location to another where the source and destination are on different devices. This behavior can be replicated by setting a catchpoint in gdb on calls to stat() and, after the initial call to stat in shutil.copyfile(), replacing the source file. The attached pull request addresses this issue by storing the inode number of the source file when it is initially stat()'d and comparing this value to an inode value taken from a call to fstat() after the file is open. If these two values differ, the file has been replaced. This is the pattern employed by coreutil's mv utility in an effort to address this issue. This bug was found as part of an ongoing research effort into detecting and addressing bugs caused by differences in the environments in which an application may be run (the environmental issue in this place being the difficulties around correctly copying a file from one disk to another). ---------- components: Library (Lib) messages: 293938 nosy: Preston Moore priority: normal severity: normal status: open title: Race condition in shutil.copyfile() type: security versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 16:55:18 2017 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 18 May 2017 20:55:18 +0000 Subject: [New-bugs-announce] [issue30401] Remove the .bzrignore file Message-ID: <1495140918.07.0.988961408689.issue30401@psf.upfronthosting.co.za> New submission from St?phane Wirtel: Maybe we could remove the .bzrignore file, I don't think we would continue to support a mirror of the repository for Bazaar. ---------- messages: 293941 nosy: matrixise priority: normal severity: normal status: open title: Remove the .bzrignore file versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 18 16:57:29 2017 From: report at bugs.python.org (Dan Snider) Date: Thu, 18 May 2017 20:57:29 +0000 Subject: [New-bugs-announce] [issue30402] Unexpected and/or inconsistent del behavior Message-ID: <1495141049.61.0.154560922326.issue30402@psf.upfronthosting.co.za> New submission from Dan Snider: k = 'k' del [k] That deletes the variable k from the local scope (even though it *looks* like it's trying to delete a list containing 1 element which is equivalent to the variable k). But if using list literals to delete groups of objects is valid, then why not set literals? del {k} raises SyntaxError: can't delete literal The better option imo would be to only allow tuples when del-ing groups of objects, but if list literals are allowed then set literals should be as well. ---------- components: Interpreter Core messages: 293942 nosy: assume_away priority: normal severity: normal status: open title: Unexpected and/or inconsistent del behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 07:20:42 2017 From: report at bugs.python.org (Marcel Plch) Date: Fri, 19 May 2017 11:20:42 +0000 Subject: [New-bugs-announce] [issue30403] Running extension modules using -m switch Message-ID: <1495192842.98.0.357031276673.issue30403@psf.upfronthosting.co.za> New submission from Marcel Plch: Currently the -m switch does not work with extension modules: $ python3 -m math /usr/bin/python3: No code object available for math In order to enable extension modules to behave like Python source modules, the -m switch should be supported. Please, see this proof of concept: https://github.com/Traceur759/cpython/tree/main_c_modules ---------- components: Extension Modules messages: 293954 nosy: Dormouse759 priority: normal severity: normal status: open title: Running extension modules using -m switch type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 11:52:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 19 May 2017 15:52:05 +0000 Subject: [New-bugs-announce] [issue30404] Make stdout and stderr truly unbuffered when run with the -u option Message-ID: <1495209125.34.0.468493818937.issue30404@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In Python 2 when run the interpreter with the -u option the stdout and stderr streams are unbuffered. In Python 3 they become just line-buffered. This is because initially there was no way to create unbuffered text streams. But since Python 3.3 TextIOWrapper supports unbuffered output binary stream and accepts the write_through argument which switch off its own buffering. Proposed patch makes the stdout and stderr streams truly unbuffered when run with the -u option. ---------- components: IO, Interpreter Core messages: 293960 nosy: benjamin.peterson, pitrou, serhiy.storchaka, stutzbach priority: normal severity: normal stage: patch review status: open title: Make stdout and stderr truly unbuffered when run with the -u option type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 15:46:40 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 19 May 2017 19:46:40 +0000 Subject: [New-bugs-announce] [issue30405] PCbuild.bat: register binaries for py launcher Message-ID: <1495223200.37.0.229712024273.issue30405@psf.upfronthosting.co.za> New submission from Terry J. Reedy: While working on patches for python, typing path\repository\PCbuild\win32\python-d.exe is an error-prone pain. I would really like to be able to run locally built binaries with py. Could pcbuild/build.bat register binaries that it successfully builds? And then print the -x.y option needed for py? #30362 would nicely complement this issue. ---------- components: Build, Unicode messages: 293968 nosy: ezio.melotti, haypo, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: PCbuild.bat: register binaries for py launcher type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 17:27:42 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 19 May 2017 21:27:42 +0000 Subject: [New-bugs-announce] [issue30406] async and await should be keywords in 3.7 Message-ID: <1495229262.01.0.300246152317.issue30406@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: According to PEP 492, async and await should be full keywords in Python 3.7, but this hasn't been implemented yet. I have a patch ready that I'll submit as a PR soon. ---------- components: Interpreter Core messages: 293976 nosy: Jelle Zijlstra, giampaolo.rodola, haypo, yselivanov priority: normal severity: normal status: open title: async and await should be keywords in 3.7 versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 17:34:42 2017 From: report at bugs.python.org (kelly hirai) Date: Fri, 19 May 2017 21:34:42 +0000 Subject: [New-bugs-announce] [issue30407] ipaddress ver. 1.0.14 IPv4Network off by 1 Message-ID: <1495229682.89.0.370209437456.issue30407@psf.upfronthosting.co.za> New submission from kelly hirai: for x in ipaddress.IPv4Network(u"192.168.0.0/23").hosts(): print x contains 192.168.1.0 but does not contain 192.168.1.255 ipaddress version 1.0.14 ---------- messages: 293978 nosy: kghongaku priority: normal severity: normal status: open title: ipaddress ver. 1.0.14 IPv4Network off by 1 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 22:38:07 2017 From: report at bugs.python.org (Nam) Date: Sat, 20 May 2017 02:38:07 +0000 Subject: [New-bugs-announce] [issue30408] [defaultdict] default_factory should accept a "key" default parameter (which can be passed my __missing__) Message-ID: <1495247887.3.0.825267700687.issue30408@psf.upfronthosting.co.za> New submission from Nam: currently default_factory does not accept any parameter. This made the default value generated by it constant among keys. If default_factory takes in key as the parameter, it should be able to generate default values based on key, which provide more flexibility to the class defaultdict. ---------- components: Extension Modules messages: 293992 nosy: namtt priority: normal severity: normal status: open title: [defaultdict] default_factory should accept a "key" default parameter (which can be passed my __missing__) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 19 23:41:44 2017 From: report at bugs.python.org (Sean McCully) Date: Sat, 20 May 2017 03:41:44 +0000 Subject: [New-bugs-announce] [issue30409] locale.getpreferredencoding doesn't return result Message-ID: <1495251704.43.0.135851535967.issue30409@psf.upfronthosting.co.za> New submission from Sean McCully: Exception: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 312, in run wheel_cache File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 295, in populate_requirement_set wheel_cache=wheel_cache): File "/usr/lib/python2.7/site-packages/pip/req/req_file.py", line 84, in parse_requirements filename, comes_from=comes_from, session=session File "/usr/lib/python2.7/site-packages/pip/download.py", line 422, in get_file_content content = auto_decode(f.read()) File "/usr/lib/python2.7/site-packages/pip/utils/encoding.py", line 31, in auto_decode return data.decode(locale.getpreferredencoding(False)) TypeError: decode() argument 1 must be string, not None ---------- components: Unicode files: patchset.diff keywords: patch messages: 293995 nosy: ezio.melotti, haypo, seanmccully priority: normal pull_requests: 1767 severity: normal status: open title: locale.getpreferredencoding doesn't return result versions: Python 2.7 Added file: http://bugs.python.org/file46877/patchset.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 04:58:49 2017 From: report at bugs.python.org (Paul Moore) Date: Sat, 20 May 2017 08:58:49 +0000 Subject: [New-bugs-announce] [issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+ Message-ID: <1495270729.75.0.717879181788.issue30410@psf.upfronthosting.co.za> New submission from Paul Moore: The documentation for the encoding of sys.stdin/out/err (see https://docs.python.org/3.6/library/sys.html#sys.stdout) does not reflect the change in Python 3.6 on Windows to use the console Unicode APIs, and hence UTF-8 for the encoding. ---------- assignee: docs at python components: Documentation, Windows keywords: easy messages: 294020 nosy: docs at python, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+ type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 05:29:22 2017 From: report at bugs.python.org (Yuan Liu) Date: Sat, 20 May 2017 09:29:22 +0000 Subject: [New-bugs-announce] [issue30411] git doesn't support "-C" args under 1.8.5 occurs in configure.ac Message-ID: <1495272562.29.0.0547762381804.issue30411@psf.upfronthosting.co.za> New submission from Yuan Liu: git doesn't support "-C" args under 1.8.5 occurs in configure.ac as I noticed from git release notes in 1.8.5: * Just like "make -C ", "git -C ..." tells Git to go there before doing anything else. So we should have some conditional statements in configure.ac around git checkpoint, otherwise we got error message which is : Unknown option: -C usage: git [--version] [--help] [-c name=value] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [] ---------- messages: 294021 nosy: Yuan Liu priority: normal severity: normal status: open title: git doesn't support "-C" args under 1.8.5 occurs in configure.ac versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 08:09:06 2017 From: report at bugs.python.org (adder) Date: Sat, 20 May 2017 12:09:06 +0000 Subject: [New-bugs-announce] [issue30412] mailbox : add option to prevent platform EOL conversion Message-ID: <1495282146.44.0.606172133166.issue30412@psf.upfronthosting.co.za> New submission from adder: The mailbox module will actively convert EOL format from the input mailbox, towards the EOL convention of the platform it is running on. This is wrong. If the mailbox originates from the same platform, as the code is executing on, it is an unnecessary conversion. If the mailbox originates from a different platform, as the code is executing on, it is an incorrect conversion. In general, it is best to be EOL preserving. Please consider a solution which will be backwards compatible, by having an option when opening a mailbox to prevent EOL translations, which defaults to the current behaviour of EOL conversion. That will prevent legacy code from breaking. ---------- components: Library (Lib) messages: 294028 nosy: adder priority: normal severity: normal status: open title: mailbox : add option to prevent platform EOL conversion type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 09:19:02 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 20 May 2017 13:19:02 +0000 Subject: [New-bugs-announce] [issue30413] Add fnmatch.filter_false function Message-ID: <1495286342.86.0.934515673373.issue30413@psf.upfronthosting.co.za> New submission from Steven D'Aprano: There has been some discussion on Python-Ideas about adding fnmatch.filter_false to complement filter, for when you want to ignore matching files rather than non-matching ones. https://mail.python.org/pipermail/python-ideas/2017-May/045694.html I don't believe there have been any strong objections, and work-arounds have a considerable performance penalty (according to the OP, I have not confirmed that). Here's a patch which refactors filter and adds filter_false. Sorry I haven't got my head around the brave new world on Github, so I'm going old school here with a diff :-) ---------- files: filterfalse.diff keywords: patch messages: 294029 nosy: steven.daprano priority: normal severity: normal status: open title: Add fnmatch.filter_false function type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file46879/filterfalse.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 14:26:50 2017 From: report at bugs.python.org (Grzegorz Grzywacz) Date: Sat, 20 May 2017 18:26:50 +0000 Subject: [New-bugs-announce] [issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder Message-ID: <1495304810.94.0.132011659563.issue30414@psf.upfronthosting.co.za> New submission from Grzegorz Grzywacz: multiprocessing.Queue is running background thread feeder. Feeder serialize and sends buffered data to pipe. The issue is with exception handling, feeder is catching all exceptions but out of main loop, so after exception is handled feeder is not going back to loop - thread finish. If feeder thread is not running any Queue.put will execute without exceptions but message not gonna be delivered. Solution is to move exception handling inside main loop. I will provide PR. I have run performance tests (found: #17025) and submitted patch do not affect performance. ---------- components: Library (Lib) messages: 294044 nosy: grzgrzgrz3 priority: normal severity: normal status: open title: multiprocesing.Queue silently ignore messages after exc in _feeder versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 14:36:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 20 May 2017 18:36:49 +0000 Subject: [New-bugs-announce] [issue30415] Improve fnmatch testing Message-ID: <1495305409.35.0.41716780955.issue30415@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds new tests for the fnmatch module. ---------- assignee: serhiy.storchaka components: Tests messages: 294045 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Improve fnmatch testing type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 17:01:37 2017 From: report at bugs.python.org (Andrew Dalke) Date: Sat, 20 May 2017 21:01:37 +0000 Subject: [New-bugs-announce] [issue30416] constant folding opens compiler to quadratic time hashing Message-ID: <1495314097.2.0.680001526088.issue30416@psf.upfronthosting.co.za> New submission from Andrew Dalke: Others have reported issues like #21074 where the peephole compiler generates and discards large strings, and #30293 where it generates multi-MB integers and stores them in the .pyc. This is a different issue. The code: def tuple20(): return ((((((((1,)*20,)*20,)*20,)*20,)*20,)*20,)*20,)*20 takes over four minutes (257 seconds) to compile on my machine. The seemingly larger: def tuple30(): return ((((((((1,)*30,)*30,)*30,)*30,)*30,)*30,)*30,)*30 takes a small fraction of a second to compile, and is equally fast to run. Neither code generates a large data structure. In fact, they only needs about 1K. A sampling profiler of the first case, taken around 30 seconds into the run, shows that nearly all of the CPU time is spent in computing the hash of the highly-nested tuple20, which must visit a very large number of elements even though there are only a small number of unique elements. The call chain is: Py_Main -> PyRun_SimpleFileExFlags -> PyAST_CompileObject -> compiler_body -> compiler_function -> compiler_make_closure -> compiler_add_o -> PyDict_GetItem and then into the tuple hash code. It appears that the peephole optimizer converts the highly-nested tuple20 into a constant value. The compiler then creates the code object with its co_consts. Specifically, compiler_make_closure uses a dictionary to ensure that the elements in co_consts are unique, and mapped to the integer used by LOAD_CONST. It takes about 115 seconds to compute hash(tuple20). I believe the hash is computed twice, once to check if the object is present, and the second to insert it. I suspect most of the other 26 seconds went to computing the intermediate constants in the tuple. Based on the previous issues I highlighted in my first paragraph, I believe this report will be filed under "Doctor, doctor, it hurts when I do this"/"Then don't do it." I see no easy fix, and cannot think of how it would come about in real-world use. I point it out because in reading the various issues related to the peephole optimizer there's a subset of people who propose a look-before-you-leap technical solution of avoiding an optimization where the estimated result is too large. While it does help, it does not avoid all of the negatives of the peephole optimizer, or any AST-based optimizer with similar capabilities. I suspect even most core developers aren't aware of this specific negative. ---------- components: Interpreter Core messages: 294050 nosy: dalke priority: normal severity: normal status: open title: constant folding opens compiler to quadratic time hashing versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 18:06:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 20 May 2017 22:06:09 +0000 Subject: [New-bugs-announce] [issue30417] [buildbot] Disable the cpu resources on slow buildbots Message-ID: <1495317969.47.0.103077871941.issue30417@psf.upfronthosting.co.za> New submission from STINNER Victor: Follow-up of the issue #30314. Copy of Serhiy Storchaka's msg294048: -- test_tools is so slow because it proceeds *all* Python files. This controlled by the "cpu" resource (only 10 random files are chosen if it is disabled). Maybe disable the "cpu" resource on slow buildbots? -- Good point, I like the idea. It seems like regrtest accepts -u all,-cpu option. ---------- components: Tests messages: 294052 nosy: haypo priority: normal severity: normal status: open title: [buildbot] Disable the cpu resources on slow buildbots versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 18:32:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 20 May 2017 22:32:01 +0000 Subject: [New-bugs-announce] [issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x Message-ID: <1495319521.26.0.722559684422.issue30418@psf.upfronthosting.co.za> New submission from STINNER Victor: Hum, the following failing looks like bpo-19612, but it seems like the code took the "raise" path instead of the "pass" fails. try: self.stdin.write(input) <~~~~ HERE except BrokenPipeError: pass # communicate() must ignore broken pipe errors. except OSError as e: if e.errno == errno.EINVAL and self.poll() is not None: # Issue #19612: On Windows, stdin.write() fails with EINVAL # if the process already exited before the write pass else: raise On AMD64 Windows7 SP1 3.x: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/452/steps/test/logs/stdio ... test_communicate (test.test_subprocess.ProcessTestCase) ... ok test_communicate_eintr (test.test_subprocess.ProcessTestCase) ... skipped 'Requires signal.SIGUSR1' test_communicate_epipe (test.test_subprocess.ProcessTestCase) ... ERROR C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py:763: ResourceWarning: subprocess 1780 is still running ResourceWarning, source=self) test_communicate_epipe_only_stdin (test.test_subprocess.ProcessTestCase) ... ok test_communicate_errors (test.test_subprocess.ProcessTestCase) ... ok test_communicate_pipe_buf (test.test_subprocess.ProcessTestCase) ... ok ... ====================================================================== ERROR: test_communicate_epipe (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_subprocess.py", line 1219, in test_communicate_epipe p.communicate(b"x" * 2**20) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 838, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 1072, in _communicate self._stdin_write(input) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 778, in _stdin_write self.stdin.write(input) OSError: [Errno 22] Invalid argument ---------------------------------------------------------------------- Ran 261 tests in 43.540s FAILED (errors=1, skipped=150) test test_subprocess failed ---------- components: Windows messages: 294056 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 19:00:32 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 20 May 2017 23:00:32 +0000 Subject: [New-bugs-announce] [issue30419] Bdb: Update doc page Message-ID: <1495321232.14.0.230718218205.issue30419@psf.upfronthosting.co.za> New submission from Cheryl Sabella: Update bdb docs to reflect issues found in #30211. ---------- assignee: docs at python components: Documentation messages: 294057 nosy: csabella, docs at python, terry.reedy priority: normal severity: normal status: open title: Bdb: Update doc page type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 20 23:29:11 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 21 May 2017 03:29:11 +0000 Subject: [New-bugs-announce] [issue30420] Clarify kwarg handing for subprocess convenience APIs Message-ID: <1495337351.2.0.395497440987.issue30420@psf.upfronthosting.co.za> New submission from Nick Coghlan: As per the discussion in https://github.com/python/cpython/pull/1685, the current nominal signatures of the convenience APIs in subprocess is confusing, as they don't make it clear that all Popen keyword arguments are supported, with only the most common ones being listed in the signature. Proposed fixes: * add `cwd` to the list of frequently used arguments, and list it in the nominal signatures for `run()`, `call()`, `check_call()`, and `check_output()` * append `**popenargs` to the nominal signatures of `run()`, `call()`, and `check_call()` * append `**runargs` to the nominal signature of `check_output()` * amend the prose descriptions for these functions accordingly Background: The status quo is that while this behaviour is documented, it's documented solely as text in the bodies of the API definitions, using paragraphs like the following: `run()`: """The arguments shown above are merely the most common ones, described below in Frequently Used Arguments (hence the use of keyword-only notation in the abbreviated signature). The full function signature is largely the same as that of the Popen constructor - apart from timeout, input and check, all the arguments to this function are passed through to that interface.""" `call()`, `check_call()`: """The arguments shown above are merely the most common ones. The full function signature is largely the same as that of the Popen constructor - this function passes all supplied arguments other than timeout directly through to that interface.""" `check_output()`: """The arguments shown above are merely the most common ones. The full function signature is largely the same as that of run() - most arguments are passed directly through to that interface.""" While it's technically anecdotal, we still have pretty decent evidence that this isn't adequate as: - I worked on the original patch splitting out the "Frequently Used Arguments" section, and initially missed not only that the run() docs had retained that paragraph, but also missed the revised paragraphs in the relocated docs for the older API - as mentioned in the linked PR, Paul Kehrer had missed that `check_call()` and `check_output()` both supported the Popen `cwd` parameter The working theory behind adding the appropriately named `**kwargs` parameters to the end of the nominal signatures is that it will give readers a clearer indication that we're *not* explicitly listing all the parameters, and a hint as to which API to go look at to find out more about the unlisted ones. ---------- assignee: docs at python components: Documentation messages: 294070 nosy: docs at python, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Clarify kwarg handing for subprocess convenience APIs type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 21 04:15:42 2017 From: report at bugs.python.org (Robert Schindler) Date: Sun, 21 May 2017 08:15:42 +0000 Subject: [New-bugs-announce] [issue30421] Relative include of config files Message-ID: <1495354542.35.0.729762114821.issue30421@psf.upfronthosting.co.za> New submission from Robert Schindler: Hi, When one includes an argument file at the command line using argparse and that file contains another include statement, the inner include path is treated as relative to os.getcwd(), what is not the way people expect it to be, I guess. This patch modifies argparse so that it treats paths of files to include as relative to the location of the file the include was made from. I also pulled statements that I think should not be enclosed by the try/except out of it and changed the workflow so that the file descriptor of an include file is closed before another one is opened by the recursive call to _read_args_from_files again.. That way, the number of file descriptors open at a time is kept low. Best regards Robert ---------- components: Library (Lib) files: argparse_relative_includes.patch keywords: patch messages: 294086 nosy: roschi priority: normal severity: normal status: open title: Relative include of config files type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46881/argparse_relative_includes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 21 05:24:22 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 21 May 2017 09:24:22 +0000 Subject: [New-bugs-announce] [issue30422] Add roadmap.txt section to idlelib Message-ID: <1495358662.91.0.337523431285.issue30422@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Idlelib needs a roadmap with a bit of history to help orient new contributors to IDLE as to where I see it going. I am not sure whether to add this to README.txt or make is a separate roadmap.txt file. A rough draft (which started as just an outline ;-): Summary of planned improvements: Fix bugs and selectively add enhancements. Continue improving tests. Modernize code and refactor as needed for other improvements. Convert tk widgets with ttk equivalents to ttk. Convert IDLE from multiple windows to a window with tabbed panes. Recent history relevant to current improvements: * Summer 2010: Pydev discussed whether to remove IDLE (too old) or modernize it. 'Modernize' mostly meant 'use the better-looking ttk widgets' and 'convert IDLE a modern single window app'. The decision was to modernize, but this was mostly blocked from starting at that time. Using ttk dependably requires tcl/tk 8.5. Reorganizing IDLE externally requires internal reorganization that will break 3rd party extensions that use more than the documented extension API. * Winter 2013: PEP 434 formalized the practice of allowing IDLE improvements to be backported even if more of an enhancement than a bug fix. Except for idlelib.idle.*, it also declared idlelib to be a 'private implementation modules'. The intention was to eventually allow refactoring, even if not immediately. 'Big' changes like using ttk and tabbed pane conversion were specifically kept blocked until decided otherwise in further discussion. * Spring 2016: After the required further discussion, which began the previous summer, modernization and refactoring were unblocked for IDLE 3.6+. IDLE 3.6 was allowed to (and now does) require tcl/tk 8.5. Any 3rd-party code that requires 3.5 idlelib can adjust, require Python 3.5, or incorporate 3.5 idlelib. Specific goals for 3.7: * Bug fixes: Some priorities are fix hangs and crashes; continue after exceptions, if possible, instead of exiting; display fatal exceptions in a tk messagebox before exiting. Backport all changes to 3.6. * Unittests: Continue expanding the test/test_idle.py and idlelib/idle_test/ suite begun in Summer 2013. Change code as needed to enable testing. (The May 2016 decision allows this to be done freely.) Ideally, test every patch to prevent regressions. * Dialog appearance and operation: Htests ensure that widget creation code runs and that the 'look and feel' is minimally acceptable. Convert any remaining 'sanity check' code not converted in summer 2014, such as in config.py. Fix some remaining consistency issues. Rework About IDLE and the option dialogs. * Modernizing code: After the May 2016 decisions, modules were renamed to short lowercase PEP8 names. Changes within modules are best done when adding tests (if a module is not already fully tested). Some specifics: - Convert function names to lowercase. - Replace '*' in 'from tkinter import *' with objects. - Convert tkinter submodule imports from the backwards-looking 2to3 conversion. Change 'import tkinter.font as TkFont' to 'from tkinter import font' and replace 'TkFont' with 'font' in the rest of a module. Do the same with messagebox, colorchooser, and simpledialog. - Eliminate unneeded intermediate collections objects (some from 2to3 conversion). Example: 'for k in list(d.keys):' should be 'for k in d:'. [Notes: import * and VALUE versus 'value' are discussed in #30290. Searching idlelib for 'import tkinter.' gets 16 hits.] * Refactoring: Make Editor, PyShell, and Output subclasses of a base text-based window that only has common features. Separate startup code from pyshell. * Ttk widgets: Some windows and dialogs have been converted. Finish. Optional: allow selection of available themes. [Futuristic: create an IDLE theme, possibly based on the Python snake colors, green, blue, and yellow.] * Tabbed panes: Convert any listed toplevel windows with multiple widgets to windows with a frame with multiple widgets. (The help window was specifically designed this way.) Frames can later be moved from the window to a tab. (To do this, text-based frames in menu windows must also be disentangled from the menu.) I would like to have a single window app by 2017, but that is too speculative to list now. ---------- assignee: terry.reedy messages: 294089 nosy: csabella, louielu, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Add roadmap.txt section to idlelib type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 21 09:44:28 2017 From: report at bugs.python.org (Jimmy Lai) Date: Sun, 21 May 2017 13:44:28 +0000 Subject: [New-bugs-announce] [issue30423] [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed." Message-ID: <1495374268.18.0.469758871331.issue30423@psf.upfronthosting.co.za> New submission from Jimmy Lai: Problem: "RuntimeError: Event loop stopped before Future completed." throws when calling run_until_complete(). We investigate and find out some orphan futures stay in the event loop before we run another run_until_complete(another_async_func()). The orphan future has pending state and is attached with _run_until_complete_cb from previous run_until_complete. It happens because the orphan future thrown Exception and then raise, thus remove_done_callback(_run_until_complete_cb) didn't called. Move it to finally section can fix it. With this patch, we stop seeing the Runtime Error. ---------- components: asyncio messages: 294102 nosy: jimmylai, yselivanov priority: normal pull_requests: 1795 severity: normal status: open title: [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed." versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 21 11:42:56 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 21 May 2017 15:42:56 +0000 Subject: [New-bugs-announce] [issue30424] make pydoc-topics fails Message-ID: <1495381376.42.0.658045095039.issue30424@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: Running `make pydoc-topics` in Doc/ on master fails with $ make pydoc-topics sphinx-build -b pydoc-topics -d build/doctrees -D latex_elements.papersize= . build/pydoc-topics Running Sphinx v1.6.1 making output directory... loading pickled environment... not yet created building [mo]: targets for 0 po files that are out of date building [pydoc-topics]: all pydoc topics updating environment: 466 added, 0 changed, 0 removed reading sources... [100%] whatsnew/index looking for now-outdated files... none found pickling environment... done checking consistency... done /Users/jzijlstra-mpbt/py/venvs/venv36/lib/python3.6/site-packages/sphinx/application.py:444: RemovedInSphinx17Warning: app.status_iterator() is now deprecated. Use sphinx.util.status_iterator() instead. RemovedInSphinx17Warning) /Users/jzijlstra-mpbt/py/venvs/venv36/lib/python3.6/site-packages/sphinx/application.py:425: RemovedInSphinx17Warning: app._display_chunk() is now deprecated. Use sphinx.util.display_chunk() instead. RemovedInSphinx17Warning) building topics... [ 1%] assert Exception occurred: File "/Users/jzijlstra-mpbt/py/venvs/venv36/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 129, in create_translator assert translator_class, "translator not found for %s" % self.__class__.__name__ AssertionError: translator not found for PydocTopicsBuilder The full traceback has been saved in /var/folders/nh/ctlmlrjs6sx561k27fgn4btm0000gp/T/sphinx-err-_9ox_985.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. A bug report can be filed in the tracker at . Thanks! make: *** [build] Error 1 I ran into this because some code in Lib/pydoc.py told me to run make pydoc-topics as part of the patch for issue 30406. ---------- messages: 294104 nosy: Jelle Zijlstra, ezio.melotti priority: normal severity: normal status: open title: make pydoc-topics fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 21 15:13:23 2017 From: report at bugs.python.org (Chakrit Rakhuang) Date: Sun, 21 May 2017 19:13:23 +0000 Subject: [New-bugs-announce] [issue30425] Python 3.6.1 (32-bit)_20170522020736.log Message-ID: <1495394003.66.0.824232071766.issue30425@psf.upfronthosting.co.za> New submission from Chakrit Rakhuang: [08B4:3B88][2017-05-22T02:07:36]i001: Burn v3.10.3.3007, Windows v10.0 (Build 15063: Service Pack 0), path: C:\Users\CHAKRI~1\AppData\Local\Temp\{FF4877B7-8096-4550-B901-76C2391DCB87}\.cr\python-3.6.1.exe [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'ActionLikeInstalling' to value 'Installing' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'ActionLikeInstallation' to value 'Setup' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'ShortVersion' to value '3.6' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'ShortVersionNoDot' to value '36' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'WinVer' to value '3.6-32' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'WinVerNoDot' to value '36-32' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'InstallAllUsers' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'InstallLauncherAllUsers' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'TargetDir' to value '' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'DefaultAllUsersTargetDir' to value '[ProgramFilesFolder]Python[WinVerNoDot]' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'TargetPlatform' to value 'x86' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'DefaultJustForMeTargetDir' to value '[LocalAppDataFolder]Programs\Python\Python[WinVerNoDot]' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'OptionalFeaturesRegistryKey' to value 'Software\Python\PythonCore\[WinVer]\InstalledFeatures' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'TargetDirRegistryKey' to value 'Software\Python\PythonCore\[WinVer]\InstallPath' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'DefaultCustomTargetDir' to value '' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'InstallAllUsersState' to value 'enabled' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'InstallLauncherAllUsersState' to value 'enabled' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'CustomInstallLauncherAllUsersState' to value '[InstallLauncherAllUsersState]' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'TargetDirState' to value 'enabled' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'CustomBrowseButtonState' to value 'enabled' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_core' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_exe' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_dev' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_lib' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_test' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_doc' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_tools' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_tcltk' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_pip' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_launcher' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'Include_launcherState' to value 'enabled' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_symbols' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Include_debug' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'LauncherOnly' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'DetectedLauncher' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'DetectedOldLauncher' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'AssociateFiles' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'Shortcuts' to value '1' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'PrependPath' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'CompileAll' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing numeric variable 'SimpleInstall' to value '0' [08B4:3B88][2017-05-22T02:07:36]i000: Initializing string variable 'SimpleInstallDescription' to value '' [08B4:3B88][2017-05-22T02:07:36]i009: Command Line: '"-burn.clean.room=C:\Users\Chakrit Rakhuang\Downloads\Programs\python-3.6.1.exe" -burn.filehandle.attached=648 -burn.filehandle.self=624' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Chakrit Rakhuang\Downloads\Programs\python-3.6.1.exe' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\Chakrit Rakhuang\Downloads\Programs\' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\CHAKRI~1\AppData\Local\Temp\Python 3.6.1 (32-bit)_20170522020736.log' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'WixBundleName' to value 'Python 3.6.1 (32-bit)' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'WixBundleManufacturer' to value 'Python Software Foundation' [08B4:3B88][2017-05-22T02:07:36]i000: Setting numeric variable 'CRTInstalled' to value 1 [08B4:28EC][2017-05-22T02:07:36]i000: Did not find C:\Users\Chakrit Rakhuang\Downloads\Programs\unattend.xml [08B4:28EC][2017-05-22T02:07:36]i000: Setting string variable 'ActionLikeInstalling' to value 'Installing' [08B4:28EC][2017-05-22T02:07:36]i000: Setting string variable 'ActionLikeInstallation' to value 'Setup' [08B4:28EC][2017-05-22T02:07:36]i000: Setting version variable 'WixBundleFileVersion' to value '3.6.1150.0' [08B4:28EC][2017-05-22T02:07:36]i000: Target OS is Windows 7 SP1 or later [08B4:3B88][2017-05-22T02:07:36]i100: Detect begin, 58 packages [08B4:3B88][2017-05-22T02:07:36]i107: Detected forward compatible bundle: {e34f7ef5-06c3-4abe-8410-1e0e5389f730}, type: Upgrade, scope: PerUser, version: 3.6.1150.0, enabled: No [08B4:3B88][2017-05-22T02:07:36]i102: Detected related bundle: {e34f7ef5-06c3-4abe-8410-1e0e5389f730}, type: Upgrade, scope: PerUser, version: 3.6.1150.0, operation: None [08B4:3B88][2017-05-22T02:07:36]e000: Related bundle {e34f7ef5-06c3-4abe-8410-1e0e5389f730} is preventing install [08B4:3B88][2017-05-22T02:07:36]i000: Setting numeric variable 'InstallLauncherAllUsers' to value 1 [08B4:3B88][2017-05-22T02:07:36]i000: Setting numeric variable 'Include_launcher' to value 1 [08B4:3B88][2017-05-22T02:07:36]i000: Setting numeric variable 'DetectedLauncher' to value 1 [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'Include_launcherState' to value 'disable' [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'InstallLauncherAllUsersState' to value 'disable' [08B4:3B88][2017-05-22T02:07:36]i000: Setting numeric variable 'AssociateFiles' to value 1 [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.0_x86, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.0_x64, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.1_x86, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.1_x64, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.2_x86, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.2_x64, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.3_x86, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: crt_14.0_v6.3_x64, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_AllUsers_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_JustForMe_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: core_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: dev_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: dev_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: dev_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: dev_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: exe_AllUsers, feature: DefaultFeature, state: Absent [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: exe_AllUsers, feature: Shortcuts, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_AllUsers_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: exe_JustForMe, feature: DefaultFeature, state: Local [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: exe_JustForMe, feature: Shortcuts, state: Local [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_JustForMe_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: exe_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_AllUsers_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_JustForMe_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: lib_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_AllUsers_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_JustForMe_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: test_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: doc_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: doc_AllUsers, feature: DefaultFeature, state: Absent [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: doc_AllUsers, feature: Shortcuts, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: doc_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: doc_JustForMe, feature: DefaultFeature, state: Local [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: doc_JustForMe, feature: Shortcuts, state: Local [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tools_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tools_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_AllUsers, feature: DefaultFeature, state: Absent [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_AllUsers, feature: AssociateFiles, state: Absent [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_AllUsers, feature: Shortcuts, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_AllUsers_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_AllUsers_pdb, feature: Symbols, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_AllUsers_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_AllUsers_d, feature: DebugBinaries, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_JustForMe, feature: DefaultFeature, state: Local [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_JustForMe, feature: AssociateFiles, state: Local [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_JustForMe, feature: Shortcuts, state: Local [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_JustForMe_pdb, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_JustForMe_pdb, feature: Symbols, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: tcltk_JustForMe_d, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: tcltk_JustForMe_d, feature: DebugBinaries, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: launcher_AllUsers, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: launcher_AllUsers, feature: DefaultFeature, state: Local [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: launcher_AllUsers, feature: AssociateFiles, state: Local [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: launcher_JustForMe, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: launcher_JustForMe, feature: DefaultFeature, state: Absent [08B4:3B88][2017-05-22T02:07:36]i104: Detected package: launcher_JustForMe, feature: AssociateFiles, state: Absent [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: pip_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: pip_JustForMe, state: Present, cached: Complete [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: path_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: path_JustForMe, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileall_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileallO_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileallOO_AllUsers, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileall_JustForMe, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileallO_JustForMe, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i101: Detected package: compileallOO_JustForMe, state: Absent, cached: None [08B4:3B88][2017-05-22T02:07:36]i000: Setting string variable 'TargetDir' to value 'C:\Users\Chakrit Rakhuang\AppData\Local\Programs\Python\Python36-32' [08B4:3B88][2017-05-22T02:07:36]i199: Detect complete, result: 0x0 ---------- components: Windows files: Python 3.6.1 (32-bit)_20170522020736.log messages: 294109 nosy: Chakrit Rakhuang, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python 3.6.1 (32-bit)_20170522020736.log type: crash versions: Python 3.6 Added file: http://bugs.python.org/file46883/Python 3.6.1 (32-bit)_20170522020736.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 03:58:58 2017 From: report at bugs.python.org (jf) Date: Mon, 22 May 2017 07:58:58 +0000 Subject: [New-bugs-announce] [issue30426] why not use the same style func name. eg: int.to_bytes (with underline or not) and array.tobytes(). Message-ID: <1495439938.8.0.0428645941512.issue30426@psf.upfronthosting.co.za> New submission from jf: I note that, some functions have different style names, some have underline, and some not. why do so?? eg: int.to_bytes() and array.tobytes() int.from_byte() and array.frombytes() ZipInfo.from_file() and array.fromfile() ... ---------- components: Library (Lib) messages: 294127 nosy: zaazbb priority: normal severity: normal status: open title: why not use the same style func name. eg: int.to_bytes (with underline or not) and array.tobytes(). versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 04:17:57 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Mon, 22 May 2017 08:17:57 +0000 Subject: [New-bugs-announce] [issue30427] isinstance checks in os.path.normcase redundant with os.fspath Message-ID: <1495441077.08.0.893428733741.issue30427@psf.upfronthosting.co.za> New submission from Wolfgang Maier: os.path.normcase as defined in both posixpath and ntpath is now calling os.fspath on its argument first. With that I think the following isinstance(str, bytes) checks have become redundant since AFAIU os.fspath is guaranteed to return either str or bytes instances. ---------- components: Library (Lib) messages: 294130 nosy: wolma priority: normal severity: normal status: open title: isinstance checks in os.path.normcase redundant with os.fspath versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 06:28:18 2017 From: report at bugs.python.org (Ralph Corderoy) Date: Mon, 22 May 2017 10:28:18 +0000 Subject: [New-bugs-announce] [issue30428] mailbox.MMDF wrongly adds From_ header to file Message-ID: <1495448898.98.0.534406698406.issue30428@psf.upfronthosting.co.za> New submission from Ralph Corderoy: Class mailbox.MMDF supports the MMDF-mail-spool file format. This is a file with zero or more records, each starts and ends with a line of four ASCII SOHs. Within those two lines is an email in RFC 5532 format, i.e. a headers section followed by an optional body. There is no "From_" header before the headers section as used by mbox format. https://docs.python.org/3/library/mailbox.html#mmdf references http://www.tin.org/bin/man.cgi?section=5&topic=mmdf that explains this clearly and gives an example spool file; there is no "From_" header. mailbox.MMDF documents it produces a From_ header and does so. This is wrong. It's wrong in Python 2 too. >>> import mailbox as mb >>> f = mb.MMDF('mail.spool') >>> f.add('Subject: Python Bug.\nFrom: bug at hunter.com\n\nEnds.\n') 0 >>> f.close() >>> print(repr(open('mail.spool').read())) '\x01\x01\x01\x01\nFrom MAILER-DAEMON Mon May 22 10:14:02 2017\nSubject: Python Bug.\nFrom: bug at hunter.com\n\nEnds.\n\n\x01\x01\x01\x01\n' >>> Other MMDF-handling software other than tin(1), e.g. http://www.nongnu.org/nmh/, neither produces a From_ header for MMDF, nor handles one being present. ---------- components: Library (Lib) messages: 294138 nosy: ralph.corderoy priority: normal severity: normal status: open title: mailbox.MMDF wrongly adds From_ header to file type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 08:09:45 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 22 May 2017 12:09:45 +0000 Subject: [New-bugs-announce] [issue30429] bdb: Add watchpoint function Message-ID: <1495454985.48.0.445993940506.issue30429@psf.upfronthosting.co.za> New submission from Louie Lu: Trying to add watchpoint function to bdb and pdb. It's goal is to do as gdb for three different watch: watch, rwatch and a watch. watch: when expr is written by program and value has changed, it will break rwatch: when expr is read by program, it will break awatch: when expr is read or write by program, it will break ---------- components: Library (Lib) messages: 294140 nosy: louielu priority: normal severity: normal status: open title: bdb: Add watchpoint function versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 08:34:41 2017 From: report at bugs.python.org (=?utf-8?b?UsOpbXkgTMOpb25l?=) Date: Mon, 22 May 2017 12:34:41 +0000 Subject: [New-bugs-announce] [issue30430] Cannot write to a tun interface file Message-ID: <1495456481.53.0.476190213776.issue30430@psf.upfronthosting.co.za> New submission from R?my L?one: I cannot write certain bytes object to a tun interface file. I've added a working and unworking example in the attached file. I'm running on Ubuntu16.04 with Python 3.5.2 ---------- components: IO files: simple_incorrect.py messages: 294143 nosy: R?my L?one priority: normal severity: normal status: open title: Cannot write to a tun interface file versions: Python 3.5 Added file: http://bugs.python.org/file46885/simple_incorrect.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 11:09:04 2017 From: report at bugs.python.org (=?utf-8?b?0JrQvtGB0YLRjyDQp9C+0LvQsNC6?=) Date: Mon, 22 May 2017 15:09:04 +0000 Subject: [New-bugs-announce] [issue30431] input function truncates prompt by NULL byte Message-ID: <1495465744.13.0.0864396942618.issue30431@psf.upfronthosting.co.za> New submission from ????? ?????: input('some\x00 text') will prompt for `some` instead of `some text` ---------- components: IO messages: 294153 nosy: ????? ????? priority: normal severity: normal status: open title: input function truncates prompt by NULL byte type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 14:51:08 2017 From: report at bugs.python.org (Roy Williams) Date: Mon, 22 May 2017 18:51:08 +0000 Subject: [New-bugs-announce] [issue30432] FileInput doesn't accept PathLike objects for file names Message-ID: <1495479068.64.0.00124017981092.issue30432@psf.upfronthosting.co.za> New submission from Roy Williams: ``` from fileinput import FileInput from pathlib import Path p = Path('.') FileInput(p) ``` Results in: Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fileinput.py", line 198, in __init__ files = tuple(files) TypeError: 'PosixPath' object is not iterable ---------- components: IO messages: 294169 nosy: Roy Williams priority: normal severity: normal status: open title: FileInput doesn't accept PathLike objects for file names versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 14:51:43 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Mon, 22 May 2017 18:51:43 +0000 Subject: [New-bugs-announce] [issue30433] Devguide lacks instructions for building docs Message-ID: <1495479103.65.0.491386375497.issue30433@psf.upfronthosting.co.za> New submission from Caleb Hattingh: The official devguide at https://github.com/python/devguide does not include instructions on exactly how to build the docs! If, after cloning, you simply type `make`, you get some helpful output: $ make Please use `make ' where is one of html to make standalone HTML files dirhtml to make HTML files named index.html in directories singlehtml to make a single large HTML file pickle to make pickle files json to make JSON files htmlhelp to make HTML files and a HTML help project qthelp to make HTML files and a qthelp project devhelp to make HTML files and a Devhelp project epub to make an epub latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter latexpdf to make LaTeX files and run them through pdflatex text to make text files man to make manual pages changes to make an overview of all changed/added/deprecated items linkcheck to check all external links for integrity doctest to run all doctests embedded in the documentation (if enabled) check to run a check for frequent markup errors However, in order to build, say, HTML, you need to have sphinx installed in your environment. I would like to add a `requirements.txt` file that will specify which dependencies must be installed (into a virtualenv, probably), in order to successfully build the documentation. In the GitHub PR, I have also added a BUILDING.rst that explains how to install the dependencies for building the documentation. ---------- assignee: docs at python components: Documentation messages: 294170 nosy: cjrh, docs at python priority: normal pull_requests: 1812 severity: normal status: open title: Devguide lacks instructions for building docs versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 16:24:15 2017 From: report at bugs.python.org (Soon Jeffrey) Date: Mon, 22 May 2017 20:24:15 +0000 Subject: [New-bugs-announce] [issue30434] multiprocessing AuthenticationError "digest sent was rejected" Message-ID: <1495484655.04.0.0387717474918.issue30434@psf.upfronthosting.co.za> New submission from Soon Jeffrey: This is codes I run: class TopicManager(SyncManager): pass Server side: m = TopicManager(address=('', 50000), authkey='12345') s = m.get_server() s.serve_forever() client side: m = TopicManager(address=('eng-g9-018', 50000), authkey='12345') m.connect() When I use Python2.7.5, m.connect() can connect to server. But when I use Python2.7.13, m.connect() throws out AuthenticationError "digest sent was rejected" Searched and multiprocessing.current_process().authkey = "12345" doesn't help. ---------- messages: 294178 nosy: Soon Jeffrey priority: normal severity: normal status: open title: multiprocessing AuthenticationError "digest sent was rejected" type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 19:32:59 2017 From: report at bugs.python.org (ipatrol) Date: Mon, 22 May 2017 23:32:59 +0000 Subject: [New-bugs-announce] [issue30435] Documentation either unclear or incorrect on comparisons between bytes and strings in Python 3 Message-ID: <1495495979.22.0.902310404899.issue30435@psf.upfronthosting.co.za> New submission from ipatrol: https://docs.python.org/3/reference/expressions.html#comparisons says that "Strings and binary sequences cannot be directly compared." That would seem to me to imply that an equality between them would raise an exception, as also claimed by https://wiki.python.org/moin/BytesStr However, that is manifestly incorrect. Bytes and strings can be compared: they are always unequal. This appears to be a result of the operation falling through to the default comparison, which returns False since they are not identical objects. Equality is a comparison, though it is not an order comparison. A brief search of the word "cannot" in the documentation suggest that saying a certain thing cannot be done usually implies that attempting to do so anyway will raise an exception, typically a TypeError. That this is not the case for string-bytes comparisons should be mentioned. ---------- assignee: docs at python components: Documentation messages: 294200 nosy: docs at python, ipatrol priority: normal severity: normal status: open title: Documentation either unclear or incorrect on comparisons between bytes and strings in Python 3 type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 20:47:04 2017 From: report at bugs.python.org (tkhyn) Date: Tue, 23 May 2017 00:47:04 +0000 Subject: [New-bugs-announce] [issue30436] importlib.find_spec raises AttributeError/ModuleNotFoundError when parent is not a package/module Message-ID: <1495500424.56.0.88806724527.issue30436@psf.upfronthosting.co.za> New submission from tkhyn: Hello, I stumbled upon this issue when using the module_has_submodule function in Django, which raised an exception when trying to import a dotted path such as ``parent.module`` when ``parent`` does not exist or is not a package. I would expect (as well as the django devs, apparently) find_spec to return None instead of raising an AttributeError or ModuleNotFoundError. Unless you think Django or any package making use of importlib.find_spec should handle these exceptions, the fix is quite simple. Steps to reproduce (with Python 3.6.1): touch parent.py python3.6 >>> from importlib.util import find_spec >>> find_spec('parent.module') File "C:\Python\3.6\Lib\importlib\util.py", line 89, in find_spec return _find_spec(fullname, parent.__path__) AttributeError: module 'parent' has no attribute '__path__' >>> find_spec('invalid_parent.module') File "C:\Python\3.6\Lib\importlib\util.py", line 88, in find_spec parent = __import__(parent_name, fromlist=['__path__']) ModuleNotFoundError: No module named 'invalid_parent' The fix is quite simple, replacing if fullname not in sys.modules: parent_name = fullname.rpartition('.')[0] if parent_name: # Use builtins.__import__() in case someone replaced it. parent = __import__(parent_name, fromlist=['__path__']) return _find_spec(fullname, parent.__path__) else: return _find_spec(fullname, None) by: if fullname not in sys.modules: parent_name = fullname.rpartition('.')[0] if parent_name: # Use builtins.__import__() in case someone replaced it. try: parent = __import__(parent_name, fromlist=['__path__']).__path__ except (AttributeError, ModuleNotFoundError): # parent is not a package return None else: parent = None return _find_spec(fullname, parent) in importlib.util.find_spec. ---------- components: Library (Lib) messages: 294209 nosy: tkhyn priority: normal severity: normal status: open title: importlib.find_spec raises AttributeError/ModuleNotFoundError when parent is not a package/module versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 23:44:13 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 23 May 2017 03:44:13 +0000 Subject: [New-bugs-announce] [issue30437] SSL_shutdown can return meaningless SSL_ERROR_SYSCALL Message-ID: <1495511053.18.0.843263784452.issue30437@psf.upfronthosting.co.za> New submission from Nathaniel Smith: The SSL_shutdown man page says that if it returns 0, and an SSL_ERROR_SYSCALL is set, then SSL_ERROR_SYSCALL should be ignored - or at least I think that's what it's trying to say. See the RETURN VALUES section. I think this means we should only raise this error if the return value is <0? Though I suppose we need to clear out the error queue in any case. I ended up changing the code that was triggering this for other reasons and now I'm not hitting it, so it's not exactly urgent for me, but FYI... I was getting SSLSyscallError exceptions from code using memory BIOs and where everything was fine. The test case had one task continually sending data into an SSLObject-based stream while the other end called SSLObject.unwrap() and then ended up continually getting SSLWantRead and reading more data -- after a few cycles of reading it got SSLSyscalError instead. ---------- assignee: christian.heimes components: SSL messages: 294216 nosy: alex, christian.heimes, dstufft, janssen, njs priority: normal severity: normal status: open title: SSL_shutdown can return meaningless SSL_ERROR_SYSCALL versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 22 23:49:43 2017 From: report at bugs.python.org (Yaroslav Halchenko) Date: Tue, 23 May 2017 03:49:43 +0000 Subject: [New-bugs-announce] [issue30438] tarfile would fail to extract tarballs with files under R/O directories Message-ID: <1495511383.87.0.473627744559.issue30438@psf.upfronthosting.co.za> New submission from Yaroslav Halchenko: If tarfile contains a file under a directory which has no write permission, extractall would fail since chmod'ing of the directory is done right when it is "extracted". Please find attached a quick&dummy script to demonstrate the problem using Python code. The issue is not just of an academic interest -- git-annex uses read-only permission to safe-guard against manual deletion of content. So tarball of any of git-annex repository carrying content for at least a single file, would not be extractable using Python's tarfile module (works fine with pure tar, verified that it is still failing to extract with Python v3.6.1-228-g1398b1bc7d from http://github.com/python/cpython). ---------- components: IO files: tarfilero.py messages: 294217 nosy: Yaroslav.Halchenko priority: normal severity: normal status: open title: tarfile would fail to extract tarballs with files under R/O directories versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46888/tarfilero.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 01:24:25 2017 From: report at bugs.python.org (Eric Snow) Date: Tue, 23 May 2017 05:24:25 +0000 Subject: [New-bugs-announce] [issue30439] Expose the subinterpreters C-API in the stdlib. Message-ID: <1495517065.49.0.193361600538.issue30439@psf.upfronthosting.co.za> New submission from Eric Snow: For a variety of reasons, I'd like to be able to manage subinterpreters from Python code. An initial effort would add a _interpreters module to the stdlib that exposes the basic functionality of the corresponding C-API. ---------- assignee: eric.snow components: Library (Lib) messages: 294225 nosy: eric.snow, steve.dower priority: normal severity: normal stage: patch review status: open title: Expose the subinterpreters C-API in the stdlib. type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 08:52:21 2017 From: report at bugs.python.org (Andrew Dalke) Date: Tue, 23 May 2017 12:52:21 +0000 Subject: [New-bugs-announce] [issue30440] document peephole optimizer effects Message-ID: <1495543941.79.0.954903712475.issue30440@psf.upfronthosting.co.za> New submission from Andrew Dalke: The peephole optimizer is an overall benefit to Python but it has some side-effects that occasionally cause problems. These are well-known in the issue tracker, but there is no other documentation which will help a Python programmer figure out which constructs may be a problem. 1) it will compute large integer constants and save them in the .pyc file. The following results in a 19M .pyc file. def compute_largest_known_prime(): return 2**74207281 - 1 As an example of someone affected by the compile-time evaluation, see https://stackoverflow.com/questions/34113609/why-does-python-preemptively-hang-when-trying-to-calculate-a-very-large-number/ . Note the many people who struggled to find definitive documentation. 2) it will create and discard large strings. Consider this variant of the code in test_zlib.py, where I have replaced the imported module variable "_1G" with its value: @bigmemtest(size=_4G + 4, memuse=1, dry_run=False) def test_big_buffer(self, size): data = b"nyan" * (2**30 + 1) # the original uses "_1G" self.assertEqual(zlib.crc32(data), 1044521549) self.assertEqual(zlib.adler32(data), 2256789997) The byte compiler will create the ~4GB string then discard it, even though the function will not be called on machines with insufficient RAM. As an example of how I was affected by this, see #21074 . 3) The optimizer affects control flow such that the coverage.py gives false positives about unreached code. As examples of how people are affected, see #2506 and https://bitbucket.org/ned/coveragepy/issues/198/continue-marked-as-not-covered . The last item on the coverage.py tracker asks "Is this limitation documented anywhere?" I do not believe that the current peephole optimizer should be changed to support these use cases, only that there should be documentation about how the optimizer may negatively affect real-world code. The domain expert on this topic is Raymond Hettinger. He does not feel safe in issues where I am involved. As I believe my continued presence on this issue will inhibit the documentation changes which I think are needed, I will remove my name from this issue and not be further involved. ---------- assignee: docs at python components: Documentation messages: 294248 nosy: dalke, docs at python priority: normal severity: normal status: open title: document peephole optimizer effects versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 10:35:50 2017 From: report at bugs.python.org (Osvaldo Santana Neto) Date: Tue, 23 May 2017 14:35:50 +0000 Subject: [New-bugs-announce] [issue30441] os.environ raises RuntimeError: dictionary changed size during iteration Message-ID: <1495550150.73.0.497197540263.issue30441@psf.upfronthosting.co.za> New submission from Osvaldo Santana Neto: We're facing ocasional RuntimeError exceptions in a multithreaded application when one of the threads creates new entries to the environment (os.environ). I'm not so sure if the attached patch fixes this issue the right way, so, feel free to propose another approach. Traceback Sample of the issue in our production environment: RuntimeError: dictionary changed size during iteration File "python3.5/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) [ internal code ] File "newrelic/api/background_task.py", line 103, in wrapper return wrapped(*args, **kwargs) File "python3.5/contextlib.py", line 30, in inner return func(*args, **kwds) File "python3.5/contextlib.py", line 77, in __exit__ self.gen.throw(type, value, traceback) File "raven/base.py", line 851, in make_decorator yield File "python3.5/contextlib.py", line 30, in inner return func(*args, **kwds) [ internal code ] File "retry/api.py", line 74, in retry_decorator logger) File "retry/api.py", line 33, in __retry_internal return f() [ internal code ] File "requests/sessions.py", line 531, in get return self.request('GET', url, **kwargs) File "requests/sessions.py", line 509, in request prep.url, proxies, stream, verify, cert File "requests/sessions.py", line 686, in merge_environment_settings env_proxies = get_environ_proxies(url, no_proxy=no_proxy) File "requests/utils.py", line 696, in get_environ_proxies return getproxies() File "urllib/request.py", line 2393, in getproxies_environment for name, value in os.environ.items(): File "_collections_abc.py", line 676, in __iter__ for key in self._mapping: File "python3.5/os.py", line 702, in __iter__ for key in self._data: ---------- components: Library (Lib) files: fix_os_environ_iteration_issue.diff keywords: patch messages: 294250 nosy: osantana priority: normal severity: normal status: open title: os.environ raises RuntimeError: dictionary changed size during iteration type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46889/fix_os_environ_iteration_issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 14:02:42 2017 From: report at bugs.python.org (Kushal Das) Date: Tue, 23 May 2017 18:02:42 +0000 Subject: [New-bugs-announce] [issue30442] Skip test_xml_etree under coverage Message-ID: <1495562562.53.0.327833904863.issue30442@psf.upfronthosting.co.za> New submission from Kushal Das: test test_xml_etree failed -- Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_xml_etree.py", line 1553, in test_bug_xmltoolkit63 self.assertEqual(sys.getrefcount(None), count) AssertionError: 522146 != 522143 Under coverage (in our travis CI) test_xml_etree fails for refcount. Brett suggests to skip this test in case running under coverage. ---------- assignee: kushal.das messages: 294271 nosy: kushal.das priority: normal severity: normal status: open title: Skip test_xml_etree under coverage type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 17:21:46 2017 From: report at bugs.python.org (Michael R. Shannon) Date: Tue, 23 May 2017 21:21:46 +0000 Subject: [New-bugs-announce] [issue30443] datetime.datetime.__add__ does not respect fold. Message-ID: <1495574506.4.0.0164833880692.issue30443@psf.upfronthosting.co.za> New submission from Michael R. Shannon: datetime.datetime.__add__ is currently implemented by converting the date into a datetime.timedelta object (using toordinal) before adding it to the other (timedelta) object and reconstructing with datetime.combine. With this method, fold will always be set to 0. There are two cases that will produce an incorrect result (assuming positive timedelta for examples). 1. fold=0 and the timedelta is large enough to push the time into or past a fold. Either fold will be 0 and not 1 as it should or the time will be too far ahead by the size of the fold. 2. fold=1 and the timedelta is small enough to leave the time in the fold but fold will be set to 0. This results in the time being too far behind by the size of the fold. A possible fix is to convert to UTC before adding the timedelta and call self._tzinfo.fromutc() on the result. ---------- components: Library (Lib) messages: 294285 nosy: belopolsky, mrshannon priority: normal severity: normal status: open title: datetime.datetime.__add__ does not respect fold. type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 18:28:32 2017 From: report at bugs.python.org (Gautam krishna.R) Date: Tue, 23 May 2017 22:28:32 +0000 Subject: [New-bugs-announce] [issue30444] Add ability to change "-- more -- Message-ID: <1495578512.09.0.96601753421.issue30444@psf.upfronthosting.co.za> Changes by Gautam krishna.R : ---------- nosy: Gautam krishna.R priority: normal severity: normal status: open title: Add ability to change "-- more -- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 18:49:33 2017 From: report at bugs.python.org (Maria Mckinley) Date: Tue, 23 May 2017 22:49:33 +0000 Subject: [New-bugs-announce] [issue30445] test_traceback fails when run early Message-ID: <1495579773.06.0.828492907038.issue30445@psf.upfronthosting.co.za> Changes by Maria Mckinley : ---------- components: Tests nosy: maria priority: normal severity: normal status: open title: test_traceback fails when run early type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 19:46:11 2017 From: report at bugs.python.org (Thomas Stevenson) Date: Tue, 23 May 2017 23:46:11 +0000 Subject: [New-bugs-announce] [issue30446] Embedded 3.6.1 distribution cannot find _socket module Message-ID: <1495583171.06.0.348150251511.issue30446@psf.upfronthosting.co.za> New submission from Thomas Stevenson: Trying to import the socket module using the embedded distribution for 3.6.1, I get the error: : No module named '_socket' Running with the standard interpreter works: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from socket import * >>> via an embedded C++ call, however, : No module named '_socket' is the error returned. ---------- components: Windows messages: 294297 nosy: paul.moore, steve.dower, tim.golden, tomjessy at me.com, zach.ware priority: normal severity: normal status: open title: Embedded 3.6.1 distribution cannot find _socket module type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 20:20:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 May 2017 00:20:39 +0000 Subject: [New-bugs-announce] [issue30447] test_capi.test_subinterps() fails on ARMv7 Ubuntu 3.x Message-ID: <1495585239.21.0.635893235031.issue30447@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/ARMv7%20Ubuntu%203.x/builds/786/steps/test/logs/stdio ====================================================================== FAIL: test_subinterps (test.test_capi.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_capi.py", line 471, in test_subinterps self.assertNotEqual(interp.interp, main.interp) AssertionError: '0x0' == '0x0' ---------- components: Tests messages: 294302 nosy: eric.snow, haypo priority: normal severity: normal status: open title: test_capi.test_subinterps() fails on ARMv7 Ubuntu 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 20:24:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 May 2017 00:24:03 +0000 Subject: [New-bugs-announce] [issue30448] test_subprocess creates a core dump on FreeBSD Message-ID: <1495585443.49.0.256538007117.issue30448@psf.upfronthosting.co.za> New submission from STINNER Victor: Eric Snow: do you think that it could be related to your recent subinterpreter changes please? http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/311/steps/test/logs/stdio 0:08:26 load avg: 3.35 [253/405] test_subprocess failed (env changed) (98 sec) -- running: test_io (30 sec) Warning -- files was modified by test_subprocess Before: [] After: ['python.core'] ---------- components: Tests messages: 294303 nosy: eric.snow, haypo priority: normal severity: normal status: open title: test_subprocess creates a core dump on FreeBSD versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 21:01:47 2017 From: report at bugs.python.org (Aaron Hall) Date: Wed, 24 May 2017 01:01:47 +0000 Subject: [New-bugs-announce] [issue30449] Improve __slots__ datamodel documentation Message-ID: <1495587707.13.0.0998591622446.issue30449@psf.upfronthosting.co.za> New submission from Aaron Hall: The __slots__ documentation in the datamodel needs improvement. For example: > When inheriting from a class without __slots__, the __dict__ attribute of that class will always be accessible, so a __slots__ definition in the subclass is meaningless. The __slots__ definition for such a subclass is not meaningless: other slots declared will still be used, and the __dict__ will not be instantiated unless it is looked for (although this may be an implementation detail). > The action of a __slots__ declaration is limited to the class where it is defined. As a result, subclasses will have a __dict__ unless they also define __slots__ (which must only contain names of any additional slots). That's not quite right either. The action of a __slots__ declaration is not entirely limited to the class where it is defined. They can have implications for multiple inheritance, and child classes will have access to those slots. I have some changes I'd like to make to the entire section on __slots__, and I'll be providing a pull request soon. ---------- assignee: docs at python components: Documentation messages: 294305 nosy: Aaron Hall, docs at python priority: normal severity: normal status: open title: Improve __slots__ datamodel documentation versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 23 21:33:46 2017 From: report at bugs.python.org (Zachary Ware) Date: Wed, 24 May 2017 01:33:46 +0000 Subject: [New-bugs-announce] [issue30450] Pull Windows dependencies from GitHub rather than svn.python.org Message-ID: <1495589626.97.0.920797927041.issue30450@psf.upfronthosting.co.za> New submission from Zachary Ware: Once we've migrated away from svn.python.org for Windows build dependencies, there should be no reason to continue running svn.python.org. ---------- components: Build, Extension Modules, Windows messages: 294307 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: patch review status: open title: Pull Windows dependencies from GitHub rather than svn.python.org type: resource usage versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 01:51:58 2017 From: report at bugs.python.org (chainly) Date: Wed, 24 May 2017 05:51:58 +0000 Subject: [New-bugs-announce] [issue30451] parse windows path error in webbrowser.get() and lead to webbrowser.Error: could not locate runnable browser Message-ID: <1495605118.23.0.51946743768.issue30451@psf.upfronthosting.co.za> New submission from chainly: a bug when platform is not posix, lead to webbrowser.Error: could not locate runnable browser see below: import shlex shlex.split(r'C:\a\chrome.exe', comments=False, posix=True) ['C:achrome.exe'] shlex.split(r'C:\a\chrome.exe', comments=False, posix=False) ['C:\a\chrome.exe'] ---------- components: Library (Lib) messages: 294325 nosy: chainly priority: normal pull_requests: 1865 severity: normal status: open title: parse windows path error in webbrowser.get() and lead to webbrowser.Error: could not locate runnable browser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 04:36:18 2017 From: report at bugs.python.org (Zoltan Baksa) Date: Wed, 24 May 2017 08:36:18 +0000 Subject: [New-bugs-announce] [issue30452] xml.etree sourcecode bug Message-ID: <1495614978.44.0.236861711153.issue30452@psf.upfronthosting.co.za> New submission from Zoltan Baksa: Hi, I used before an XML merger script with 2.7 version, which was running fine. After my Anaconda was updated by SCCM to version 3.6 the same script fails and reports the following traceback: File "C:\Program Files\Anaconda3\lib\xml\etree\ElementTree.py", line 1190, in parse tree.parse(source, parser) File "C:\Program Files\Anaconda3\lib\xml\etree\ElementTree.py", line 591, in p arse self._root = parser._parse_whole(source) xml.etree.ElementTree.ParseError: unclosed token: line 128, column 4 What can I do? ---------- components: XML files: xmlMerge.py messages: 294335 nosy: baksaz priority: normal severity: normal status: open title: xml.etree sourcecode bug versions: Python 3.6 Added file: http://bugs.python.org/file46891/xmlMerge.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 05:45:38 2017 From: report at bugs.python.org (Kazuhiro Fujie) Date: Wed, 24 May 2017 09:45:38 +0000 Subject: [New-bugs-announce] [issue30453] str.format() method, Rounding off wrong Message-ID: <1495619138.29.0.555890274343.issue30453@psf.upfronthosting.co.za> New submission from Kazuhiro Fujie: To whom it may concern: I post issue at first time. Please forgive me if this is rude C:\Users\kudo-shunsaku>python Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> num = 4.625 >>> "{:.2f}".format(num) '4.62' >>> num = 4.645 >>> "{:.2f}".format(num) '4.64' >>> num = 4.655 >>> "{:.2f}".format(num) '4.66' >>> Please, check this out. I checked it version 3.5.3 and 3.6.1 on Windows and Cent OS. ---------- components: Build messages: 294340 nosy: kudoshunsaku priority: normal severity: normal status: open title: str.format() method, Rounding off wrong type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 06:56:57 2017 From: report at bugs.python.org (sameer natekar) Date: Wed, 24 May 2017 10:56:57 +0000 Subject: [New-bugs-announce] [issue30454] Python module cx_Oracle ld installation issue on Solaris11U3 SPARC: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error Message-ID: <1495623417.41.0.885565788641.issue30454@psf.upfronthosting.co.za> New submission from sameer natekar: Trying to install cx_Oracle on Solaris11U3 but getting ld: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error # python setup.py build running build running build_ext building 'cx_Oracle' extension cc -DNDEBUG -KPIC -DPIC -I/oracle/database/rdbms/demo -I/oracle/database/rdbms/public -I/usr/include/python2.7 -c cx_Oracle.c -o build/temp.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.2.1 "SessionPool.c", line 202: warning: integer overflow detected: op "<<" cc -G build/temp.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.o -L/oracle/database/lib -L/usr/lib -lclntsh -lpython2.7 -o build/lib.solaris-2.11-sun4v.32bit-2.7-11g/cx_Oracle.so ld: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error: command 'cc' failed with exit status 2 Tried all available information on the internet: Installed gcc Installed solarisstudio12.4 Installed instantclient-basic-solaris.sparc64-12.2.0.1.0, instantclient-odbc-solaris.sparc64-12.2.0.1.0 Set LD_LIBRARY_PATH to oracle home directory:instantclient_12_2/ Same issue seen while installing DBD:Oracle perl module. ---------- components: Installation messages: 294344 nosy: sameernatekar priority: normal severity: normal status: open title: Python module cx_Oracle ld installation issue on Solaris11U3 SPARC: fatal: file /oracle/database/lib/libclntsh.so: wrong ELF class: ELFCLASS64 error type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 08:21:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 24 May 2017 12:21:49 +0000 Subject: [New-bugs-announce] [issue30455] Generate C code from token.py and not vice versa Message-ID: <1495628509.86.0.512362155714.issue30455@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently Lib/token.py is generated from Include/token.h. This contradicts common practice when the C code is generated from the Python code (see for example opcode.py and sre_constants.py). In additional the table in Parser/tokenizer.c should be manually supported matching Include/token.h. Generating Include/token.h and Parser/tokenizer.c from Lib/token.py would be simpler and more reliable. ---------- components: Interpreter Core, Library (Lib) messages: 294350 nosy: Albert-Jan Nijburg, benjamin.peterson, haypo, meador.inge, r.david.murray, serhiy.storchaka priority: normal severity: normal status: open title: Generate C code from token.py and not vice versa type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 08:38:00 2017 From: report at bugs.python.org (Eli_B) Date: Wed, 24 May 2017 12:38:00 +0000 Subject: [New-bugs-announce] [issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses Message-ID: <1495629480.46.0.852726762555.issue30456@psf.upfronthosting.co.za> New submission from Eli_B: The documentation says isinstance(x, (int, int)) would be fixed to isinstance(x, (int)). The fix is actually isinstance(x, int). I propose the following text instead: " 2to3fixer:: isinstance Fixes duplicate types in the second argument of :func:`isinstance`. For example, isinstance(x, (int, int)) is converted to isinstance(x, int) and isinstance(x, (int, float, int)) is converted to isinstance(x, (int, float)). " ---------- assignee: docs at python components: Documentation files: 2to3.rst messages: 294351 nosy: Eli_B, docs at python priority: normal pull_requests: 1867 severity: normal status: open title: 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses versions: Python 2.7 Added file: http://bugs.python.org/file46894/2to3.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 10:48:25 2017 From: report at bugs.python.org (pfreixes) Date: Wed, 24 May 2017 14:48:25 +0000 Subject: [New-bugs-announce] [issue30457] Allow retrieve the number of waiters pending for most of the asyncio lock primitives Message-ID: <1495637305.13.0.0526704297983.issue30457@psf.upfronthosting.co.za> New submission from pfreixes: Currently, there is no way to access to the number of waiters pending to be woken up. This information can be useful for those environments which create and delete asyncio primitives instances depending if there are waiters still to be processed. The following example shows an example of the DogPile solution that uses the Event lock mechanism. Each time that there is a miss in the cache, a new Event is created and it will be removed by the last waiter. import asyncio cache = {} events = {} async def get(process, key): try: return cache[key] except KeyError: try: await events[key].wait() if len(events[key]._waiters) == 0: events.pop(key) return cache[key] except KeyError: events[key] = asyncio.Event() # simulates some IO to get the Key await asyncio.sleep(0.1) cache[key] = "some random value" events[key].set() async def main(): tasks = [get(i, "foo") for i in range(1, 10)] await asyncio.gather(*tasks) asyncio.get_event_loop().run_until_complete(main()) ---------- components: asyncio messages: 294357 nosy: pfreixes, yselivanov priority: normal severity: normal status: open title: Allow retrieve the number of waiters pending for most of the asyncio lock primitives type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 11:01:31 2017 From: report at bugs.python.org (Orange) Date: Wed, 24 May 2017 15:01:31 +0000 Subject: [New-bugs-announce] [issue30458] CRLF Injection in httplib Message-ID: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> New submission from Orange: Hi, the patch in CVE-2016-5699 can be broke by an addition space. http://www.cvedetails.com/cve/CVE-2016-5699/ https://hg.python.org/cpython/rev/bf3e1c9b80e9 https://hg.python.org/cpython/rev/1c45047c5102 import urllib, urllib2 urllib.urlopen('http://127.0.0.1\r\n\x20hihi\r\n :11211') urllib2.urlopen('http://127.0.0.1\r\n\x20hihi\r\n :11211') ---------- components: Library (Lib) messages: 294360 nosy: orange priority: normal severity: normal status: open title: CRLF Injection in httplib versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 11:14:12 2017 From: report at bugs.python.org (Espie Marc) Date: Wed, 24 May 2017 15:14:12 +0000 Subject: [New-bugs-announce] [issue30459] PyList_SET_ITEM could be safer Message-ID: <1495638852.56.0.0790136948712.issue30459@psf.upfronthosting.co.za> New submission from Espie Marc: Documentation says PyList_SET_ITEM is void, but it lies. The macro is such that it yields the actual element being set. wrapping the macro content in a do {} while (0) makes sure PyList_SET_ITEM is really void, e.g.: #define PyList_SET_ITEM(op, i, v) do { (((PyListObject *)(op))->ob_item[i] = (v)); } while (0) I just ran into the problem while compiling py-qt4 with clang. There was some confusion between PyList_SET_ITEM and PyList_SetItem: if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0) g++ didn't catch it (because it doesn't see negative pointers as a problem), but clang++ instantly broke. With PyList_SET_ITEM truly void the problem disappears. ---------- components: Interpreter Core messages: 294362 nosy: espie priority: normal severity: normal status: open title: PyList_SET_ITEM could be safer type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 15:07:32 2017 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 24 May 2017 19:07:32 +0000 Subject: [New-bugs-announce] [issue30460] file opened for updating cannot write after read Message-ID: <1495652852.75.0.455169730609.issue30460@psf.upfronthosting.co.za> New submission from Jeremy Kloth: Attempting to append to an existing file fails with no error set: >>> import os, tempfile >>> fd, fn = tempfile.mkstemp() >>> os.write(fd, 'some text') 9 >>> os.close(fd) >>> with open(fn, 'r+') as f: ... f.read() ... f.write('more text') ... 'some text' Traceback (most recent call last): File "", line 3, in IOError: [Errno 0] Error (error 0 is defined as NO_ERROR) ---------- components: IO, Windows messages: 294379 nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: file opened for updating cannot write after read versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 15:29:31 2017 From: report at bugs.python.org (Bernhard M. Wiedemann) Date: Wed, 24 May 2017 19:29:31 +0000 Subject: [New-bugs-announce] [issue30461] glob returns results in undeterministic order Message-ID: <1495654171.99.0.785764793517.issue30461@psf.upfronthosting.co.za> New submission from Bernhard M. Wiedemann: because POSIX readdir does not guarantee any order glob often gives unexpectedly random results. Some background: for openSUSE Linux we build packages in the Open Build Service (OBS) which tracks dependencies, so when e.g. a new glibc is submitted, all packages depending on glibc are rebuilt and if those depending binaries changed, the new version is pushed to the mirrors. Many python modules build their .so files from a glob.glob(path, "*.cpp") The old glob behaviour would often lead to the linker randomly ordering functions in resulting object files, thus we were not able to auto-detect that the package did not actually change which wastes bandwidth of distribution mirrors and users. See also https://reproducible-builds.org/ on that topic. There are plenty affected packages out there https://github.com/pytries/datrie/blob/master/setup.py#L10 https://github.com/jonashaag/bjoern/blob/master/setup.py#L6 https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/dsolve/setup.py#L28 ---------- components: Library (Lib) messages: 294381 nosy: bmwiedemann priority: normal severity: normal status: open title: glob returns results in undeterministic order versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 16:13:11 2017 From: report at bugs.python.org (Jiri Hnidek) Date: Wed, 24 May 2017 20:13:11 +0000 Subject: [New-bugs-announce] [issue30462] urllib does not support NO_PROXY environment variable containing domain with asterisk Message-ID: <1495656791.66.0.906077456639.issue30462@psf.upfronthosting.co.za> New submission from Jiri Hnidek: Module urllib contains method proxy_bypass_environment(domain_name). This method check if domain_name should be excluded from proxying. The domain_name is checked against environment variable no_proxy or NO_PROXY. This variable contains comma separated list of domain names/domains. Domains can be specified in following variants: - domain.com - .domain.com - *.domain.com Method proxy_bypass_environment support first two variants, but it doesn't support variant with asterisk at beginning of domain. The last variant is not anything unusual; e.g.: https://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html ---------- components: Library (Lib) messages: 294388 nosy: Jiri Hnidek priority: normal severity: normal status: open title: urllib does not support NO_PROXY environment variable containing domain with asterisk type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 16:41:17 2017 From: report at bugs.python.org (Aaron Hall) Date: Wed, 24 May 2017 20:41:17 +0000 Subject: [New-bugs-announce] [issue30463] Add __slots__ to ABC convenience class Message-ID: <1495658477.95.0.988068330571.issue30463@psf.upfronthosting.co.za> New submission from Aaron Hall: We have __slots__ with other ABC's, see http://bugs.python.org/issue11333 and http://bugs.python.org/issue21421. There are no downsides to having empty slots on a non-instantiable class, but it does give the option of denying __dict__ creation for subclassers. The possibility of breaking is for someone using __slots__ but relying on __dict__ creation in a subclass - they will have to explicitly add "__dict__" to __slots__. Since we have added __slots__ to other ABC's, I will provide a PR soon on this. Diff should look like this (in Lib/abc.py): class ABC(metaclass=ABCMeta): """Helper class that provides a standard way to create an ABC using inheritance. """ - pass + __slots__ = () (I also want to add a test for this, and ensure other ABC's also have this if they don't.) ---------- messages: 294389 nosy: Aaron Hall priority: normal severity: normal status: open title: Add __slots__ to ABC convenience class _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 17:47:13 2017 From: report at bugs.python.org (Leonardo De Marchi) Date: Wed, 24 May 2017 21:47:13 +0000 Subject: [New-bugs-announce] [issue30464] gammavariate has a wrong comment Message-ID: <1495662433.59.0.0975080513198.issue30464@psf.upfronthosting.co.za> New submission from Leonardo De Marchi: The gammavariate function in random.py has a wrong comment. It says that when alpha is one it's equivalent to call expovariate(1). We can see that is not true (see graphs) and it should be expovariate(1/beta). It's not a big deal but it can cause confusion. ---------- files: unnamed.png messages: 294403 nosy: leodema priority: normal severity: normal status: open title: gammavariate has a wrong comment Added file: http://bugs.python.org/file46895/unnamed.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 18:53:37 2017 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 24 May 2017 22:53:37 +0000 Subject: [New-bugs-announce] [issue30465] FormattedValue expressions have wrong lineno and col_offset information Message-ID: <1495666417.53.0.222363680661.issue30465@psf.upfronthosting.co.za> New submission from ?ukasz Langa: f-strings are computed in a separate compiler step. This makes their lineno and col_offset information wrong. This is problematic for flake8 which reports problems inside f-strings on the wrong line (typically the first one). Attached patch fixes the issue. ---------- assignee: lukasz.langa keywords: 3.6regression messages: 294408 nosy: lukasz.langa priority: normal severity: normal stage: patch review status: open title: FormattedValue expressions have wrong lineno and col_offset information type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 18:58:40 2017 From: report at bugs.python.org (Trey Hunner) Date: Wed, 24 May 2017 22:58:40 +0000 Subject: [New-bugs-announce] [issue30466] Tutorial doesn't explain the use of classes Message-ID: <1495666720.41.0.650692797283.issue30466@psf.upfronthosting.co.za> New submission from Trey Hunner: The tutorial page for classes starts with "Compared with other programming languages". While object-oriented programming and classes are popular in many programming languages, not everyone learning about Python's classes is familiar with the concept. I teach both new programmers and programmers who have heard of object-oriented programming but never created a class before. I think the first paragraph on this page should be a brief explanation of the use of classes. It may also be a good idea to have a "Why classes?" section explaining the uses of classes in more detail. ---------- assignee: docs at python components: Documentation messages: 294409 nosy: docs at python, trey priority: normal severity: normal status: open title: Tutorial doesn't explain the use of classes type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 19:06:33 2017 From: report at bugs.python.org (Shubha Ramani) Date: Wed, 24 May 2017 23:06:33 +0000 Subject: [New-bugs-announce] [issue30467] Propagate zipfile.py pypy issue #905 patch to CPython Message-ID: <1495667193.48.0.845313681518.issue30467@psf.upfronthosting.co.za> New submission from Shubha Ramani: PyPy had a longstanding issue : ZipFile.extractall is very slow compared to CPython 2.6 https://bitbucket.org/pypy/pypy/issues/905/zipfileextractall-is-very-slow-compared-to which has been fixed in the PyPy code base. The changes were entirely in zipfile.py (see the attached patch for PyPy) The patch fixed a significant performance bottleneck in PyPy. ---------- files: issue905.diff keywords: patch messages: 294411 nosy: shubhar priority: normal severity: normal status: open title: Propagate zipfile.py pypy issue #905 patch to CPython type: performance versions: Python 2.7 Added file: http://bugs.python.org/file46898/issue905.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 19:08:12 2017 From: report at bugs.python.org (Shubha Ramani) Date: Wed, 24 May 2017 23:08:12 +0000 Subject: [New-bugs-announce] [issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7 Message-ID: <1495667292.64.0.95835937286.issue30468@psf.upfronthosting.co.za> New submission from Shubha Ramani: PyPy had a longstanding issue : ZipFile.extractall is very slow compared to CPython 2.6 https://bitbucket.org/pypy/pypy/issues/905/zipfileextractall-is-very-slow-compared-to which has been fixed in the PyPy code base. The changes were entirely in zipfile.py (see the attached patch for PyPy) The patch fixed a significant performance bottleneck in PyPy. ---------- files: issue905.diff keywords: patch messages: 294413 nosy: shubhar priority: normal severity: normal status: open title: Propagate zipfile.py pypy issue #905 patch to CPython 3.7 type: performance versions: Python 3.7 Added file: http://bugs.python.org/file46899/issue905.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 24 20:13:08 2017 From: report at bugs.python.org (Ryan Morshead) Date: Thu, 25 May 2017 00:13:08 +0000 Subject: [New-bugs-announce] [issue30469] Inconsistent Execution of Generic Descriptor Attributes Message-ID: <1495671188.71.0.216050990731.issue30469@psf.upfronthosting.co.za> New submission from Ryan Morshead: When the `__get__`, `__set__`, or `__delete__` attribute of a descriptor is not a method, and is instead a generic callable, the first argument of that callable is inconsistent: class Callable(object): def __call__(self, first, *args, **kwargs): print(first) class Descriptor(object): __set__ = Callable() __delete__ = Callable() __get__ = Callable() class MyClass(object): d = Descriptor() mc = MyClass() mc.d = 1 del mc.d mc.d Prints: <__main__.MyClass object at 0x10854cda0> <__main__.MyClass object at 0x10854cda0> <__main__.Descriptor object at 0x10855f240> As it turns out, this occurs because `slot_tp_descr_set` (shared by `__set__` and `__delete__`) and `slot_tp_descr_get` just aren't consistent in their implementation. See: https://stackoverflow.com/questions/44169370/strange-descriptor-behavior/44169805#44169805 Is this behavior intentional? If not, how ought this case be handled? ---------- components: ctypes messages: 294415 nosy: Ryan Morshead priority: normal severity: normal status: open title: Inconsistent Execution of Generic Descriptor Attributes type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 01:44:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 25 May 2017 05:44:56 +0000 Subject: [New-bugs-announce] [issue30470] Deprecate invalid ctypes call protection on Windows Message-ID: <1495691096.42.0.177794201857.issue30470@psf.upfronthosting.co.za> New submission from Mariatta Wijaya: It was proposed by Steve Dower by email to python-dev: https://mail.python.org/pipermail/python-dev/2017-May/147959.html It should be deprecated in Python 3.6.2 and removed in 3.7.0 ---------- assignee: docs at python components: Documentation, ctypes messages: 294435 nosy: Mariatta, docs at python, haypo, steve.dower priority: normal severity: normal status: open title: Deprecate invalid ctypes call protection on Windows versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 04:13:59 2017 From: report at bugs.python.org (=?utf-8?q?D=C3=A1vid_Nemeskey?=) Date: Thu, 25 May 2017 08:13:59 +0000 Subject: [New-bugs-announce] [issue30471] "as" keyword in comprehensions Message-ID: <1495700039.88.0.542456926854.issue30471@psf.upfronthosting.co.za> New submission from D?vid Nemeskey: Currently, the "as" keyword in supported in import and with statements to bind an object to a name. I think it would be nice to have the same functionality in list/dict/etc. comprehensions as well. Rationale: as I understand, comprehensions are preferred over map/filter + lambdas for creating modified versions of sequences (etc.) in Python. They are indeed useful for replacing map, filter, or map(filter); however, filter(map) is currently not supported. This is not an unusual use-case, as the two examples below show. It is also evident that they are very wordy with lambdas, and could be much clearer with comprehensions: with open(file) as inf: lines = list(filter(lambda l: l, map(lambda line: line.strip(), inf))) items = dict(filter(lambda kv: kv[1] > 5, map(lambda kv: kv[0], len(kv[1]), d.items()))) Currently the only way to do this with comprehensions are: with open(file) as inf: lines = [l for l in (line.strip() for line in inf) if l] items = {k: v for k, v in ((k, len(v)) for k, v in d.items()) if v > 5)} , or items = {k: len(v) for k, v in d.items() if len(v) > 5} The first option is as unwieldy and unreadable as the code with lambdas, while the second is ineffective as it calls len() twice (and of course here len() is just a placeholder for a potentially heavy operation). I propose to allow the "as" keyword in comprehensions as well to bind the result of an operation in the output expression to a name that could be used in the optional predicate. In other words, provide a let-like functionality. Like so: with open(file) as inf: lines = [line.strip() as l for line in inf if l] items = {(k, len(v) as lenv) for k, v in d.items() if lenv > 5} ---------- messages: 294446 nosy: nemeskeyd priority: normal severity: normal status: open title: "as" keyword in comprehensions type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 07:23:31 2017 From: report at bugs.python.org (Debanjan Bhattacharjee) Date: Thu, 25 May 2017 11:23:31 +0000 Subject: [New-bugs-announce] [issue30472] [Selenium 3.4.2-geckodriver 0.16.1] Python 3.6.1 unable to initialize webdriver with "marionette" set to True Message-ID: <1495711411.33.0.210124080235.issue30472@psf.upfronthosting.co.za> New submission from Debanjan Bhattacharjee: Python 3.6.1 unable to initialize webdriver (geckodriver) for Selenium with "marionette" set to True. Here is my code block written in PyCharm: from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities caps = DesiredCapabilities().FIREFOX caps["marionette"] = True driver = webdriver.Firefox(capabilities=caps, executable_path="C:\\Utility\\BrowserDrivers\\geckodriver.exe") driver.set_page_load_timeout(30) driver.get("https://www.facebook.com/") driver.maximize_window() driver.implicitly_wait(20) The error reads as: C:\Python\python.exe C:/Users/AtechM_03/PycharmProjects/Webinar/SeleniumScripts/MyForthSeleniumScript.py Traceback (most recent call last): File "C:/Users/AtechM_03/PycharmProjects/Webinar/SeleniumScripts/MyForthSeleniumScript.py", line 7, in driver = webdriver.Firefox(capabilities=caps, executable_path="C:\\Utility\\BrowserDrivers\\geckodriver.exe") File "C:\Python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 152, in __init__ keep_alive=True) File "C:\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 98, in __init__ self.start_session(desired_capabilities, browser_profile) File "C:\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 188, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in execute self.error_handler.check_response(response) File "C:\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities When "marionette" set back to False URL open up perfect. ---------- messages: 294470 nosy: debanjan priority: normal severity: normal status: open title: [Selenium 3.4.2-geckodriver 0.16.1] Python 3.6.1 unable to initialize webdriver with "marionette" set to True type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 08:21:49 2017 From: report at bugs.python.org (Peter Parente) Date: Thu, 25 May 2017 12:21:49 +0000 Subject: [New-bugs-announce] [issue30473] defaultdict raises SystemError, __missing__ returned NULL in thread Message-ID: <1495714909.78.0.802693882922.issue30473@psf.upfronthosting.co.za> New submission from Peter Parente: Working on this PR (https://github.com/maxpoint/spylon/pull/49), I encountered an unexpected SystemError in Python 3.6 on my Mac and on Travis Linux. Exception in thread Thread-4: Traceback (most recent call last): File "/Users/parente/miniconda3/envs/spylon-dev/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/Users/parente/miniconda3/envs/spylon-dev/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/Users/parente/projects/spylon/spylon/spark/progress.py", line 99, in _spark_progress_thread_worker td = datetime.datetime.now() - start_times[stage_id] SystemError: returned NULL without setting an error The exception only occurs in Python 3.6, not in Python 3.5 or 3.4: https://travis-ci.org/maxpoint/spylon/builds/235992988 The defaultdict is both created and used as a local variable in a threading.Thread run() function. It's never accessed outside that context (https://github.com/maxpoint/spylon/pull/49/commits/2bd47dc32f6129f5f6a4824be1eaed568351df11#diff-1ba10d1cd92a35a380442cb586e310e2R179) I didn't see a related issue on the tracker here nor did I see anything in the 3.6 changelog about a behavior change. ---------- messages: 294473 nosy: Peter Parente priority: normal severity: normal status: open title: defaultdict raises SystemError, __missing__ returned NULL in thread type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 09:12:47 2017 From: report at bugs.python.org (Kevin Buchs) Date: Thu, 25 May 2017 13:12:47 +0000 Subject: [New-bugs-announce] [issue30474] Crash on OS X EXC_BAD_ACCESS (SIGSEGV) Message-ID: <1495717967.43.0.218380717717.issue30474@psf.upfronthosting.co.za> New submission from Kevin Buchs: I have been getting periodic crashes from a long running python job on Mac OS X. There is nothing indicative of a crash from standard output or error. I'm not sure if the OS X crash records actually find your way back to you, but I am explicitly including mine here. I will try to attach my code after submission of this entry. I run this in the background on OS X, with stdout and stderr redirected to the same file. ---------- components: Interpreter Core, macOS files: python-crash.txt messages: 294476 nosy: buchs, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Crash on OS X EXC_BAD_ACCESS (SIGSEGV) type: crash versions: Python 2.7 Added file: http://bugs.python.org/file46900/python-crash.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 14:34:57 2017 From: report at bugs.python.org (Eric Snow) Date: Thu, 25 May 2017 18:34:57 +0000 Subject: [New-bugs-announce] [issue30475] Docs for PyDict_GetItemWithError() should say it returns a borrowed reference. Message-ID: <1495737297.35.0.632969328907.issue30475@psf.upfronthosting.co.za> New submission from Eric Snow: Per Object/dictobject.c, PyDict_GetItemWithError() returns a borrowed reference. However, the documentation does not say so. That should be fixed. ---------- messages: 294506 nosy: eric.snow priority: normal severity: normal status: open title: Docs for PyDict_GetItemWithError() should say it returns a borrowed reference. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 16:25:14 2017 From: report at bugs.python.org (Shubha Ramani) Date: Thu, 25 May 2017 20:25:14 +0000 Subject: [New-bugs-announce] [issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table Message-ID: <1495743914.68.0.637740687758.issue30476@psf.upfronthosting.co.za> New submission from Shubha Ramani: It is wasteful to generate the CRC Table every time, via _crctable = list(map(_gen_crc, range(256))). Better to have a pre-computed table. I will submit the patch which incorporates this feature along with micro-benchmark results. Related issue: http://bugs.python.org/issue30467 http://bugs.python.org/issue30468 ---------- messages: 294513 nosy: serhiy.storchaka, shubhar priority: normal severity: normal status: open title: Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 18:41:20 2017 From: report at bugs.python.org (Joe Jevnik) Date: Thu, 25 May 2017 22:41:20 +0000 Subject: [New-bugs-announce] [issue30477] tuple.index error message improvement Message-ID: <1495752080.24.0.264186476964.issue30477@psf.upfronthosting.co.za> New submission from Joe Jevnik: The old error of tuple.index(x): x not in tuple seemed very confusing to me. It was also harder to quickly understand what the program was doing wrong. This saves people a second pass through the program under the debugger because they can just see what the invalid value was. The reason I am explicitly calling repr instead of using %R is that I didn't want to call repr twice if I didn't need to. If people think that is fine the format can just be tuple.index(%R): %R not in tuple instead. ---------- messages: 294516 nosy: brett.cannon, llllllllll priority: normal pull_requests: 1906 severity: normal status: open title: tuple.index error message improvement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 25 21:48:32 2017 From: report at bugs.python.org (HuyK) Date: Fri, 26 May 2017 01:48:32 +0000 Subject: [New-bugs-announce] [issue30478] Python 2.7 crashes in Linux environment Message-ID: <1495763312.4.0.570893113599.issue30478@psf.upfronthosting.co.za> New submission from HuyK: Hi all, I have a python script to run as a Weather Station application. The python script runs on Raspberry Pi 3 board. It gets weather data from OpenWeatherMap website and sends result to a remote touch-screen device via COM port to display It uses two main libraries to handle the task: https://pypi.python.org/pypi/ftd2xx https://github.com/csparpa/pyowm I got the python script just exits without any error after sometimes. Checking the return code with the command "echo $?" in Pi's console window and got 139 which means a Segmentation Fault We tried to generate coredump system when the python script crashes and we got this: "Core was generated by 'python weather_station.py' Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0005b614 in complex_subtype_from_string (type=0x746150, v=0x72616843) at ../Objects/complexobject.c:1075" I tried to update to Python 2.7.13 but the crashes still happens. My question is if the segmentation fault related to complexobject.c has been reported and fixed? Best regards, HuyK ---------- components: Interpreter Core files: python_crashes.png messages: 294520 nosy: HuyK priority: normal severity: normal status: open title: Python 2.7 crashes in Linux environment type: crash versions: Python 2.7 Added file: http://bugs.python.org/file46903/python_crashes.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 04:23:42 2017 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Fri, 26 May 2017 08:23:42 +0000 Subject: [New-bugs-announce] [issue30479] improve asyncio debugging Message-ID: <1495787022.39.0.794943633831.issue30479@psf.upfronthosting.co.za> New submission from Tarek Ziad?: This is a very useful trick to understand why the loop cleanup generates a lot of "Exception ignored in: " https://github.com/python/asyncio/issues/423#issuecomment-268882753 Could we consider including it in Task.__del__ ? ---------- components: asyncio messages: 294536 nosy: tarek, yselivanov priority: normal severity: normal status: open title: improve asyncio debugging type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 04:50:27 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 26 May 2017 08:50:27 +0000 Subject: [New-bugs-announce] [issue30480] samefile and sameopenfile fail for WebDAV mapped drives Message-ID: <1495788627.48.0.260495922264.issue30480@psf.upfronthosting.co.za> New submission from Eryk Sun: os.path.samefile (used by shutil copyfile and move), os.path.sameopenfile, and pathlib.samefile rely on os.path.samestat (from genericpath.py), which compares corresponding st_dev and st_ino values. POSIX assures that the tuple (st_dev, st_ino) is unique. Windows makes no such assurance for the combination of the volume serial number (st_dev) and file index number (st_ino). The volume serial number isn't required to be unique or even non-zero ([MS-FSCC] 2.5.9), and the file index number may also be zero if the file system doesn't support it ([MS-FSCC] 2.4.20). [MS-FSCC]: File System Control Codes https://msdn.microsoft.com/en-us/library/cc231987 A WebDAV network drive exemplifies both cases. The volume serial number is zero, as is the file index number for every file and directory. Thus samestat() is true for every comparison on the drive, whether for a file or directory, and also when comparing files mounted on different WebDAV drives. This isn't a common problem, but I think it's severe enough to warrant a separate Windows implementation of samefile and sameopenfile. If the corresponding st_dev and st_ino values are equal and either is zero, it should compare the final paths via _getfinalpathname. The latter would need to be modified to support passing a file descriptor for use with sameopenfile. ---------- components: Windows messages: 294538 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: samefile and sameopenfile fail for WebDAV mapped drives type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 05:10:16 2017 From: report at bugs.python.org (Mohamad amin Khakzadan) Date: Fri, 26 May 2017 09:10:16 +0000 Subject: [New-bugs-announce] [issue30481] lib/socket.py, line 330, Treated 'file' as a socket object, instead of int Message-ID: <1495789816.08.0.123142136015.issue30481@psf.upfronthosting.co.za> New submission from Mohamad amin Khakzadan: When I network programming, I got this problem: File "ft.py", line 43, in SendFile sent=conn.sendfile(fd.fileno(), offset) File "D:\Program Files\Python\Python35-32\lib\socket.py", line 391, in sendfile return self._sendfile_use_send(file, offset, count) File "D:\Program Files\Python\Python35-32\lib\socket.py", line 330, in _sendfile_use_send file_read = file.read AttributeError: 'int' object has no attribute 'read' file_read = file.read ^ 'file' is fd.fileno() not a socket object socket.sendfile() documentation: https://docs.python.org/3/library/socket.html#socket.socket.sendfile ---------- components: Windows messages: 294539 nosy: Mohamad amin Khakzadan, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: lib/socket.py, line 330, Treated 'file' as a socket object, instead of int type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 05:32:15 2017 From: report at bugs.python.org (Doug Freed) Date: Fri, 26 May 2017 09:32:15 +0000 Subject: [New-bugs-announce] [issue30482] socket.getservbyname(), socket.getservbyport(), socket.getprotobyname() are not threadsafe Message-ID: <1495791135.77.0.856446931809.issue30482@psf.upfronthosting.co.za> New submission from Doug Freed: On at least Linux (and probably most other UNIXes, except OS X), the C functions getservbyname(), getservbyport(), and getprotobyname() are not threadsafe. CPython's wrappers around these functions in the socket module do nothing to cover up this fact. Simple reproduction script for getservbyname (others similar): ``` import threading import socket def getservbyname_loop(service, port): while True: result = socket.getservbyname(service) if result != port: raise RuntimeError("thread-safety broken, got %d, expected %d" % (result, port)) thread1 = threading.Thread(target=getservbyname_loop, args=("ssh", 22)) thread2 = threading.Thread(target=getservbyname_loop, args=("smtp", 25)) thread1.start() thread2.start() ``` One of the threads will throw the RuntimeError, saying it got the port number the other thread should have gotten. Naive fix: a lock (eg, just use the netdb_lock already created in the module) Proper fix: use the libc's reentrant variant if available, and fall back to locking if not (see gethostbyname_ex() implementation for example). I'd be happy to work on this, but as I don't have access to anything other than Linux and OS X at the moment, it would be helpful if platform maintainers could chime in on what if any reentrant variants of these functions exist on their platforms so we can have a more proper fix. ---------- components: Extension Modules messages: 294540 nosy: dwfreed priority: normal severity: normal status: open title: socket.getservbyname(), socket.getservbyport(), socket.getprotobyname() are not threadsafe type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 05:49:46 2017 From: report at bugs.python.org (Abhilash Raj) Date: Fri, 26 May 2017 09:49:46 +0000 Subject: [New-bugs-announce] [issue30483] urllib.parse.parse_qsl does not handle unicode data properly Message-ID: <1495792186.98.0.218510408103.issue30483@psf.upfronthosting.co.za> New submission from Abhilash Raj: After decoding percentage encoded `name` and `values` in the query string, it tries to `_coerce_result` or encode the result to ascii (which is the value of _implicit_encoding). ``` File "/usr/lib/python3.6/urllib/parse.py", line 691, in parse_qsl value = _coerce_result(value) File "/usr/lib/python3.6/urllib/parse.py", line 95, in _encode_result return obj.encode(encoding, errors) UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128) ``` As seen in the partial traceback above, it breaks things when trying to parse unicode encode query string values. ---------- messages: 294541 nosy: maxking priority: normal severity: normal status: open title: urllib.parse.parse_qsl does not handle unicode data properly versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 08:48:10 2017 From: report at bugs.python.org (Jim Wright) Date: Fri, 26 May 2017 12:48:10 +0000 Subject: [New-bugs-announce] [issue30484] Garbage Collector can cause Segfault whilst iterating dictionary items Message-ID: <1495802890.31.0.92287761621.issue30484@psf.upfronthosting.co.za> New submission from Jim Wright: We discovered this issue whilst using h5py (HDF5 python library) under python 3.5.2 on Ubuntu 16.04.2 x86_64. The construct used is very dubious, and I will separately be raising an issue with the h5py team. However I thought you might like to know there is a possible way to cause a segmentation violation using pure python. There appears to be a new implementation of dictionaries in 3.6 vs 3.5, so I compiled up 3.6.1 and it also segfaults, but not so obviously related to the dictionary iteration (both stack traces are included below). Regards, Jim. -------- $ cat segfault.py #!/usr/bin/python3 class CyclicObject: def __init__(self, key, register): self.key = key self.self = self self.register = register self.register[self.key] = None def __del__(self): del self.register[self.key] while True: register = { } objs = set([CyclicObject(i, register) for i in range(10000)]) while len(objs) > 0: objs.remove(next(iter(objs))) try: list(register.items()) except RuntimeError as err: print(err) -------- $ python3 --version Python 3.5.2 $ gdb --args python3 segfault.py GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 (gdb) r Starting program: /usr/bin/python3 segfault.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". dictionary changed size during iteration dictionary changed size during iteration dictionary changed size during iteration Program received signal SIGSEGV, Segmentation fault. dictiter_iternextitem.lto_priv () at ../Objects/dictobject.c:3158 3158 ../Objects/dictobject.c: No such file or directory. (gdb) bt #0 dictiter_iternextitem.lto_priv () at ../Objects/dictobject.c:3158 #1 0x000000000059f024 in listextend.lto_priv () at ../Objects/listobject.c:855 #2 0x000000000058fd1c in list_init.lto_priv () at ../Objects/listobject.c:2314 #3 0x000000000055d17c in type_call.lto_priv () at ../Objects/typeobject.c:905 #4 0x00000000005b7167 in PyObject_Call () at ../Objects/abstract.c:2165 #5 0x0000000000528d06 in do_call (nk=, na=, pp_stack=0x7fffffffd9b0, func=) at ../Python/ceval.c:4936 #6 call_function (oparg=, pp_stack=0x7fffffffd9b0) at ../Python/ceval.c:4732 #7 PyEval_EvalFrameEx () at ../Python/ceval.c:3236 #8 0x000000000052d2e3 in _PyEval_EvalCodeWithName () at ../Python/ceval.c:4018 #9 0x000000000052dfdf in PyEval_EvalCodeEx () at ../Python/ceval.c:4039 #10 PyEval_EvalCode (co=, globals=, locals=) at ../Python/ceval.c:777 #11 0x00000000005fd2c2 in run_mod () at ../Python/pythonrun.c:976 #12 0x00000000005ff76a in PyRun_FileExFlags () at ../Python/pythonrun.c:929 #13 0x00000000005ff95c in PyRun_SimpleFileExFlags () at ../Python/pythonrun.c:396 #14 0x000000000063e7d6 in run_file (p_cf=0x7fffffffdc20, filename=0xa73280 L"segfault.py", fp=0xad19a0) at ../Modules/main.c:318 #15 Py_Main () at ../Modules/main.c:768 #16 0x00000000004cfe41 in main () at ../Programs/python.c:65 #17 0x00007ffff7811830 in __libc_start_main (main=0x4cfd60
, argc=2, argv=0x7fffffffde38, init=, fini=, rtld_fini=, stack_end=0x7fffffffde28) at ../csu/libc-start.c:291 #18 0x00000000005d5f29 in _start () -------- $ ./python --version Python 3.6.1 $ gdb --args ./python ./segfault.py GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 (gdb) r Starting program: ./python ./segfault.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". dictionary changed size during iteration dictionary changed size during iteration dictionary changed size during iteration dictionary changed size during iteration dictionary changed size during iteration Program received signal SIGSEGV, Segmentation fault. _PyObject_Alloc (ctx=0x0, elsize=28, nelem=1, use_calloc=0) at Objects/obmalloc.c:1258 1258 if ((pool->freeblock = *(block **)bp) != NULL) { (gdb) bt #0 _PyObject_Alloc (ctx=0x0, elsize=28, nelem=1, use_calloc=0) at Objects/obmalloc.c:1258 #1 _PyObject_Malloc (ctx=0x0, nbytes=28) at Objects/obmalloc.c:1437 #2 0x0000000000490732 in _PyLong_New (size=1) at Objects/longobject.c:196 #3 PyLong_FromLong (ival=) at Objects/longobject.c:254 #4 0x0000000000542fda in _PyEval_EvalFrameDefault (f=, throwflag=) at Python/ceval.c:3060 #5 0x000000000053d671 in PyEval_EvalFrameEx (throwflag=0, f=0x7ffff7fa1648) at Python/ceval.c:718 #6 _PyFunction_FastCall (co=, args=, nargs=1, globals=globals at entry=0x7ffff7f452d0) at Python/ceval.c:4880 #7 0x000000000053e521 in fast_function (kwnames=0x0, nargs=, stack=, func=0x7ffff7eae510) at Python/ceval.c:4915 #8 call_function (pp_stack=pp_stack at entry=0x7fffffffd920, oparg=oparg at entry=1, kwnames=kwnames at entry=0x0) at Python/ceval.c:4819 #9 0x0000000000542c17 in _PyEval_EvalFrameDefault (f=, throwflag=) at Python/ceval.c:3284 #10 0x000000000053e015 in PyEval_EvalFrameEx (throwflag=0, f=0x93a368) at Python/ceval.c:718 #11 _PyEval_EvalCodeWithName (_co=_co at entry=0x7ffff7ec26f0, globals=globals at entry=0x7ffff7f5e078, locals=locals at entry=0x7ffff7ec26f0, args=args at entry=0x0, argcount=argcount at entry=0, kwnames=kwnames at entry=0x0, kwargs=0x8, kwcount=0, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:4128 #12 0x000000000053ee43 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=locals at entry=0x7ffff7ec26f0, globals=globals at entry=0x7ffff7f5e078, _co=_co at entry=0x7ffff7ec26f0) at Python/ceval.c:4149 #13 PyEval_EvalCode (co=co at entry=0x7ffff7ec26f0, globals=globals at entry=0x7ffff7f452d0, locals=locals at entry=0x7ffff7f452d0) at Python/ceval.c:695 #14 0x000000000042740f in run_mod (arena=0x7ffff7f5e078, flags=0x7fffffffdc00, locals=0x7ffff7f452d0, globals=0x7ffff7f452d0, filename=0x7ffff7e844f8, mod=0x933c28) at Python/pythonrun.c:980 #15 PyRun_FileExFlags (fp=0x93a350, filename_str=, start=, globals=0x7ffff7f452d0, locals=0x7ffff7f452d0, closeit=1, flags=0x7fffffffdc00) at Python/pythonrun.c:933 #16 0x000000000042763c in PyRun_SimpleFileExFlags (fp=0x93a350, filename=, closeit=1, flags=0x7fffffffdc00) at Python/pythonrun.c:396 #17 0x000000000043b975 in run_file (p_cf=0x7fffffffdc00, filename=0x8f82a0 L"./segfault.py", fp=0x93a350) at Modules/main.c:338 #18 Py_Main (argc=argc at entry=2, argv=argv at entry=0x8f7010) at Modules/main.c:809 #19 0x000000000041dc52 in main (argc=2, argv=) at ./Programs/python.c:69 ---------- components: Interpreter Core files: segfault.py messages: 294548 nosy: jimwright priority: normal severity: normal status: open title: Garbage Collector can cause Segfault whilst iterating dictionary items type: crash versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46905/segfault.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 08:57:08 2017 From: report at bugs.python.org (Ben Wainwright) Date: Fri, 26 May 2017 12:57:08 +0000 Subject: [New-bugs-announce] [issue30485] Element.findall(path, dict) doesn't insert null namespace Message-ID: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> New submission from Ben Wainwright: The findall method for ElementTree.Element handles namespace prefixes by tokenising the path and inserting the full namespace in braces based on entries in a dictionary. Unfortunately, this does not work for a namespace without a prefix, so if you have files containing namespaces with and without prefixes, you still need to manually add the namespace url for the unprefixed path. The function xpath_tokenizer checks to see if tokens contain a colon and only adds in the namespace url in that instance. This could be changed to add the url if their is a colon, or if there is not, and the empty string key is present in the namespaces dictionary. ---------- components: Library (Lib), XML messages: 294549 nosy: ben.wainwright priority: normal severity: normal status: open title: Element.findall(path, dict) doesn't insert null namespace type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 12:17:01 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 26 May 2017 16:17:01 +0000 Subject: [New-bugs-announce] [issue30486] Allow setting cell value Message-ID: <1495815421.45.0.489335851706.issue30486@psf.upfronthosting.co.za> New submission from Antoine Pitrou: There are use cases for setting a cell value. One such use case is for (un)pickling recursive closures (see heroic workaround here: https://github.com/cloudpipe/cloudpickle/pull/90/files#diff-d2a3618afedd4e124c532151eedbae09R74 ). Other use cases may include tinkering around and general education value. There also doesn't seem to be, AFAICS, any counter-indication to being able to do so. It's already possible in C using PyCell_Set(), which is a public API. It just lacks an API in Python land. For example `cell_contents` could become a read/write property... ---------- components: Interpreter Core messages: 294554 nosy: benjamin.peterson, gvanrossum, ncoghlan, pitrou, rhettinger priority: normal severity: normal stage: needs patch status: open title: Allow setting cell value type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 12:49:48 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Fri, 26 May 2017 16:49:48 +0000 Subject: [New-bugs-announce] [issue30487] DOC: automatically create a venv and install Sphinx when running make Message-ID: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> New submission from Caleb Hattingh: Under guidance from zware during Pycon sprints, I've changed the Doc/ Makefile to automatically create a virtual environment and install Sphinx, all as part of the `make html` command. ---------- assignee: docs at python components: Documentation messages: 294556 nosy: cjrh, docs at python, willingc, zach.ware priority: normal pull_requests: 1909 severity: normal status: open title: DOC: automatically create a venv and install Sphinx when running make versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 13:42:41 2017 From: report at bugs.python.org (Max) Date: Fri, 26 May 2017 17:42:41 +0000 Subject: [New-bugs-announce] [issue30488] Documentation for subprocess.STDOUT needs clarification Message-ID: <1495820561.33.0.197241379069.issue30488@psf.upfronthosting.co.za> New submission from Max: The documentation states that subprocess.STDOUT is: Special value that can be used as the stderr argument to Popen and indicates that standard error should go into the same handle as standard output. However, when Popen is called with stdout=None, stderr=subprocess.STDOUT, stderr is not redirected to stdout and continues to be sent to stderr. To reproduce the problem: $ python >/dev/null -c 'import subprocess;\ subprocess.call(["ls", "/404"],stderr=subprocess.STDOUT)' and observe the error message appearing on the console (assuming /404 directory does not exist). This was reported on SO 5 years ago: https://stackoverflow.com/questions/11495783/redirect-subprocess-stderr-to-stdout. The SO attributed this to a documentation issue, but arguably it should be considered a bug because there seems to be no reason to make subprocess.STDOUT unusable in this very common use case. ---------- components: Interpreter Core messages: 294560 nosy: max priority: normal severity: normal status: open title: Documentation for subprocess.STDOUT needs clarification type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 14:27:27 2017 From: report at bugs.python.org (Santiago Castro) Date: Fri, 26 May 2017 18:27:27 +0000 Subject: [New-bugs-announce] [issue30489] Add CmdLineTest to standard library Message-ID: <1495823247.09.0.958014555003.issue30489@psf.upfronthosting.co.za> New submission from Santiago Castro: I see that you use some helpers to test command line utilities (https://hg.python.org/cpython/file/default/Lib/test/test_cmd_line_script.py) that would be useful to Python programmers. Please, consider to add them to the standard library (or somewhere) to reuse them. ---------- messages: 294565 nosy: Santiago Castro priority: normal severity: normal status: open title: Add CmdLineTest to standard library type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 26 16:59:34 2017 From: report at bugs.python.org (pfreixes) Date: Fri, 26 May 2017 20:59:34 +0000 Subject: [New-bugs-announce] [issue30490] Allow pass an exception to the Event.set method Message-ID: <1495832374.38.0.182460539379.issue30490@psf.upfronthosting.co.za> New submission from pfreixes: Having the Event as the way to synchronize 1:N coroutines, the none happy path should be able to be expressed making possible call the `set_exception` for each future related to each waiter. As an example the following code trying to implement a way to avoid the dogpile effect for a DNS cache. If the coro that holds the event fails, the original exception is also broadcasted to the waiters. if key in throttle_dns_events: yield from throttle_dns_events[key].wait() else: throttle_dns_events[key] = Event(loop=loop) try: addrs = yield from \ resolver.resolve(host, port, family=family) cached_hosts.add(key, addrs) throttle_dns_events[key].set() except Exception as e: # any DNS exception, independently of the implementation # is set for the waiters to raise the same exception. throttle_dns_events[key].set(exc=e) raise finally: throttle_dns_events.pop(key) ---------- components: asyncio messages: 294572 nosy: pfreixes, yselivanov priority: normal severity: normal status: open title: Allow pass an exception to the Event.set method versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 27 02:43:00 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 27 May 2017 06:43:00 +0000 Subject: [New-bugs-announce] [issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects Message-ID: <1495867380.86.0.533205071954.issue30491@psf.upfronthosting.co.za> New submission from Nathaniel Smith: A common problem when working with async functions is to attempt to call them but forget the 'await', which eventually leads to a 'Warning: coroutine ... was never awaited' (possibly buried in the middle of a bunch of traceback shrapnel caused by follow-on errors). This can be confusing, lead to spuriously passing tests, and generally isn't a great experience for the dev who makes the mistake. To improve this, I'd like to do things like have a test harness reliably detect when this has happened inside a test case, or have trio's main loop check occasionally to see if this has happened and immediately raise a useful error. (Unfortunately, it *doesn't* work to promote the warning to an error using the usual warnings filter machinery, because the warning is raised inside a __del__ method, which suppresses exception propagation.) In principle this is possible with sys.setcoroutinewrapper, but that adds non-trivial runtime overhead to every async function invocation, which is something we'd like to avoid. (It's OK for a "debug mode", but "modes" are also a poor dev experience: they certainly have their place, but whenever possible it's much nicer to give a proper error in the first place instead of relying on the dev to realize they need to enable debug mode and then remember how to do it.) Therefore I propose that CPython keep a thread-local counter of how many coroutine objects currently exist in a created-but-not-yet-started state -- so corofn.__call__ would increment this counter, and the first call to coroobj.__next__/send/throw would decrement it. And there's some way to access it e.g. via a magic function in the sys module. Then test harnesses can assert that this is zero, trio could occasionally poll this from its run loop and assert that it's zero, etc., with very low overhead. (This is a slight modification of the version I discussed with Yury and others at PyCon last week; the previous request was to keep a count of how many times the "coroutine '...' was never awaited" warning had been emitted. The problem with the original idea is that the warning message doesn't fire until the garbage collector has collected the coroutine object, and that might not happen at a convenient time if we're using PyPy, or if there are cycles, or in a test where the missing 'await' eventually leads to an exception whose traceback pins the coroutine object in memory just long enough for the warning to be detected on the *next* test and confuse everyone. Thanks to Matthias Bussonnier for spurring the new idea, and see discussion here: https://github.com/python-trio/trio/issues/79#issuecomment-304364010) ---------- components: asyncio messages: 294584 nosy: giampaolo.rodola, haypo, ncoghlan, njs, yselivanov priority: normal severity: normal status: open title: Add a lightweight mechanism for detecting un-awaited coroutine objects versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 27 14:28:10 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 27 May 2017 18:28:10 +0000 Subject: [New-bugs-announce] [issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide Message-ID: <1495909690.05.0.0866994683674.issue30492@psf.upfronthosting.co.za> New submission from Gregory P. Smith: I never do in-tree builds anymore because they make me feel dirty and leave build artifacts cluttering up my source tree. make clinic does not work for out of tree builds. To reproduce: ~$ git clone ...cpython repo... ~$ mkdir build && cd build ~/build$ ../cpython/configure --with-pydebug ~/build$ make clinic ./python -E ./Tools/clinic/clinic.py --make ./python: can't open file './Tools/clinic/clinic.py': [Errno 2] No such file or directory Makefile:545: recipe for target 'clinic' failed make: *** [clinic] Error 2 Per https://docs.python.org/3/howto/clinic.html it looks like I can just manually run clinic.py on the files I have modified. Ideally the build system would take care of that for me. But all I really want is a single command that keeps me up to date. python3 Tools/clinic/clinic.py appears to be that command. Even if it isn't fixed for out of tree builds, use of clinic needs to be in the devguide. ---------- assignee: docs at python components: Argument Clinic, Documentation messages: 294604 nosy: docs at python, gregory.p.smith, larry priority: normal severity: normal stage: needs patch status: open title: 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 27 16:45:48 2017 From: report at bugs.python.org (Lee Cannon) Date: Sat, 27 May 2017 20:45:48 +0000 Subject: [New-bugs-announce] [issue30493] Increase coverage of base64 Message-ID: <1495917948.16.0.130856040345.issue30493@psf.upfronthosting.co.za> New submission from Lee Cannon: Added tests to ensure a85decode correctly handles the 'y' character within the byte like object when foldspaces is true. While attempting to increase coverage I found two lines of code within base64.py that appear to never execute: - line 472 - line 501 Line 472: The only time the TypeError except block (line 467) executes is when _b85dec[c] resolves to None for one of the c (characters) in chunk. Then within the except block the c (characters) within chunk are iterated through until the None is hit then a ValueError is raised (line 470). Making it impossible for line 472 to execute. Line 501: s is assigned a value in the expression `s = input.read(MAXBINSIZE)` (line 494), due to this len(s) is only ever not equal to MAXBINSIZE if the end of input has been reached and nothing was read or the last chunk of data was read from input which has a len less than MAXBINSIZE but non-zero. Therefore the only way to enter into the while loop (line 497) is if there are no more characters left to be read from input, yet all that happens in the while loop is the read function is called on input with a non zero parameter (`MAXBINSIZE-len(s)` must be greater than zero for the while to have executed) then when it returns nothing (it always will) execution breaks out of the while loop without modifiying s. ---------- components: Tests messages: 294611 nosy: leecannon priority: normal severity: normal status: open title: Increase coverage of base64 type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 27 20:54:59 2017 From: report at bugs.python.org (aokaywe) Date: Sun, 28 May 2017 00:54:59 +0000 Subject: [New-bugs-announce] [issue30494] python.exe crashed when open long path in windows 7 Message-ID: <1495932899.34.0.384023708799.issue30494@psf.upfronthosting.co.za> New submission from aokaywe: 1. os.makedirs(ur'\\?\c:\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????') 2. open(ur'\\?\c:\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\?????\t.txt','w') you can see python was crashed. ---------- components: Windows files: python.png messages: 294618 nosy: aokaywe, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: python.exe crashed when open long path in windows 7 versions: Python 2.7 Added file: http://bugs.python.org/file46907/python.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 27 23:22:20 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 28 May 2017 03:22:20 +0000 Subject: [New-bugs-announce] [issue30495] IDLE: modernize textview module Message-ID: <1495941740.56.0.621655501188.issue30495@psf.upfronthosting.co.za> New submission from Terry J. Reedy: First get issue #. ---------- assignee: terry.reedy components: IDLE messages: 294622 nosy: csabella, terry.reedy priority: normal severity: normal stage: patch review status: open title: IDLE: modernize textview module type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 28 09:28:54 2017 From: report at bugs.python.org (Stefan Seefeld) Date: Sun, 28 May 2017 13:28:54 +0000 Subject: [New-bugs-announce] [issue30496] Incomplete traceback with `exec` Message-ID: <1495978134.83.0.774241176124.issue30496@psf.upfronthosting.co.za> New submission from Stefan Seefeld: The following code is supposed to catch and report errors encountered during the execution of a (python) script: ``` import traceback import sys try: env = {} with open('script') as f: exec(f.read(), env) except: type_, value_, tb = sys.exc_info() print (traceback.print_tb(tb)) ``` However, depending on the nature of the error, the traceback may contain the location of the error *within* the executed `script` file, or it may only report the above `exec(f.read(), env)` line. The attached tarball contains both the above as well as a 'script' that exhibit the problem. Is this a bug or am I missing something ? Are there ways to work around this, i.e. determine the correct (inner) location of the error ? (I'm observing this with both Python 2.7 and Python 3.5) ---------- files: pyerror.tgz messages: 294645 nosy: stefan priority: normal severity: normal status: open title: Incomplete traceback with `exec` type: behavior Added file: http://bugs.python.org/file46908/pyerror.tgz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 28 14:44:26 2017 From: report at bugs.python.org (Steven Myint) Date: Sun, 28 May 2017 18:44:26 +0000 Subject: [New-bugs-announce] [issue30497] Line number of docstring in AST Message-ID: <1495997066.31.0.794903121268.issue30497@psf.upfronthosting.co.za> New submission from Steven Myint: Since #29463, it is no longer obvious how to get the line number of a docstring in the AST: import ast x = ast.parse('''\ def foo(): """This is a docstring.""" ''') # In Python 3.6, the docstring and line number would be: print(x.body[0].body[0].value.s) print(x.body[0].body[0].value.lineno) # In Python 3.7, I don't know what the equivalent would be. print(x.body[0].docstring) # Line number? We use this feature in pyflakes (https://github.com/PyCQA/pyflakes/issues/271). ---------- components: Interpreter Core messages: 294654 nosy: myint priority: normal severity: normal status: open title: Line number of docstring in AST versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 28 15:41:20 2017 From: report at bugs.python.org (Brett Cannon) Date: Sun, 28 May 2017 19:41:20 +0000 Subject: [New-bugs-announce] [issue30498] Run Python's slowest tests in the first 3/4 of tests when using -r Message-ID: <1496000480.86.0.388224961805.issue30498@psf.upfronthosting.co.za> New submission from Brett Cannon: If we guaranteed that the slowest tests in the test suite started early enough in the test run to complete before the final test finished, we could shave off several minutes worth of time in cases where the slowest tests are the hold-up. So perhaps if we randomly inserted the 10 slowest tests in the first 3/4 of the complete test list we could make sure they finish early enough? ---------- components: Tests messages: 294658 nosy: brett.cannon priority: normal severity: normal status: open title: Run Python's slowest tests in the first 3/4 of tests when using -r versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 28 17:30:18 2017 From: report at bugs.python.org (Julien Palard) Date: Sun, 28 May 2017 21:30:18 +0000 Subject: [New-bugs-announce] [issue30499] Deprecated note in set documentation Message-ID: <1496007018.0.0.712296031489.issue30499@psf.upfronthosting.co.za> New submission from Julien Palard: While translating doc to french, I found a surprising comment in stdtypes.html about sets, stating: > To support searching for an equivalent frozenset, the elem set is temporarily mutated during the search and then restored. During the search, the elem set should not be read or mutated since it does not have a meaningful value. So I searched the equivalent in the code, at least to help me understand it to translate it in a proper way, but found it has been deleted in 51ced7afe72d861b46f069d757f2787f13253d32. This commit is in branches 2.7 and 3.1 to 3.6 (and master). ---------- assignee: docs at python components: Documentation messages: 294662 nosy: docs at python, mdk, rhettinger priority: normal severity: normal status: open title: Deprecated note in set documentation versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 00:04:12 2017 From: report at bugs.python.org (Nam Nguyen) Date: Mon, 29 May 2017 04:04:12 +0000 Subject: [New-bugs-announce] [issue30500] urllib connects to a wrong host Message-ID: <1496030652.64.0.90102082916.issue30500@psf.upfronthosting.co.za> New submission from Nam Nguyen: Reported by Orange Tsai: ========== Hi, Python Security Team import urllib from urlparse import urlparse url = 'http://127.0.0.1#@evil.com/' print urlparse(url).netloc # 127.0.0.1 print urllib.urlopen(url).read() # will access evil.com I have tested on the latest version of Python 2.7.13. ========== ---------- components: Library (Lib) messages: 294667 nosy: Nam.Nguyen priority: normal pull_requests: 1933 severity: normal status: open title: urllib connects to a wrong host type: security versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 02:58:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 29 May 2017 06:58:36 +0000 Subject: [New-bugs-announce] [issue30501] Produce optimized code for boolean conditions Message-ID: <1496041116.54.0.344455983628.issue30501@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The peephole optimizer optimizes some boolean conditions. For example in "if not a:" it replaces UNARY_NOT+POP_JUMP_IF_FALSE with POP_JUMP_IF_TRUE, and in "if a and b:" it makes checking the boolean value of a only once. But it is unable to optimize more complex conditions, like "if not a and b:". Proposed patch makes the compiler producing optimized code for conditions. It supports expressions with arbitrary complexity containing the "not" operator, the "and" and "or" binary operators, the "if" ternary operator, and chained comparisons, used as conditions in the ternary operator, in the "if", "while" and "assert" statements, and in generator expressions and comprehensions. It would be possible to remove the part of the peepholer optimizer, but it is needed also for optimizing the "and" and "or" operators in non-boolean context. Doing this optimization in the compiler is possible but too cumbersome, it requires 3 times more code that in the proposed patch. May be I'll find the more general solution in future. ---------- components: Interpreter Core messages: 294674 nosy: benjamin.peterson, brett.cannon, ncoghlan, rhettinger, serhiy.storchaka, yselivanov priority: normal severity: normal stage: patch review status: open title: Produce optimized code for boolean conditions type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 03:19:13 2017 From: report at bugs.python.org (Christian Heimes) Date: Mon, 29 May 2017 07:19:13 +0000 Subject: [New-bugs-announce] [issue30502] Fix buffer handling of OBJ_obj2txt Message-ID: <1496042353.91.0.558550525758.issue30502@psf.upfronthosting.co.za> New submission from Christian Heimes: Frawser Tweedle from Red Hat's identity management team found an issue in PyCA cryptography's handling of buffers for OpenSSL OBJ_obj2txt(). Cryptography fails to handle long OIDs as used by Active Directory. https://github.com/pyca/cryptography/pull/3612/ https://bugzilla.redhat.com/show_bug.cgi?id=1455755 CPython's ssl module doesn't handle buffer allocation for OBJ_obj2txt() correctly, too. A default buffer size of 255+1 makes the bug less likely to occur, though. We should fix the problem anyway. ---------- assignee: christian.heimes components: SSL messages: 294679 nosy: christian.heimes priority: critical severity: normal status: open title: Fix buffer handling of OBJ_obj2txt type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 04:22:55 2017 From: report at bugs.python.org (=?utf-8?b?SMOla29uIEjDpmdsYW5k?=) Date: Mon, 29 May 2017 08:22:55 +0000 Subject: [New-bugs-announce] [issue30503] It should be possible to use a module name with the same name as a package name Message-ID: <1496046175.66.0.187733028461.issue30503@psf.upfronthosting.co.za> New submission from H?kon H?gland: I have the following folder structure: . ??? aaa ??? ??? bbb ??? ??? ??? ccc.py ??? ??? ??? __init__.py ??? ??? bbb.py ??? ??? __init__.py ??? __init__.py ??? t.py ./t.py: import sys sys.path = ['.'] import aaa.bbb print(aaa.bbb.get_name()) ./aaa/bbb.py: def get_name(): return "aaa/bbb" however, when I run the main script: $ python -B t.py Traceback (most recent call last): File "t.py", line 5, in print(aaa.bbb.get_name()) AttributeError: module 'aaa.bbb' has no attribute 'get_name' The reason is that there is also a package with name 'aaa.bbb' (i.e. file "./aaa/bbb/__init__.py") and python will see this package before it sees my module "./aaa/bbb.py" and will never load the module. If this is correct, than this is a bad design in my opinion. I should be possible to use a module with the same name as a package. Thanks for considering this issue, and let me know if I can help improve Python at this point. Note: I asked the question first at stackoverflow.com: https://stackoverflow.com/q/44227763/2173773 ---------- components: Interpreter Core messages: 294682 nosy: hakonhagland priority: normal severity: normal status: open title: It should be possible to use a module name with the same name as a package name type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 04:59:06 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 29 May 2017 08:59:06 +0000 Subject: [New-bugs-announce] [issue30504] Allow inspecting buffering attribute of IO objects Message-ID: <1496048346.63.0.715963034085.issue30504@psf.upfronthosting.co.za> New submission from Antoine Pitrou: It would be useful to be able to inspect the buffering attribute of buffered and text I/O objects, especially for debugging. I would expect e.g.: >>> sys.stdout.buffering 1 # line-buffered >>> sys.stdout.buffer.buffering 8192 ---------- components: IO messages: 294683 nosy: benjamin.peterson, pitrou, stutzbach priority: normal severity: normal stage: needs patch status: open title: Allow inspecting buffering attribute of IO objects type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 05:16:49 2017 From: report at bugs.python.org (Oren Ben-Kiki) Date: Mon, 29 May 2017 09:16:49 +0000 Subject: [New-bugs-announce] [issue30505] Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance Message-ID: <1496049409.93.0.192071382303.issue30505@psf.upfronthosting.co.za> New submission from Oren Ben-Kiki: In 3.6.0, invocation of isinstance calls typing._ProtocolMeta._get_protocol_attrs. This creates a set of all attributes in all base classes, loops on these attributes to check they exist, and discards the set. It is very slow. My program uses isinstance to allow for flexibility in parameter types in certain key functions. I realize that using isinstance is frowned upon, but it seems to make sense in my case. As a result, >95% of its run-time is inside typing._ProtocolMeta._get_protocol_attrs (!). I have created a simple wrapper around isinstance which caches its result with a Dict[Tuple[type, type], bool]. This solved the performance problem, but introduced a different problem - type checking. I use mypy and type annotations, and my code cleanly type-checks (with the occasional # type: ignore). If I switch to using my own isinstance function, then mypy's type inference no longer treats it as special, so it starts complaining about all uses of values protected by if isinstance(value, SomeType): ... I propose that either the private typing._ProtocolMeta.__subclasscheck__ (which invokes _get_protocol_attrs), or the public isinstance, would be modified to cache their results. I can create a PR for either approach, if this is acceptable. ---------- components: Library (Lib) messages: 294686 nosy: orenbenkiki priority: normal severity: normal status: open title: Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 07:03:04 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 29 May 2017 11:03:04 +0000 Subject: [New-bugs-announce] [issue30506] Replace 'list' with 'array' in array.remove and array.index Message-ID: <1496055784.02.0.613673148776.issue30506@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Changes the error message for array.remove and array.index to say 'array.(x): x not in array' instead of 'array.(x): x not in list'. This is a splinter issue of issue13349. ---------- components: Library (Lib) messages: 294689 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Replace 'list' with 'array' in array.remove and array.index type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 10:49:29 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 29 May 2017 14:49:29 +0000 Subject: [New-bugs-announce] [issue30507] Elements reports it is a list on Element.remove Message-ID: <1496069369.64.0.23526837777.issue30507@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Another splinter issue from issue13349. Currently, Element reports it's a list when remove is called on it: from xml.etree.ElementTree import Element Element('').remove(Element('')) ValueError: list.remove(x): x not in list >From what I understand, this was done in order for it to conform with the error reporting performed from the pure python implementation of Element. (side note: These also differ regarding the type of value supplied to .remove, the C implementation only wants instances of Element) The message, imo, is confusing and should be changed to Element.remove(x): x not in Element. ---------- components: Library (Lib) messages: 294697 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Elements reports it is a list on Element.remove type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 29 22:14:06 2017 From: report at bugs.python.org (Miguel Grinberg) Date: Tue, 30 May 2017 02:14:06 +0000 Subject: [New-bugs-announce] [issue30508] "Task exception was never retrieved" reported for a canceled task Message-ID: <1496110446.47.0.115157551922.issue30508@psf.upfronthosting.co.za> New submission from Miguel Grinberg: I am seeing a strange issue that occurs when a task that is awaiting an asyncio.wait_for() is cancelled. I created a simple example that I think demonstrates the issue, even though it isn't exactly how it manifests on my application. When I run the attached script never-retrieved.py I get the following error: Task exception was never retrieved future: exception=ZeroDivisionError('division by zero',)> Traceback (most recent call last): File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step result = coro.send(None) File "never-retrieved.py", line 5, in crash a = 1/0 ZeroDivisionError: division by zero You can see in the script that the future was cancelled, but the cancel() call was made after the task finished in a zero division error. I think the cancel() call should update the internal state of the future so that the "exception was never retrieved" error does not appear. My application has a more complex setup that I have been unable to reproduce with a simple example. I have a task that is waiting on asyncio.wait_for(fut, timeout), with fut subsequently waiting on a websocket server's receive function. When the websocket client closes the connection, a bunch of cancellations happen, but this future inside the wait_for call crashes before wait_for gets to call cancel() on it. Even though I need to investigate this crash, the fact is that wait_for did cancel this future, but because it already ended in an error the "never retried" error is reported anyway. ---------- components: asyncio files: never-retrieved.py messages: 294732 nosy: Miguel Grinberg, yselivanov priority: normal severity: normal status: open title: "Task exception was never retrieved" reported for a canceled task type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46911/never-retrieved.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 01:56:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 30 May 2017 05:56:40 +0000 Subject: [New-bugs-announce] [issue30509] Optimize calling type slots Message-ID: <1496123800.73.0.877253409287.issue30509@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In excellent Peter Cawley's article "Why are slots so slow?" [1] analysed causes why `a + b` is slower than `a.__add__(b)` for custom __add__ and provided suggestions for optimizing type slot calls. `a + b` and `a.__add__(b)` execute the same user code, `a + b` should have smaller overhead of bytecode interpreting, but it was 2 times slower than `a.__add__(b)`. In the article `a + b` has been made 16% faster than `a.__add__(b)`. In 3.7 the difference between two ways is smaller, but `a + b` still is 25-30% slower than `a.__add__(b)`. After analyzing the article and comparing it with the current code I have found that virtually all proposed optimization steps already applied in 3.7 by Victor! The difference is only in details. The proposed patch tweaks the code and makes `a + b` only 12% slower than `a.__add__(b)`. There is similar effect for other type slot calls. [1] https://www.corsix.org/content/why-are-slots-so-slow ---------- components: Interpreter Core files: type-slot-calls.diff keywords: patch messages: 294739 nosy: haypo, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Optimize calling type slots type: performance versions: Python 3.7 Added file: http://bugs.python.org/file46912/type-slot-calls.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 06:35:54 2017 From: report at bugs.python.org (Hassan El Karouni) Date: Tue, 30 May 2017 10:35:54 +0000 Subject: [New-bugs-announce] [issue30510] c_bool type not supported for BigEndianStructure on little-endian machine Message-ID: <1496140554.49.0.81782531481.issue30510@psf.upfronthosting.co.za> New submission from Hassan El Karouni: When trying to create a BigEndianStructure containing a c_bool field (on a windows machine), i get the following traceback: File "/home/elkarouh/anaconda2/lib/python2.7/ctypes/_endian.py", line 24, in _other_endian raise TypeError("This type does not support other endian: %s" % typ) TypeError: This type does not support other endian: I fixed the problem by patching __init__.py under the ctypes directory by adding the following two lines: c_bool.__ctype_le__ = c_bool.__ctype_be__ = c_bool _check_size(c_bool) ---------- components: ctypes messages: 294747 nosy: Hassan El Karouni priority: normal severity: normal status: open title: c_bool type not supported for BigEndianStructure on little-endian machine type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 09:46:18 2017 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 30 May 2017 13:46:18 +0000 Subject: [New-bugs-announce] [issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe) Message-ID: <1496151978.87.0.20600653197.issue30511@psf.upfronthosting.co.za> New submission from Alex Gaynor: Currently shutil.make_archive uses os.chdir, however there's no need for that. Everything that's done could be equally accomplished with path manipulation: https://github.com/python/cpython/blob/master/Lib/shutil.py#L773-L779 We should switch to using path manipulation in order to make shutil.make_archive thread safe. (Flag: This is probably a good bug for someone with Python skills interested in contributing to CPython!) ---------- components: Library (Lib) messages: 294756 nosy: Alex Gaynor, tarek priority: normal severity: normal status: open title: shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe) versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 10:50:43 2017 From: report at bugs.python.org (Thomas Klausner) Date: Tue, 30 May 2017 14:50:43 +0000 Subject: [New-bugs-announce] [issue30512] CAN Socket support for NetBSD Message-ID: <1496155843.0.0.360939407267.issue30512@psf.upfronthosting.co.za> New submission from Thomas Klausner: NetBSD recently got support for CAN. The existing Linux support for CAN partially detects this, but then fails to build. The attached patch against 3.6.1 (from Manuel Bouyer ) fixes this problem and adds proper NetBSD support for CAN sockets. ---------- components: Build files: can.diff keywords: patch messages: 294764 nosy: wiz priority: normal severity: normal status: open title: CAN Socket support for NetBSD type: compile error versions: Python 3.6 Added file: http://bugs.python.org/file46915/can.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 13:01:19 2017 From: report at bugs.python.org (sam-s) Date: Tue, 30 May 2017 17:01:19 +0000 Subject: [New-bugs-announce] [issue30513] getrusage returns platform-dependent value Message-ID: <1496163679.04.0.847547358971.issue30513@psf.upfronthosting.co.za> New submission from sam-s: `resource.getrusage(resource.RUSAGE_SELF).ru_maxrss` returns the peak memory usage, in *bytes* on BSD (including Mac OS X) and in *kilobytes* on Linux. This means that to get a cross-platform value, the user has to check `sys.platform`, which is fairly inconvenient. It would seem like a good idea to return a platform-independent value (e.g., multiply the Linux return value by 1000 - or is it 1024?!) Please see also * https://bugs.python.org/issue20468 * https://stackoverflow.com/a/7669482/850781 Thank you! ---------- components: Library (Lib) messages: 294768 nosy: sam-s priority: normal severity: normal status: open title: getrusage returns platform-dependent value type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 13:24:00 2017 From: report at bugs.python.org (Grzegorz Grzywacz) Date: Tue, 30 May 2017 17:24:00 +0000 Subject: [New-bugs-announce] [issue30514] test_poplib replace asyncore Message-ID: <1496165040.07.0.652591907468.issue30514@psf.upfronthosting.co.za> New submission from Grzegorz Grzywacz: sub-issue of issue28533 ---------- components: Tests messages: 294770 nosy: grzgrzgrz3 priority: normal severity: normal status: open title: test_poplib replace asyncore versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 13:26:28 2017 From: report at bugs.python.org (sam-s) Date: Tue, 30 May 2017 17:26:28 +0000 Subject: [New-bugs-announce] [issue30515] unittest: assertAlmostEqual rounding error Message-ID: <1496165188.27.0.848186644048.issue30515@psf.upfronthosting.co.za> New submission from sam-s: I get this `unittest` failure: ``` Traceback (most recent call last): File "zzz.py", line 348, in test_opposite self.assertAlmostEqual(a, b, places=2) AssertionError: 1.1036640046288428 != 1.0986122886681098 within 2 places ``` This seems incorrect: 1.1036640046288428 rounded off to 2 places is 1.10 and so is 1.0986122886681098. E.g., in Lisp: ``` > (round 1.1036640046288428d0 0.01) 110 ; 0.0036640292157588336d0 > (round 1.0986122886681098d0 0.01) 110 ; -0.001387686744974238d0 ``` ---------- components: Library (Lib) messages: 294772 nosy: sam-s priority: normal severity: normal status: open title: unittest: assertAlmostEqual rounding error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 17:22:13 2017 From: report at bugs.python.org (=?utf-8?q?Ren=C3=A9_Hern=C3=A1ndez_Remedios?=) Date: Tue, 30 May 2017 21:22:13 +0000 Subject: [New-bugs-announce] [issue30516] Documentation for datetime substract operation incorrect? Message-ID: <1496179333.45.0.413102703331.issue30516@psf.upfronthosting.co.za> New submission from Ren? Hern?ndez Remedios: In the documentation for the supported arithmetic operations for a datetime object, there is the following note, among other: datetime2 = datetime1 - timedelta Comment: Computes the datetime2 such that datetime2 + timedelta == datetime1. As for addition, the result has the same tzinfo attribute as the input datetime, and no time zone adjustments are done even if the input is aware. This isn?t quite equivalent to datetime1 + (-timedelta), because -timedelta in isolation can overflow in cases where datetime1 - timedelta does not. While reading the source code for __sub__ operation I found in the first few lines: Line 1885: def __sub__(self, other): "Subtract two datetimes, or a datetime and a timedelta." if not isinstance(other, datetime): if isinstance(other, timedelta): return self + -other return NotImplemented Is the documentation in contradiction with the actual implementation? ---------- messages: 294787 nosy: Ren? Hern?ndez Remedios priority: normal severity: normal status: open title: Documentation for datetime substract operation incorrect? versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 22:08:08 2017 From: report at bugs.python.org (Max) Date: Wed, 31 May 2017 02:08:08 +0000 Subject: [New-bugs-announce] [issue30517] Enum does not recognize enum.auto as unique values Message-ID: <1496196488.98.0.634063519366.issue30517@psf.upfronthosting.co.za> New submission from Max: This probably shouldn't happen: import enum class E(enum.Enum): A = enum.auto B = enum.auto x = E.B.value print(x) # print(E(x)) # E.A The first print() is kinda ok, I don't really care about which value was used by the implementation. But the second print() seems surprising. By the same token, this probably shouldn't raise an exception (it does now): import enum @enum.unique class E(enum.Enum): A = enum.auto B = enum.auto C = object() and `dir(E)` shouldn't skip `B` in its output (it does now). ---------- components: Library (Lib) messages: 294804 nosy: max priority: normal severity: normal status: open title: Enum does not recognize enum.auto as unique values type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 22:54:11 2017 From: report at bugs.python.org (John Jackson) Date: Wed, 31 May 2017 02:54:11 +0000 Subject: [New-bugs-announce] [issue30518] Import type aliases from another module Message-ID: <1496199251.51.0.430123628937.issue30518@psf.upfronthosting.co.za> New submission from John Jackson: I have a 'base' module where I define some type aliases, such as: from typing import List, Tuple Block = [int, Tuple[int]] Blocks = List[Block] Tags = List[str] I would like to import these aliases into other modules so that the 'base' module provides the definitive alias. Currently, if I attempt to import the type aliases using: from base_module import Tags, Blocks Pycharm shows no error, but when I attempt to execute the code I get the error: ImportError: cannot import name 'Tags' I see that there has been some discussion related to this in 2015, but I can't find any documentation saying that something like this has been implemented. ---------- components: Build messages: 294807 nosy: Paragape priority: normal severity: normal status: open title: Import type aliases from another module type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 30 22:54:13 2017 From: report at bugs.python.org (Andre Wolokita) Date: Wed, 31 May 2017 02:54:13 +0000 Subject: [New-bugs-announce] [issue30519] Add daemon argument to Timer Message-ID: <1496199253.36.0.456621970472.issue30519@psf.upfronthosting.co.za> New submission from Andre Wolokita: Currently in order to have daemonic Timer objects one must instantiate the class, set daemonic status through the property (Timer.daemon=True), and then start the Timer. It would be nice to have the ability to set the daemonic status of the Timer class during instantiation, similar to what is possible with the Thread superclass. This is a trivial enhancement to implement: simply add the daemon keyword argument to the Timer constructor, defaulted to None, and pass it on to the Thread constructor in the call to super().__init__. ---------- messages: 294808 nosy: awolokita priority: normal pull_requests: 1958 severity: normal status: open title: Add daemon argument to Timer type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 03:50:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 May 2017 07:50:48 +0000 Subject: [New-bugs-announce] [issue30520] loggers can't be pickled Message-ID: <1496217048.71.0.370871054359.issue30520@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Loggers could simply be pickled and unpickled by name, but pickle currently tries the hard way: >>> import pickle >>> import logging >>> log = logging.getLogger('foo') >>> pickle.dumps(log) Traceback (most recent call last): File "", line 1, in pickle.dumps(log) TypeError: can't pickle _thread.RLock objects ---------- components: Library (Lib) messages: 294818 nosy: pitrou, vinay.sajip priority: normal severity: normal status: open title: loggers can't be pickled type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 04:02:16 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 31 May 2017 08:02:16 +0000 Subject: [New-bugs-announce] [issue30521] IDLE: Add navigate bar and replace current goto dialog Message-ID: <1496217736.64.0.123972960126.issue30521@psf.upfronthosting.co.za> New submission from Louie Lu: Propose a sublime-like navigate bar to replace current goto dialog. Navigate bar current support two different mode: prefix ':' for goto line, and prefix '@' for goto symbol. When user use shortcut Ctrl+G to open goto line, it will prompt out a navigate bar on the top of the editor.text with prefix ':', user can enter valid lineno, and it will highlight the line on the editor. After return, it will close the navigate bar and clear the highlight, user cursor will be set to the target lineno. ---------- assignee: terry.reedy components: IDLE messages: 294819 nosy: louielu, terry.reedy priority: normal severity: normal status: open title: IDLE: Add navigate bar and replace current goto dialog type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 04:09:10 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 May 2017 08:09:10 +0000 Subject: [New-bugs-announce] [issue30522] Allow replacing a StreamHandler's stream Message-ID: <1496218150.64.0.987173470763.issue30522@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Right now it is probably possible using something like: handler.acquire() try: handler.flush() handler.stream = new_stream finally: handler.release() but it would be nice to have an officially-supported method to do that. Context: if I reconfigure sys.stderr, I'd like to update all handlers that have a reference to the old sys.stderr. ---------- messages: 294820 nosy: pitrou, vinay.sajip priority: normal severity: normal status: open title: Allow replacing a StreamHandler's stream type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 05:22:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 31 May 2017 09:22:37 +0000 Subject: [New-bugs-announce] [issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests Message-ID: <1496222557.85.0.438733952805.issue30523@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached pull requests adds a --list-tests option to only display the list of test names, don't run tests. It's a first step to implement the issue #29512: "regrtest refleak: implement bisection feature". ---------- components: Tests messages: 294825 nosy: ezio.melotti, haypo, michael.foord, rbcollins priority: normal severity: normal status: open title: unittest: add --list-tests option to only display the list of test names, don't run tests type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 08:01:15 2017 From: report at bugs.python.org (Martijn Pieters) Date: Wed, 31 May 2017 12:01:15 +0000 Subject: [New-bugs-announce] [issue30524] iter(classmethod, sentinel) broken for Argument Clinic class methods? Message-ID: <1496232075.99.0.36248414101.issue30524@psf.upfronthosting.co.za> New submission from Martijn Pieters: I'm not sure where exactly the error lies, but issue 27128 broke iter() for Argument Clinic class methods. The following works in Python 3.5, but not in Python 3.6: from datetime import datetime from asyncio import Task next(iter(datetime.now, None)) next(iter(Task.all_tasks, None)) In 3.6 StopIteration is raised: >>> next(iter(datetime.now, None)) Traceback (most recent call last): File "", line 1, in StopIteration >>> next(iter(Task.all_tasks, None)) Traceback (most recent call last): File "", line 1, in StopIteration (In 3.5 a `datetime.datetime` and `set` object are produced, respectively) The only thing these two methods have in common is that they are class methods with no arguments, parsed out by the Argument Clinic generated code (so using _PyArg_Parser). What appears to have changed is that iter() was switched from using PyObject_Call to _PyObject_FastCall, see https://github.com/python/cpython/commit/99ee9c70a73ec2f3db68785821a9f2867c3f637f ---------- messages: 294835 nosy: mjpieters priority: normal severity: normal status: open title: iter(classmethod, sentinel) broken for Argument Clinic class methods? versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 08:21:52 2017 From: report at bugs.python.org (Alex Gaynor) Date: Wed, 31 May 2017 12:21:52 +0000 Subject: [New-bugs-announce] [issue30525] Expose SCTs on TLS connections Message-ID: <1496233312.72.0.638169189351.issue30525@psf.upfronthosting.co.za> New submission from Alex Gaynor: CT (https://www.certificate-transparency.org/) is starting to become a thing! It'd be great if we exposed SCTs (whether from TLS extensions, OCSP, or embedded in the certificate) for TLS connections. This would allow higher level protocols to begin acting on them. This would need to be an OpenSSL 1.1.0+ feature. ---------- assignee: christian.heimes components: SSL messages: 294838 nosy: alex, christian.heimes, dstufft, janssen priority: normal severity: normal status: open title: Expose SCTs on TLS connections versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 12:15:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 May 2017 16:15:46 +0000 Subject: [New-bugs-announce] [issue30526] Allow setting line_buffering on existing TextIOWrapper Message-ID: <1496247346.69.0.574083557121.issue30526@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Currently, if you want to change the line buffering behaviour of standard streams, you can create a new stream and assign it to sys.{stdout,stderr,stdin}. Unfortunately, it is common for references to the old streams to be stored in various places (such as logging configuration, or third-party libraries). Replacing them all is probably a hopeless cause. It would be much better if one could simply write `sys.stdout.line_buffering = True` and be done with it. ---------- components: IO messages: 294850 nosy: benjamin.peterson, pitrou, stutzbach priority: normal severity: normal status: open title: Allow setting line_buffering on existing TextIOWrapper type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 12:35:05 2017 From: report at bugs.python.org (Christoph Reiter) Date: Wed, 31 May 2017 16:35:05 +0000 Subject: [New-bugs-announce] [issue30527] PyMemoryView_FromBuffer memory leak Message-ID: <1496248505.52.0.454625386469.issue30527@psf.upfronthosting.co.za> New submission from Christoph Reiter: I'm using the following code PyObject * get_memoryview (PyObject *self) { Py_buffer view; ... // this takes a ref on self if (PyBuffer_FillInfo (&view, self, buffer, length, 0, 0) < 0) return NULL; // this returns a object return PyMemoryView_FromBuffer (&view); } The problem is that when I call release() on the returned memory object the buffer does not get release and as a result the exporter leaks. Am I missing something or is this a bug? ---------- messages: 294851 nosy: lazka priority: normal severity: normal status: open title: PyMemoryView_FromBuffer memory leak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 13:15:31 2017 From: report at bugs.python.org (Hristo Venev) Date: Wed, 31 May 2017 17:15:31 +0000 Subject: [New-bugs-announce] [issue30528] ipaddress.IPv{4, 6}Network.reverse_pointer is broken Message-ID: <1496250931.44.0.236459920081.issue30528@psf.upfronthosting.co.za> New submission from Hristo Venev: `ipaddress.IPv4Network('127.0.0.0/16').reverse_pointer = '0/16.0.0.127.in-addr.arpa'` is definitely wrong. I think it should be '0.127.in-addr.arpa'. A funnier case, `ipaddress.IPv6Network('2001:db8::/32').reverse_pointer = '2.3./.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'`. For the case where no single reverse pointer exists (e.g. `127.0.0.0/13`), I think it should be `None`. ---------- components: Library (Lib) messages: 294854 nosy: h.venev priority: normal severity: normal status: open title: ipaddress.IPv{4,6}Network.reverse_pointer is broken type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 16:24:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 31 May 2017 20:24:52 +0000 Subject: [New-bugs-announce] [issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions Message-ID: <1496262292.77.0.0898281487446.issue30529@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Python parser supports only ' ', '\t', '\x0c' and '\r' as whitespaces. The parser of f-strings raises incorrect error messages for subexpressions consistent only from whitespaces, if they contain whitespaces out this set. >>> eval("\xa0") Traceback (most recent call last): File "", line 1, in File "", line 1 ? ^ SyntaxError: invalid character in identifier >>> eval("f'''{\xa0}'''") Traceback (most recent call last): File "", line 1, in File "", line 1 SyntaxError: f-string: empty expression not allowed ---------- components: Interpreter Core messages: 294869 nosy: eric.smith, serhiy.storchaka priority: normal severity: normal status: open title: Incorrect error messages for invalid whitespaces in f-string subexpressions type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 17:11:25 2017 From: report at bugs.python.org (Mariano Anaya) Date: Wed, 31 May 2017 21:11:25 +0000 Subject: [New-bugs-announce] [issue30530] Descriptors HowTo: Example on function.__get__ needs update Message-ID: <1496265085.29.0.159074921199.issue30530@psf.upfronthosting.co.za> New submission from Mariano Anaya: The example on which tries to create a method from the function's __get__ doesn't work for Python 3.5+. It would give this error: TypeError: method expected 2 arguments, got 3 The 3rd parameter, needs to be removed. ---------- assignee: docs at python components: Documentation messages: 294871 nosy: Mariano Anaya, docs at python priority: normal pull_requests: 1967 severity: normal status: open title: Descriptors HowTo: Example on function.__get__ needs update versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 17:29:51 2017 From: report at bugs.python.org (Thomas Shinnick) Date: Wed, 31 May 2017 21:29:51 +0000 Subject: [New-bugs-announce] [issue30531] Windows 10 3.6.1 install disallows pip installs of packages Message-ID: <1496266191.79.0.841695217582.issue30531@psf.upfronthosting.co.za> New submission from Thomas Shinnick: Installed using python-3.6.1-amd64.exe then tried to pip install a package. Repeatedly had to manually intervene to open up permissions on python install subdirs, after getting these errors one at a time from pip: PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python 3.6\\Lib\\site-packages\\fontTools' PermissionError: [Errno 13] Permission denied: 'c:\\program files\\python 3.6\\Scripts\\pylupdate5.exe' PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python 3.6\\share' Gave up and set "full control" on \python 3.6\ dir and contents. It seems permissions default to "read-only" subdirs which makes pip installs impossible. Install and pip used under same userid and same session. I thought I'd clicked yes to any question "install for all users". ---------- components: Installation messages: 294872 nosy: Thomas Shinnick priority: normal severity: normal status: open title: Windows 10 3.6.1 install disallows pip installs of packages type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 18:08:53 2017 From: report at bugs.python.org (Chris Bradley) Date: Wed, 31 May 2017 22:08:53 +0000 Subject: [New-bugs-announce] [issue30532] email.policy.SMTP.fold() mangles long headers Message-ID: <1496268533.13.0.885025594185.issue30532@psf.upfronthosting.co.za> New submission from Chris Bradley: When email.policy.SMTP.fold() attempts to wrap a line in which a chunk that does not contain a space is longer than the maximum line length, two things go wrong: - The second line does not begin with a space, creating an invalid header. - The space before the long chunk is stripped, causing the line break to occur in an invalid place. In the attached test case, email.policy.SMTP.fold() is called on a line of the style: Content-Disposition: attachment; filename="" does not contain any spaces and increases in length with each pass. Everything works correctly when 'filename=""' fits onto one line. However, once it is longer than the maximum line length, the following happens: - the space after the semicolon is dropped - the line break often splits up the 'filename' keyword - the second line loses the initial whitespace ---------- files: test_long_mime_headers.py messages: 294875 nosy: chrisb at emergence.com priority: normal severity: normal status: open title: email.policy.SMTP.fold() mangles long headers versions: Python 3.5 Added file: http://bugs.python.org/file46917/test_long_mime_headers.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 31 18:52:48 2017 From: report at bugs.python.org (Carl Meyer) Date: Wed, 31 May 2017 22:52:48 +0000 Subject: [New-bugs-announce] [issue30533] missing feature in inspect module: getmembers_static Message-ID: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za> New submission from Carl Meyer: The inspect module contains a getattr_static() function, for accessing an arbitrary attribute on a Python object without risking descriptor or __getattr__ code execution. This is useful for introspection tools that don't want to trigger any side effects. The inspect module also contains a getmembers() function, which returns a mapping of names to values for all the object's members. This function could also be very useful to introspection tools, except that internally it uses normal getattr, thus reintroduces the risk of arbitrary code execution. It would be useful to have an equivalent to getmembers() that is descriptor-safe. This could be done either by introducing a new getmembers_static(), or possibly by adding a `getattr` optional keyword argument to getmembers, that would take a getattr-equivalent callable to use in fetching attributes from the object. (The latter option might render some internal assumptions of getmembers() incorrect, needs experimentation.) ---------- components: Library (Lib) messages: 294876 nosy: carljm priority: normal severity: normal status: open title: missing feature in inspect module: getmembers_static type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________