From report at bugs.python.org Fri Jul 1 03:42:00 2016 From: report at bugs.python.org (=?utf-8?q?Ville_Skytt=C3=A4?=) Date: Fri, 01 Jul 2016 07:42:00 +0000 Subject: [New-bugs-announce] [issue27430] Spelling fixes Message-ID: <1467358920.61.0.353928601124.issue27430@psf.upfronthosting.co.za> Changes by Ville Skytt? : ---------- files: spelling.patch keywords: patch nosy: scop priority: normal severity: normal status: open title: Spelling fixes type: enhancement Added file: http://bugs.python.org/file43597/spelling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 05:17:42 2016 From: report at bugs.python.org (Sander Steffann) Date: Fri, 01 Jul 2016 09:17:42 +0000 Subject: [New-bugs-announce] [issue27431] Shelve pickle version error Message-ID: <1467364662.95.0.314062070458.issue27431@psf.upfronthosting.co.za> New submission from Sander Steffann: The "class shelve.Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')" section still says "By default, version 0 pickles are used to serialize values.". This is incorrect. The default version has been 3 since this commit: https://hg.python.org/cpython/file/f351fb7ea179/Lib/shelve.py ---------- assignee: docs at python components: Documentation messages: 269652 nosy: Sander Steffann, docs at python priority: normal severity: normal status: open title: Shelve pickle version error type: enhancement versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 05:27:49 2016 From: report at bugs.python.org (Camilla Ke) Date: Fri, 01 Jul 2016 09:27:49 +0000 Subject: [New-bugs-announce] [issue27432] Unittest truncating of error message not works Message-ID: <1467365269.89.0.517880663648.issue27432@psf.upfronthosting.co.za> New submission from Camilla Ke: Builtin assert methods output messages no matter how length is the output messages. However, content with exceeding length should be truncated. I found an error in the function. The function is safe_repr() in util.py if len(result) > _MAX_LENGTH, it should return truncated content, but "short" is default to False. unittest/util.py def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...' ---------- components: Library (Lib) messages: 269653 nosy: Camilla Ke priority: normal severity: normal status: open title: Unittest truncating of error message not works type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 06:25:52 2016 From: report at bugs.python.org (Tobias Burnus (PDF)) Date: Fri, 01 Jul 2016 10:25:52 +0000 Subject: [New-bugs-announce] [issue27433] Missing "as err" in Lib/socket.py Message-ID: <1467368752.52.0.502124517419.issue27433@psf.upfronthosting.co.za> New submission from Tobias Burnus (PDF): Cf. https://hg.python.org/cpython/file/tip/Lib/socket.py#l261 In _sendfile_use_sendfile, one has: try: fsize = os.fstat(fileno).st_size except OSError: raise _GiveupOnSendfile(err) # not a regular file I think the "err" in the last line will only work if there is an "as err" in the "except" line. ---------- components: Library (Lib) messages: 269656 nosy: Tobias Burnus (PDF) priority: normal severity: normal status: open title: Missing "as err" in Lib/socket.py versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 09:00:22 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 01 Jul 2016 13:00:22 +0000 Subject: [New-bugs-announce] [issue27434] cross-building python 3.6 with an older interpreter fails Message-ID: <1467378022.01.0.957641757812.issue27434@psf.upfronthosting.co.za> New submission from Xavier de Gaye: Cross-building the 3.6 source with PYTHON_FOR_BUILD using archlinux python 3.5.1 as found in PATH, fails with: _PYTHON_PROJECT_BASE=/home/xavier/src/android/pyona/build/python3.6-android-21-x86 _PYTHON_HOST_PLATFORM=linux-x86 PYTHONPATH=/home/xavier/src/packages/android/cpython/Lib:/home/xavier/src/packages/android/cpython/Lib/plat-i386-linux-gnu python3 -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Could not import runpy module Traceback (most recent call last): File "/home/xavier/src/packages/android/cpython/Lib/runpy.py", line 15, in import importlib.util File "/home/xavier/src/packages/android/cpython/Lib/importlib/util.py", line 25 raise ValueError(f'no package specified for {repr(name)} ' ^ SyntaxError: invalid syntax generate-posix-vars failed The reason is that the syntax of formatted string literals is unknown to python 3.5. ---------- components: Cross-Build messages: 269666 nosy: Alex.Willmer, doko, xdegaye priority: normal severity: normal stage: needs patch status: open title: cross-building python 3.6 with an older interpreter fails type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 10:34:59 2016 From: report at bugs.python.org (aixtools) Date: Fri, 01 Jul 2016 14:34:59 +0000 Subject: [New-bugs-announce] [issue27435] ctypes and AIX - also for 2.7.X (and later) Message-ID: <1467383699.63.0.495142233463.issue27435@psf.upfronthosting.co.za> New submission from aixtools: I am opening a new issue # - about the same problem described in 26439, but now calling it a bug rather than a behavior change. Then I did not know better - all was new, and as the "new" kid I felt uncomfortable calling it a bug - when maybe it was just behavior I did not understand However, with the feedback from code review I am beginning to understand what the ctypes functionality is: ctypes.find_library() and cdll.LoadLibrary (aka CDLL) in __init__.py it is clear that there is one entry point for LoadLibrary. For find_library(), I assume overtime, the development led to six (6) definitions - and I am proposing a 7th. The pseudo_code is roughly this (although import ctypes._$_platform._xxx may be incorrect syntax) def find_library(name) import os,sys _platform = sys.platform import ctypes._$_platform._find_library as _find_library return(_find_library(name)) Unclear is how a regular .so file should be treated by find_library() when the actual file is not prefixed by the string "lib", e.g., sudoers.so - should it only look for libsudoers.so even though Currently it is "defined" 7 times (including the definition I added at line 79) because - again - util.py defines find_library several times - only one of the definitions is called dependent on the os.name or os.name + platform. Within the os.name() and sys.platform code block there are sufficient "liberities" to call external programs used to determine where (i.e., find) the library is - and what it's correct prefix and suffix is. +6 # find_library(name) returns the pathname of a library, or None. +49 def find_library(name): in block if os.name == "nt" +71 def find_library(name): if os.name == "ce" return None +79 def find_library(name): if sys.platform.startswith("aix") return ctypes._aixutils.find_library(name) +84 def find_library(name): elif os.name == "posix" and sys.platform == "darwin": +95 elif os.name == "posix": +177 def find_library(name): inside: if (sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd") or sys.platform.startswith("dragonfly")): +217 def find_library(name, is64 = False): inside: elif sys.platform == "sunos5": +220 else: +249 def find_library(name): +250 return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ++++++ Getting back to my patch development - initially I was adding code to both util.py and __init__.py and putting everything in " startswith("aix")" blocks. As I thought, in error, find_library() was to make visible what CDLL was finding on it's own I was also doing find_library() like behavior. Rather than have the same code in two files I moved the code into a new file - now named _aixutils.py. So, this looks like a design change, but it is not. All this code could be re-indented and inserted into util.py. IMHO, in a separate file the changes are easier to follow. If a seperate file means it cannot be accepted into python-2.7.X then the code needs to be moved back into util.py Note: the extra tests added to util.py are only for my enjoyment, i.e., verification of several cases I have experienced while porting other packages. Think of them as not being there (for now, if not for always). Once I knew what CDLL(None) was suppossed to That is why my first patch had CDLL() also calling ctypes._aixutils - to only edit once. Once I learned how wrong I was - that was removed - and it just remained this way as "eye-candy". +++ Closing +++ find_library() is defined multiple times, so adding one for aix is not a design change, i.e., behavior modification rather, find_library - as defined for aix in "default block" (elif os.name = "posix": ... else: ...) specifically calling _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) is a "bug of ommission" because the programs the two routines called depend on: ldconfig and gcc are not, normally present on AIX. My patch is a different way changing line 250 from return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) to return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) or _findAIXmember(name) or _find_Soname_dump(name) with, of course def _findAIXmember() and def _findSoname_dump() defined within the limits of util.py Instead, I have "hard-coded" an approach similar to the psuedo code example. +++ Disclaimer :P +++ As I am still relatively new, if I am still not understanding the official definition of ctypes.find_library() - I apologize. util.py is, due to is many defines of find_library() was difficult for me to grasp the difference between permissible and "not done". Going back to the earliest documentation I could find for ctypes https://docs.python.org/2.6/library/ctypes.html (new in 2.5) the key lines are: ctypes exports the cdll, and on Windows windll and oledll objects, for loading dynamic link libraries. You load libraries by accessing them as attributes of these objects. cdll loads libraries which export functions using the standard cdecl calling convention, while ... For find_library() - the documentation is quite clear - find_library is system dependent - mentioning that "linux", as one example, uses ldconfig to find libraries: 15.15.2.1. Finding shared libraries When programming in a compiled language, shared libraries are accessed when compiling/linking a program, and when the program is run. The purpose of the find_library() function is to locate a library in a way similar to what the compiler does (on platforms with several versions of a shared library the most recent should be loaded), while the ctypes library loaders act like when a program is run, and call the runtime loader directly. The ctypes.util module provides a function which can help to determine the library to load. ctypes.util.find_library(name) Try to find a library and return a pathname. name is the library name without any prefix like lib, suffix like .so, .dylib or version number (this is the form used for the posix linker option -l). If no library can be found, returns None. The exact functionality is system dependent. On Linux, find_library() tries to run external programs (/sbin/ldconfig, gcc, and objdump) to find the library file. It returns the filename of the library file. .... In short, I believe there is sufficient clarity in the initial documentation - that it is an "error of ommission" (so maybe "shame on IBM" that noone took this up years ago) and has every right as Linux, Solaris, openBSD, etc.. to have the system dependent glue that is needed to work "natively" on the platform. -- but I am biased -- so if I am wrong - please be kind. Note: goal is to have the new patch, still with _aixutil.py as a matter of textual clarity rather than as language/module syntax. If being in a different file is the primary/only objection then, when I am again able to devote time - I will move the code into an "aix" block within util.py ---------- components: ctypes messages: 269673 nosy: aixtools at gmail.com priority: normal severity: normal status: open title: ctypes and AIX - also for 2.7.X (and later) versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 11:33:27 2016 From: report at bugs.python.org (David Beazley) Date: Fri, 01 Jul 2016 15:33:27 +0000 Subject: [New-bugs-announce] [issue27436] Strange code in selectors.KqueueSelector Message-ID: <1467387207.61.0.938158843585.issue27436@psf.upfronthosting.co.za> New submission from David Beazley: Not so much a bug, but an observation based on reviewing the implementation of the selectors.KqueueSelector class. In that class there is the select() method: def select(self, timeout=None): timeout = None if timeout is None else max(timeout, 0) max_ev = len(self._fd_to_key) ready = [] try: kev_list = self._kqueue.control(None, max_ev, timeout) except InterruptedError: return ready for kev in kev_list: fd = kev.ident flag = kev.filter events = 0 if flag == select.KQ_FILTER_READ: events |= EVENT_READ if flag == select.KQ_FILTER_WRITE: events |= EVENT_WRITE key = self._key_from_fd(fd) if key: ready.append((key, events & key.events)) return ready The for-loop looks like it might be checking flags against some kind of bit-mask in order to build events. However, if so, the code just looks wrong. Wouldn't it use the '&' operator (or some variant) instead of '==' like this? for kev in kev_list: fd = kev.ident flag = kev.filter events = 0 if flag & select.KQ_FILTER_READ: events |= EVENT_READ if flag & select.KQ_FILTER_WRITE: events |= EVENT_WRITE If it's not a bit-mask, then wouldn't the code be simplified by something like this? for kev in kev_list: fd = kev.ident flag = kev.filter if flag == select.KQ_FILTER_READ: events = EVENT_READ elif flag == select.KQ_FILTER_WRITE: events = EVENT_WRITE Again, not sure if this is a bug or not. It's just something that looks weirdly off. ---------- components: Library (Lib) messages: 269676 nosy: dabeaz priority: normal severity: normal status: open title: Strange code in selectors.KqueueSelector type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 1 15:19:32 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Jul 2016 19:19:32 +0000 Subject: [New-bugs-announce] [issue27437] IDLE tests must be able to set user configuration values. Message-ID: <1467400772.1.0.605855673918.issue27437@psf.upfronthosting.co.za> New submission from Terry J. Reedy: An important feature of IDLE is that it has default configuration values in idlelib/config-xyz.def files that can be overriden by user values in $HOME/.idlerc/config-xyz.cfg files. IDLE should run and tests should pass both without and with user overrides. IDLE's config module currently hard-codes the file names. However, configparser can read from files it opens from a filename (.read), iterables of strings (.read_file), strings (.read_string), and dictionaries (.read_dict). This issue is about exposing this flexibility to IDLE tests and being able to clear and reset the user values for each test. ---------- assignee: terry.reedy messages: 269685 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE tests must be able to set user configuration values. type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 02:40:08 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jul 2016 06:40:08 +0000 Subject: [New-bugs-announce] [issue27438] Refactot simple iterators implementation Message-ID: <1467441608.13.0.484194759608.issue27438@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The implementation of iterators for str, bytes, bytearray, tuple and list is virtually the same. Proposed patch moves common code to the template file iterlib.h and parametrizes it with few macros. The patch decreases the number of source lines by 600. Makefile.pre.in | 2 Objects/bytearrayobject.c | 165 ------------ Objects/bytesobject.c | 167 ------------- Objects/iterlib.h | 168 +++++++++++++ Objects/listobject.c | 468 ++++++++++-------------------------- Objects/tupleobject.c | 156 ------------ Objects/unicodeobject.c | 171 ------------- PCbuild/pythoncore.vcxproj | 1 PCbuild/pythoncore.vcxproj.filters | 3 9 files changed, 349 insertions(+), 942 deletions(-), 10 modifications(!) ---------- components: Interpreter Core files: iterlib.patch keywords: patch messages: 269703 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Refactot simple iterators implementation type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43605/iterlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 07:40:48 2016 From: report at bugs.python.org (Utkan Gezer) Date: Sat, 02 Jul 2016 11:40:48 +0000 Subject: [New-bugs-announce] [issue27439] product function patch Message-ID: <1467459648.57.0.0102935074886.issue27439@psf.upfronthosting.co.za> New submission from Utkan Gezer: An issue of enhancement by the introduction of a built-in product() function for the multiplication operation, functions similar to how sum does for the addition operation. This issue is a reincarnation of Issue 1093 for Python 2.6, now for 3.6. Ref: http://bugs.python.org/issue1093 ---------- messages: 269706 nosy: Utkan Gezer priority: normal severity: normal status: open title: product function patch type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 09:32:29 2016 From: report at bugs.python.org (Shubham Singh) Date: Sat, 02 Jul 2016 13:32:29 +0000 Subject: [New-bugs-announce] [issue27440] Trigonometric bug Message-ID: <1467466349.47.0.855783586648.issue27440@psf.upfronthosting.co.za> New submission from Shubham Singh: The value of sine and tangent, using math module is showing wrong.Screenshot is attached. ---------- components: Extension Modules, Windows files: Sin.jpg messages: 269711 nosy: ShubhamSingh.er, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Trigonometric bug type: resource usage versions: Python 3.5 Added file: http://bugs.python.org/file43606/Sin.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 10:38:57 2016 From: report at bugs.python.org (Oren Milman) Date: Sat, 02 Jul 2016 14:38:57 +0000 Subject: [New-bugs-announce] [issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned Message-ID: <1467470337.8.0.776341442151.issue27441@psf.upfronthosting.co.za> New submission from Oren Milman: ------------ current state ------------ In six different functions, the following happens: 1. Function x calls _PyLong_New, with var y as the size argument. * Among others, _PyLong_New sets the ob_size of the new int to y (the size argument it received). 2. Function x sets the ob_size of the new int to y, even though y is already the value of ob_size. The functions in which this happens are: 1. in Objects/longobject.c: - PyLong_FromUnsignedLong - PyLong_FromLongLong - PyLong_FromUnsignedLongLong - PyLong_FromSsize_t - PyLong_FromSize_t 2. in Python/marshal.c: - r_PyLong With regard to relevant changes made in the past, it seems that the redundant assignment was added (in each of these six functions) on the last major rewriting of the function, or when the function was first added, and remained there to this day. The revisions in which the redundant assignments were added: 1. changeset 18114 (https://hg.python.org/cpython/rev/31cd0db0f09f): - PyLong_FromUnsignedLong 2. changeset 38307 (https://hg.python.org/cpython/rev/5a63369056a7): - PyLong_FromLongLong - PyLong_FromUnsignedLongLong 3. changeset 46460 (https://hg.python.org/cpython/rev/b04f2052e812): - PyLong_FromSize_t - PyLong_FromSsize_t 4. changeset 52215 (https://hg.python.org/cpython/rev/bb5de24a343f): - r_PyLong ------------ proposed changes ------------ Remove these six redundant assignments. ------------ diff ------------ The proposed patches diff file is attached. ------------ tests ------------ I built the patched CPython for x86, and played with it a little. Everything seemed to work as usual. In addition, I ran 'python_d.exe -m test -j3' (on my 64-bit Windows 10) with and without the patches, and got quite the same output. The outputs of both runs are attached. ---------- components: Interpreter Core files: CPythonTestOutput.txt messages: 269715 nosy: Oren Milman priority: normal severity: normal status: open title: redundant assignments to ob_size of new ints that _PyLong_New returned type: performance Added file: http://bugs.python.org/file43607/CPythonTestOutput.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 10:52:55 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 02 Jul 2016 14:52:55 +0000 Subject: [New-bugs-announce] [issue27442] expose Android API level in sys.implementation Message-ID: <1467471175.35.0.000904857777026.issue27442@psf.upfronthosting.co.za> New submission from Xavier de Gaye: Expose the Android API level that python was built against, in sys.implementation as _android_api. Purposes: * Identify the platform as Android. * Allow detecting a mismatch with the runtime sdk version returned by platform.android_ver() (issue 26855), for example when the runtime sdk is lower than the built API level. ---------- assignee: xdegaye components: Interpreter Core messages: 269716 nosy: haypo, xdegaye priority: normal severity: normal status: open title: expose Android API level in sys.implementation type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 15:53:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Jul 2016 19:53:54 +0000 Subject: [New-bugs-announce] [issue27443] __length_hint__() of bytearray iterator can return negative integer Message-ID: <1467489234.07.0.837465555055.issue27443@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: >>> ba = bytearray(b'ab') >>> it = iter(ba) >>> next(it) 97 >>> ba.clear() >>> list(it) Traceback (most recent call last): File "", line 1, in ValueError: __length_hint__() should return >= 0 Proposed patch fixes this issue. ---------- components: Interpreter Core files: bytearray_iterator_length_hint.patch keywords: patch messages: 269729 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: __length_hint__() of bytearray iterator can return negative integer type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43612/bytearray_iterator_length_hint.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 17:10:51 2016 From: report at bugs.python.org (Greg Stark) Date: Sat, 02 Jul 2016 21:10:51 +0000 Subject: [New-bugs-announce] [issue27444] Python doesn't build due to test_float.py broken on non-IEEE machines Message-ID: <1467493851.35.0.417072100147.issue27444@psf.upfronthosting.co.za> New submission from Greg Stark: The file Test/test_float.py has a decorator for tests that must be skipped on non-IEEE machines. However just eyeballing it it seems there are a few tests that test behaviour around Inf and NaN that are lacking this decorator. Alternately it's possible this is actually a core interpreter bug where even code which is never called is now triggering floating point exceptions due to some constant propagation optimization or something like that. To reproduce, try to install on a non-IEE machine such as a VAX and your install will crash with: Compiling /usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/test/test_filecmp.py ... Compiling /usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/test/test_fileinput.py ... Compiling /usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/test/test_fileio.py ... Compiling /usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/test/test_float.py ... [1] Floating point exception (core dumped) PYTHONPATH=/usr/... *** Error code 136 Stop. make: stopped in /usr/pkgsrc/lang/python27/work/Python-2.7.10 *** Error code 1 I do happen to have been compiling with -O0 -g so I have a core file and a binary with symbols (if you have a VAX gdb...) but here's the backtrace: #0 0x7f687748 in float_mul (v=0x7ee82f54, w=0x7ee82f54, 2129145684, 2129145684) at Objects/floatobject.c:658 #1 0x7f65eb56 in binary_op1 (v=0x7ee82f54, w=0x7ee82f54, op_slot=8, 2129145684, 2129145684, 8) at Objects/abstract.c:945 #2 0x7f65f572 in PyNumber_Multiply (v=0x7ee82f54, w=0x7ee82f54, 2129145684, 2129145684) at Objects/abstract.c:1216 #3 0x7f72e573 in fold_binops_on_constants (codestr=0x7f28b169 "d\001", consts=0x7f0b5dcc, 2133373289, 2131451340) at Python/peephole.c:108 #4 0x7f72f56c in PyCode_Optimize (code=0x7f3316a8, consts=0x7f0b5dcc, names=0x7f0948ec, lineno_obj=0x7f0b5840, 2134054568, 2131451340, 2131314924, 2131449920) at Python/peephole.c:482 #5 0x7f71d3ad in makecode (c=0x7fffc810, a=0x7fffc5b0, 2147469328, 2147468720) at Python/compile.c:3883 #6 0x7f71d77d in assemble (c=0x7fffc810, addNone=1, 2147469328, 1) at Python/compile.c:3999 #7 0x7f717527 in compiler_function (c=0x7fffc810, s=0x7eb82bf0, 2147469328, 2125999088) at Python/compile.c:1422 #8 0x7f719552 in compiler_visit_stmt (c=0x7fffc810, s=0x7eb82bf0, 2147469328, 2125999088) at Python/compile.c:2122 #9 0x7f716d00 in compiler_body (c=0x7fffc810, stmts=0x7ebc88f8, 2147469328, 2126285048) at Python/compile.c:1209 #10 0x7f717882 in compiler_class (c=0x7fffc810, s=0x7ebd2608, 2147469328, 2126325256) at Python/compile.c:1477 #11 0x7f719564 in compiler_visit_stmt (c=0x7fffc810, s=0x7ebd2608, 2147469328, 2126325256) at Python/compile.c:2124 #12 0x7f716d00 in compiler_body (c=0x7fffc810, stmts=0x7eb53010, 2147469328, 2125803536) at Python/compile.c:1209 #13 0x7f716db6 in compiler_mod (c=0x7fffc810, mod=0x7ebe1438, 2147469328, 2126386232) at Python/compile.c:1229 #14 0x7f7151f3 in PyAST_Compile (mod=0x7ebe1438, filename=0x7f2c15b4 "/usr/pkg/lib/python2.7/test/test_float.py", flags=0x7fffc8c0, arena=0x7f3482f0, 2126386232, 2133595572, 2147469504, 2134147824) at Python/compile.c:292 #15 0x7f733849 in Py_CompileStringFlags ( str=0x7eb43014 "\nimport unittest, struct\nimport os\nfrom test import test_support\nimport math\nfrom math import isinf, isnan, copysign, ldexp\nimport operator\nimport random\nimport fractions\nimport sys\nimport time\n\nINF ="..., filename=0x7f2c15b4 "/usr/pkg/lib/python2.7/test/test_float.py", start=257, flags=0x7fffc8c0, 2125738004, 2133595572, 257, 2147469504) at Python/pythonrun.c:1428 #16 0x7f705dc6 in builtin_compile (self=0x0, args=0x7f08f914, kwds=0x0, 0, 2131294484, 0) at Python/bltinmodule.c:559 #17 0x7f6a5b8a in PyCFunction_Call (func=0x7f32a96c, arg=0x7f08f914, kw=0x0, 2134026604, 2131294484, 0) at Objects/methodobject.c:85 #18 0x7f713023 in call_function (pp_stack=0x7fffca44, oparg=3, 2147469892, 3) at Python/ceval.c:4035 #19 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f29568c, throwflag=0, 2133415564, 0) at Python/ceval.c:2681 #20 0x7f711523 in PyEval_EvalCodeEx (co=0x7f25cad0, globals=0x7f29a3e4, locals=0x0, args=0x7f3b7874, argcount=4, kws=0x7f3b7884, kwcount=0, defs=0x7f29d3a8, defcount=3, closure=0x0, 2133183184, 2133435364, 0, 2134603892, 4, 2134603908, 0, 2133447592, 3, 0) at Python/ceval.c:3267 #21 0x7f71337c in fast_function (func=0x7f29b924, pp_stack=0x7fffcd30, n=4, na=4, nk=0, 2133440804, 2147470640, 4, 4, 0) at Python/ceval.c:4131 #22 0x7f713106 in call_function (pp_stack=0x7fffcd30, oparg=4, 2147470640, 4) at Python/ceval.c:4056 #23 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f3b76ec, throwflag=0, 2134603500, 0) at Python/ceval.c:2681 #24 0x7f711523 in PyEval_EvalCodeEx (co=0x7f23ecc8, globals=0x7f33e714, locals=0x0, args=0x7f2d1198, argcount=5, kws=0x7f2d11ac, kwcount=0, defs=0x7f24bfd8, defcount=4, closure=0x0, 2133060808, 2134107924, 0, 2133660056, 5, 2133660076, 0, 2133114840, 4, 0) at Python/ceval.c:3267 #25 0x7f71337c in fast_function (func=0x7f29b844, pp_stack=0x7fffd01c, n=5, na=5, nk=0, 2133440580, 2147471388, 5, 5, 0) at Python/ceval.c:4131 #26 0x7f713106 in call_function (pp_stack=0x7fffd01c, oparg=5, 2147471388, 5) at Python/ceval.c:4056 #27 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f2d102c, throwflag=0, 2133659692, 0) at Python/ceval.c:2681 #28 0x7f711523 in PyEval_EvalCodeEx (co=0x7f258188, globals=0x7f33e714, locals=0x0, args=0x7f295660, argcount=6, kws=0x7f295678, kwcount=0, defs=0x7f24cc68, defcount=5, closure=0x0, 2133164424, 2134107924, 0, 2133415520, 6, 2133415544, 0, 2133118056, 5, 0) at Python/ceval.c:3267 #29 0x7f71337c in fast_function (func=0x7f29b7d4, pp_stack=0x7fffd308, n=6, na=6, nk=0, 2133440468, 2147472136, 6, 6, 0) at Python/ceval.c:4131 #30 0x7f713106 in call_function (pp_stack=0x7fffd308, oparg=6, 2147472136, 6) at Python/ceval.c:4056 #31 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f2954f4, throwflag=0, 2133415156, 0) at Python/ceval.c:2681 #32 0x7f711523 in PyEval_EvalCodeEx (co=0x7f258188, globals=0x7f33e714, locals=0x0, args=0x7f2a31a8, argcount=6, kws=0x7f2a31c0, kwcount=0, defs=0x7f24cc68, defcount=5, closure=0x0, 2133164424, 2134107924, 0, 2133471656, 6, 2133471680, 0, 2133118056, 5, 0) at Python/ceval.c:3267 #33 0x7f71337c in fast_function (func=0x7f29b7d4, pp_stack=0x7fffd5f4, n=6, na=6, nk=0, 2133440468, 2147472884, 6, 6, 0) at Python/ceval.c:4131 #34 0x7f713106 in call_function (pp_stack=0x7fffd5f4, oparg=6, 2147472884, 6) at Python/ceval.c:4056 #35 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f2a302c, throwflag=0, 2133471276, 0) at Python/ceval.c:2681 #36 0x7f7132c0 in fast_function (func=0x7f29ba04, pp_stack=0x7fffd7e0, n=0, na=0, nk=0, 2133441028, 2147473376, 0, 0, 0) at Python/ceval.c:4121 #37 0x7f713106 in call_function (pp_stack=0x7fffd7e0, oparg=0, 2147473376, 0) at Python/ceval.c:4056 #38 0x7f70fe32 in PyEval_EvalFrameEx (f=0x7f25370c, throwflag=0, 2133145356, 0) at Python/ceval.c:2681 #39 0x7f711523 in PyEval_EvalCodeEx (co=0x7f25c0b0, globals=0x7f33e714, locals=0x7f33e714, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0, 2133180592, 2134107924, 2134107924, 0, 0, 0, 0, 0, 0, 0) at Python/ceval.c:3267 #40 0x7f70af1b in PyEval_EvalCode (co=0x7f25c0b0, globals=0x7f33e714, locals=0x7f33e714, 2133180592, 2134107924, 2134107924) at Python/ceval.c:669 #41 0x7f73365a in run_mod (mod=0x7f2f6e60, filename=0x7fffef44 "/usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/compileall.py", globals=0x7f33e714, locals=0x7f33e714, flags=0x7fffdbe4, arena=0x7f348250, 2133814880, 2147479364, 2134107924, 2134107924, 2147474404, 2134147664) at Python/pythonrun.c:1371 #42 0x7f73360b in PyRun_FileExFlags (fp=0x7f5aa0c0, filename=0x7fffef44 "/usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/compileall.py", start=257, globals=0x7f33e714, locals=0x7f33e714, closeit=1, flags=0x7fffdbe4, 2136645824, 2147479364, 257, 2134107924, 2134107924, 1, 2147474404) at Python/pythonrun.c:1357 #43 0x7f732658 in PyRun_SimpleFileExFlags (fp=0x7f5aa0c0, filename=0x7fffef44 "/usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/compileall.py", closeit=1, flags=0x7fffdbe4, 2136645824, 2147479364, 1, 2147474404) at Python/pythonrun.c:949 #44 0x7f73207a in PyRun_AnyFileExFlags (fp=0x7f5aa0c0, filename=0x7fffef44 "/usr/pkgsrc/lang/python27/work/.destdir/usr/pkg/lib/python2.7/compileall.py", closeit=1, flags=0x7fffdbe4, 2136645824, 2147479364, 1, 2147474404) at Python/pythonrun.c:753 #45 0x7f741fc2 in Py_Main (argc=11, argv=0x7fffdcdc, 11, 2147474652) at Modules/main.c:640 #46 0x00010742 in main (argc=11, argv=0x7fffdcdc, 11, 2147474652, 2147474700) at Modules/python.c:23 ---------- components: Installation messages: 269739 nosy: stark priority: normal severity: normal status: open title: Python doesn't build due to test_float.py broken on non-IEEE machines type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 2 17:13:07 2016 From: report at bugs.python.org (Claude Paroz) Date: Sat, 02 Jul 2016 21:13:07 +0000 Subject: [New-bugs-announce] [issue27445] Charset instance not passed to set_payload() Message-ID: <1467493987.65.0.715756200587.issue27445@psf.upfronthosting.co.za> New submission from Claude Paroz: In issue #16324, I contributed an improvement so as MIMEText __init__ accept Charset instances, not only encoding strings. The use case is from Django where we customize the Charset.body_encoding before passing it to the MIMEText initialization. Unfortunately, what I didn't notice when Berker adapted my patch is that the Charset is casted to its string representation for the whole method, while I initially intended to let the unchanged Charset passed to self.set_payload. And the test I suggested was not smart enough to detect that. ---------- components: email messages: 269740 nosy: barry, claudep, r.david.murray priority: normal severity: normal status: open title: Charset instance not passed to set_payload() versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 3 12:20:09 2016 From: report at bugs.python.org (Zack Weinberg) Date: Sun, 03 Jul 2016 16:20:09 +0000 Subject: [New-bugs-announce] [issue27446] struct: allow per-item byte order Message-ID: <1467562809.45.0.522502679617.issue27446@psf.upfronthosting.co.za> New submission from Zack Weinberg: Occasionally one encounters binary formats which do not stick to one byte order throughout. For example, I have a C program that reads and writes arrays of this struct: ``` struct conn_data { uint32_t ipv4_addr; /* read - network byte order - target IPv4 address */ uint16_t tcp_port; /* read - network byte order - target TCP port */ uint16_t errnm; /* write - native byte order - errno code */ uint64_t elapsed; /* write - native byte order - elapsed time in ns */ }; ``` On little-endian systems, the first and second fields of this struct will be in the opposite byte order from the third and fourth. If the struct module allowed specification of byte order on a per-item basis, it would make working with structures of this type simpler. Hypothetical notation: ``` addr, port, errnm, elapsed = struct.unpack("=4s!H=H=Q") addr = socket.inet_ntoa(addr) ``` instead of what one must do now, ``` addr, port, errnm, elapsed = struct.unpack("=4sHHQ") addr = socket.inet_ntoa(addr) port = socket.ntohs(port) ``` To avoid ambiguities and confusion, I would suggest that, if more than one item has its own byte-order specifier, _all_ items must have byte-order specifiers (with the possible exception of the 1-byte item types?), and that this is not allowed in an '@'-mode format. ---------- components: Library (Lib) messages: 269770 nosy: zwol priority: normal severity: normal status: open title: struct: allow per-item byte order type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 05:54:32 2016 From: report at bugs.python.org (towb) Date: Mon, 04 Jul 2016 09:54:32 +0000 Subject: [New-bugs-announce] [issue27447] python -m doctest file_with_no_py_extension # silently fails Message-ID: <1467626072.62.0.919470824468.issue27447@psf.upfronthosting.co.za> New submission from towb: Command line tools usually use the shebang and don't have a .py extension. This breaks the `python -m doctest` shortcut for testmod(). Getting it to work is probably ugly, but there should be a useful message. Currently it's just a NameError for every function, which is very confusing. ---------- components: Library (Lib) messages: 269781 nosy: towb priority: normal severity: normal status: open title: python -m doctest file_with_no_py_extension # silently fails type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 08:52:32 2016 From: report at bugs.python.org (Andrew) Date: Mon, 04 Jul 2016 12:52:32 +0000 Subject: [New-bugs-announce] [issue27448] Race condition in subprocess.Popen which causes a huge memory leak Message-ID: <1467636752.08.0.502936379731.issue27448@psf.upfronthosting.co.za> New submission from Andrew: We had problem where at some point python start consuming RAM. Until it ends. The reason was race condition in subprocess.Popen. Which triggered gc.disable() and never gc.enable(). The workaround we use is: subprocess.gc.isenabled = lambda: True The scenario for race condition is pretty obvious looking into the code below: gc_was_enabled = gc.isenabled() <- T1 gets false here gc.disable() try: self.pid = os.fork() <- while T2 is here except: if gc_was_enabled: gc.enable() raise ... CODE FRAGMENT 1 ... if gc_was_enabled: gc.enable() Also I wonder if exception fails in "... CODE FRAGMENT 1 ..." why don't we re-enable gc (finally block) ---------- messages: 269783 nosy: aonishuk priority: normal severity: normal status: open title: Race condition in subprocess.Popen which causes a huge memory leak versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 09:08:25 2016 From: report at bugs.python.org (frank-e) Date: Mon, 04 Jul 2016 13:08:25 +0000 Subject: [New-bugs-announce] [issue27449] pip install --upgrade pip (Windows) Message-ID: <1467637705.46.0.30850712587.issue27449@psf.upfronthosting.co.za> New submission from frank-e: `python -m pip install --upgrade pip` on Windows 7 with Python 3.5.2 installed for all users, PermissionError: [WinError 5] Access denied: 'c:\\program files\\python35\\lib\\site-packages\\p ip-8.1.1.dist-info\\description.rst' ---------- components: Windows files: pip.8.1.1.txt messages: 269784 nosy: frank-e, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pip install --upgrade pip (Windows) versions: Python 3.5 Added file: http://bugs.python.org/file43620/pip.8.1.1.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 16:01:33 2016 From: report at bugs.python.org (Josh Triplett) Date: Mon, 04 Jul 2016 20:01:33 +0000 Subject: [New-bugs-announce] [issue27450] bz2: BZ2File should expose compression level as an attribute Message-ID: <1467662493.73.0.0646490356421.issue27450@psf.upfronthosting.co.za> New submission from Josh Triplett: (This exists in both Python 3 and Python 2.) When opening an existing .bz2 file with BZ2File, I'd like to have access to the compression level, so that I don't have to manually parse the file's header to get it. BZ2File could provide the compression level as an attribute on itself. ---------- components: Library (Lib) messages: 269806 nosy: joshtriplett priority: normal severity: normal status: open title: bz2: BZ2File should expose compression level as an attribute type: enhancement versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 16:04:18 2016 From: report at bugs.python.org (Josh Triplett) Date: Mon, 04 Jul 2016 20:04:18 +0000 Subject: [New-bugs-announce] [issue27451] gzip.py: Please save more of the gzip header for later examination Message-ID: <1467662658.73.0.679022780479.issue27451@psf.upfronthosting.co.za> New submission from Josh Triplett: GzipFile currently reads and discards various fields from the gzip header, such as the original filename and timestamp. Please consider reading all the fields of the gzip header into fields of the GzipFile instance, so that users of GzipFile can access these fields. ---------- components: Library (Lib) messages: 269808 nosy: joshtriplett priority: normal severity: normal status: open title: gzip.py: Please save more of the gzip header for later examination type: enhancement versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 4 16:09:51 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Jul 2016 20:09:51 +0000 Subject: [New-bugs-announce] [issue27452] IDLE: Cleanup config code Message-ID: <1467662991.07.0.187758431637.issue27452@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The config module code can be improved even without changing behavior. While working on #27380, I noticed these two: IdleUserConfParser.RemoveFile is a simple one-liner called once. Put it inline. IdleConf.CreateConfigHandlers: A) As near as I can tell, __file__ is now always the absolute path of the file regardless if executed directly or imported. B) Creating two dicts of file names that are immediately used and deleted is useless and to me makes the code less readable. I intend these changes only for 3.6 and will not apply until after the new unix keys patch. Serhiy, have you noticed any similar cleanups that would be appropriate to add? ---------- assignee: terry.reedy files: config-clean.diff keywords: patch messages: 269809 nosy: serhiy.storchaka, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Cleanup config code type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43623/config-clean.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 07:18:43 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Tue, 05 Jul 2016 11:18:43 +0000 Subject: [New-bugs-announce] [issue27453] Fix cross-compilation with Android NDK and Clang Message-ID: <1467717523.35.0.850577639812.issue27453@psf.upfronthosting.co.za> New submission from Chi Hsuan Yen: Motivation: Android NDK is deprecating GCC and moving ot Clang/LLVM. From [1]: We strongly recommend switching to Clang. GCC in the NDK is now deprecated in favor of Clang. This patch fixes the only one problem when migrating GCC to Clang. In my build script, $CPP is set to "${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -E" and $CPPFLAGS is set to "-target armv7-none-linux-androideabi -gcc-toolchain ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot ${ANDROID_NDK}/platforms/android-21/arch-arm/usr -I${PREFIX}/include -DANDROID". I'm not sure whether it's the correct usage of clang, but at least it works. With such a configuration, most Python parts builds well. Just something wrong - extensions as built as xyz.cpython-36m-x86_64-linux-gnu.so. My patch just fixes $(PLATFORM_TRIPLET) detection. [1] https://developer.android.com/ndk/downloads/revision_history.html ---------- components: Cross-Build files: ndk-clang-preprocessor.patch keywords: patch messages: 269816 nosy: Alex.Willmer, Chi Hsuan Yen, xdegaye priority: normal severity: normal status: open title: Fix cross-compilation with Android NDK and Clang type: compile error versions: Python 3.6 Added file: http://bugs.python.org/file43625/ndk-clang-preprocessor.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 09:01:36 2016 From: report at bugs.python.org (INADA Naoki) Date: Tue, 05 Jul 2016 13:01:36 +0000 Subject: [New-bugs-announce] [issue27454] PyUnicode_InternInPlace can use PyDict_SetDefault Message-ID: <1467723696.2.0.276855964684.issue27454@psf.upfronthosting.co.za> New submission from INADA Naoki: PyDict_SetDefault() was added Python 3.4 Currently, PyUnicode_InternInPlace() uses PyDict_GetItem, and PyDict_SetItem if no item found. It can be replaced PyDict_SetDefault() easily. ---------- components: Interpreter Core files: intern-setdefault.patch keywords: patch messages: 269819 nosy: naoki priority: normal severity: normal status: open title: PyUnicode_InternInPlace can use PyDict_SetDefault type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43626/intern-setdefault.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 09:20:52 2016 From: report at bugs.python.org (John Hagen) Date: Tue, 05 Jul 2016 13:20:52 +0000 Subject: [New-bugs-announce] [issue27455] Fix tkinter examples to be PEP8 compliant Message-ID: <1467724852.16.0.852334218439.issue27455@psf.upfronthosting.co.za> New submission from John Hagen: Patch fixes tkinter examples to be PEP8 compliant. ---------- assignee: docs at python components: Documentation files: 0001-Fix-tkinter-docs-PEP8.patch keywords: patch messages: 269820 nosy: John Hagen, docs at python priority: normal severity: normal status: open title: Fix tkinter examples to be PEP8 compliant versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43627/0001-Fix-tkinter-docs-PEP8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 11:27:48 2016 From: report at bugs.python.org (Jim Fulton) Date: Tue, 05 Jul 2016 15:27:48 +0000 Subject: [New-bugs-announce] [issue27456] TCP_NODELAY Message-ID: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> New submission from Jim Fulton: tl;dr TCP_NODELAY should be set by default and/or there should be a proper way to set it. I've ported ZEO, ZODB's client-server networking layer to asyncio. Things were going pretty well. I've been developing on a Mac. Yesterday, I ran some performance measurements on Linux and found some tests ran 30x slower. After some digging, I came across this: https://github.com/python/asyncio/issues/311 Then led me to try setting TCP_NODELAY, which provided Linux performance comparable to Mac OS performance. Issue 311 suggested that this was a kernal-version issue. I think this is a failure to set, or at least provide a way to set a "don't be stupid" option. I originally tried this on Ubuntu 14.04, with kernal 3.13.0-74-generic. I then tried Ubuntu 16.04, in a docker image, with kernal 4.4.12-boot2docker. For both of these, performance for the write tests were 30x slower unless I set TCP_NODELAY. Finally, I tried an Amazon standard AMI, which runs some version of RedHat, with kernal 4.4.11-23.53.amzn1.x86_64. On that system, performance of the tests was similar to Mac OS X without setting TCP_NODELAY. Note that the non-slow kernal version was lower than the slow (Ubuntu) one. I don't think this is mearly a kernal version issue, nor do I think this should have been dismissed as one. I couldn't find a way to set TCP_NODELAY cleanly. Did I miss something? https://github.com/python/asyncio/issues/286 suggests there isn't one. I ended up having to set the option on _sock transport attributes, which is dirty and, I assume, won't work with uvloop. (BTW, uvloop was only ~15x slower on linux systems with this problem.) I think TCP_NODELAY should be set by default. Perhaps it shouldn't be set on mobile, by everywhere else, I think it's a "don't be stupid" option. I also think there should be a way to set it cleanly. IMO, this is extremely important. Linux is a wildly important platform for networking applications and Python, and, for better or worse, Ubuntu is a very commonly used distribution. Having asyncio, perform so poorly on these platforms is a big deal. ---------- messages: 269826 nosy: j1m priority: normal severity: normal status: open title: TCP_NODELAY _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 11:50:26 2016 From: report at bugs.python.org (klo uo) Date: Tue, 05 Jul 2016 15:50:26 +0000 Subject: [New-bugs-announce] [issue27457] shlex.quote incorrectly quotes ampersants, pipes Message-ID: <1467733826.6.0.356479348318.issue27457@psf.upfronthosting.co.za> New submission from klo uo: Example code: ======================================== Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shlex >>> cmd = ["pwd", "&&", "ls"] >>> ' '.join(shlex.quote(arg) for arg in cmd) "pwd '&&' ls" >>> ======================================== Double ampersants is quoted, and if this command string is passed to Popen or pasted in shell it would fail. OTOH, Windows so-so compatible list2cmdline: ======================================== Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> cmd = ["cd", "&&", "dir"] >>> subprocess.list2cmdline(cmd) 'cd && dir' >>> ======================================== behaves correctly. ---------- messages: 269830 nosy: klo.uo priority: normal severity: normal status: open title: shlex.quote incorrectly quotes ampersants, pipes type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 16:10:11 2016 From: report at bugs.python.org (Ammar Askar) Date: Tue, 05 Jul 2016 20:10:11 +0000 Subject: [New-bugs-announce] [issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block Message-ID: <1467749411.27.0.801295605617.issue27458@psf.upfronthosting.co.za> New submission from Ammar Askar: So currently as far as string concatenation goes. ceval has this nice little branch it can take if both operators are unicode types. However, since this check is an Exact check, it means that subtypes of unicode end up going through the slow code path through: PyNumber_Add -> PyUnicode_Concat. This patch aims to allow subtypes to take that optimized branch without breaking any existing behavior and without any more memory copy calls than necessary. The motivation for this change is that some templating engines (Mako/Jinja2/Cheetah) use stuff like MarkupSafe which is implemented with a unicode subtype called `Markup`. Concatenating these custom objects (pretty common for templating engines) is fairly slow. This change modifies and uses the existing cpython code to make it a fair bit faster. I think the only real "dangerous" change in here is in the cast_unicode_subtype_to_base function which uses a trick at the end to prevent deallocation of memory. I've made sure to keep it well commented but I'd appreciate any feedback on it. >From what I can tell from running the test suite, all tests pass and there don't seem to be any new reference leaks. ---------- components: Interpreter Core files: python.diff keywords: patch messages: 269849 nosy: ammar2, benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou priority: normal severity: normal status: open title: Allow subtypes of unicode/str to hit the optimized unicode_concatenate block type: performance Added file: http://bugs.python.org/file43631/python.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 5 20:07:52 2016 From: report at bugs.python.org (Zhihan Chen) Date: Wed, 06 Jul 2016 00:07:52 +0000 Subject: [New-bugs-announce] [issue27459] unintended changes occurs when dealing with list of list Message-ID: <1467763672.45.0.0368079728325.issue27459@psf.upfronthosting.co.za> New submission from Zhihan Chen: When creating list of list with multiplication, changing one element of a list will result in changing all lists. ---------- components: Demos and Tools files: Screenshot from 2016-07-05 16-44-14.png messages: 269858 nosy: Zhihan Chen priority: normal severity: normal status: open title: unintended changes occurs when dealing with list of list type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file43633/Screenshot from 2016-07-05 16-44-14.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 6 06:38:48 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 06 Jul 2016 10:38:48 +0000 Subject: [New-bugs-announce] [issue27460] Change bytes exception when overflow Message-ID: <1467801528.33.0.514121242609.issue27460@psf.upfronthosting.co.za> New submission from Xiang Zhang: I suggest change `bytes` exception message when an iterable containing overflow integers. Right now, bytes([sys.maxsize+1]) emits ValueError: cannot fit 'int' into an index-sized integer "ValueError: cannot fit 'int' into an index-sized integer". I think actually when use bytes in such a situation we don't care the integer overflows or not, we only care if the integer is in range(0, 256) or not, just like what bytearray([sys.maxsize+1]) does. ---------- files: bytes_exception_msg.patch keywords: patch messages: 269879 nosy: xiang.zhang priority: normal severity: normal status: open title: Change bytes exception when overflow Added file: http://bugs.python.org/file43637/bytes_exception_msg.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 08:29:34 2016 From: report at bugs.python.org (=?utf-8?q?Ville_Skytt=C3=A4?=) Date: Thu, 07 Jul 2016 12:29:34 +0000 Subject: [New-bugs-announce] [issue27461] Optimize PNGs Message-ID: <1467894574.39.0.144098385194.issue27461@psf.upfronthosting.co.za> New submission from Ville Skytt?: Running PNGs through zopflipng makes them smaller, with no drawbacks. This patch was done with zopflipng version 1.0.1 with the -m option, and decreases the in-tree total size size of all *.png by almost 100KiB. $ find -name "*.png" | xargs du -bc | tail -n 1 # before 291101 total $ find -name "*.png" | xargs du -bc | tail -n 1 # after 194639 total ---------- assignee: docs at python components: Documentation files: pngs.patch keywords: patch messages: 269929 nosy: docs at python, scop priority: normal severity: normal status: open title: Optimize PNGs type: enhancement Added file: http://bugs.python.org/file43653/pngs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 11:48:13 2016 From: report at bugs.python.org (Emin Ghuliev) Date: Thu, 07 Jul 2016 15:48:13 +0000 Subject: [New-bugs-announce] [issue27462] NULL Pointer deref in binary_iop1 function Message-ID: <1467906493.58.0.790114894121.issue27462@psf.upfronthosting.co.za> New submission from Emin Ghuliev: Python VM parses "0x3b" opcode (INPLACE_MODULO) in the bytecode file. Subsequently VM parses left and right arguments of the opcode (0x3b). If left and right arguments doesn't exists in the bytecode file that causes a segmentation fault. Which triggered by the binary_iop1 function. PyEval_EvalFrameEx() at Python/ceval.c:1749 TARGET(INPLACE_MODULO) { PyObject *right = POP(); PyObject *left = TOP(); PyObject *mod = PyNumber_InPlaceRemainder(left, right); < left = 0, right = 0; Then INPLACE_MODULO opcode is passed two arguments into PyNumber_InPlaceRemainder. However, in order to call the binary_iop: PyNumber_InPlaceRemainder at Objects/abstract.c:1102 PyNumber_InPlaceRemainder(PyObject *v, PyObject *w) { return binary_iop(v, w, NB_SLOT(nb_inplace_remainder), NB_SLOT(nb_remainder), "%="); } Subsequently the binary_iop function is passed "v" argument into the binary_iop1: binary_iop at Objects/abstract.c:1005 static PyObject * binary_iop(PyObject *v, PyObject *w, const int iop_slot, const int op_slot, const char *op_name) { PyObject *result = binary_iop1(v, w, iop_slot, op_slot); # v = 0 and call the binary_iop1 function if (result == Py_NotImplemented) { Py_DECREF(result); return binop_type_error(v, w, op_name); } return result; } binary_iop1 at Objects/abstract.c:988 static PyObject * binary_iop1(PyObject *v, PyObject *w, const int iop_slot, const int op_slot) { PyNumberMethods *mv = v->ob_type->tp_as_number; // dereference object < -- > v = 0x0 if (mv != NULL) { binaryfunc slot = NB_BINOP(mv, iop_slot); if (slot) { PyObject *x = (slot)(v, w); if (x != Py_NotImplemented) { return x; } Py_DECREF(x); } } return binary_op1(v, w, op_slot); } The binary_iop1 function doesn't check "v" field and dereference it. mov rsi,QWORD PTR [rdi+0x8] = 0x8 byte -> ob_type $rdi register = 0x0 Program received signal SIGSEGV, Segmentation fault. ---------- components: Interpreter Core files: repro messages: 269940 nosy: Emin Ghuliev priority: normal severity: normal status: open title: NULL Pointer deref in binary_iop1 function versions: Python 3.6 Added file: http://bugs.python.org/file43654/repro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 12:07:27 2016 From: report at bugs.python.org (Izaak Weiss) Date: Thu, 07 Jul 2016 16:07:27 +0000 Subject: [New-bugs-announce] [issue27463] Floor division is not the same as the floor of division Message-ID: <1467907647.78.0.993210644564.issue27463@psf.upfronthosting.co.za> New submission from Izaak Weiss: The floor division operator in Python 3 `x//y` acts differently than the floor of the division operator `math.floor(x/y)` in some edge cases due to floating point errors. Consider `44//4.4` and `math.floor(44/4.4)`. These two expressions should, with infinite precision, evaluate to the same number. However, in practice `44//4.4` evaluates to `9.0`, but `math.floor(44/4.4)` evaluates to `10.0`. This should either be changed, or made clear in the documentation that the two may not be equal due to floating point errors. ---------- messages: 269945 nosy: izaakweiss priority: normal severity: normal status: open title: Floor division is not the same as the floor of division type: behavior versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 19:42:36 2016 From: report at bugs.python.org (Mikhail Korobov) Date: Thu, 07 Jul 2016 23:42:36 +0000 Subject: [New-bugs-announce] [issue27464] Document that SplitResult & friends are namedtuples Message-ID: <1467934956.52.0.328129985005.issue27464@psf.upfronthosting.co.za> New submission from Mikhail Korobov: Docs currently say that urllib.parse.SplitResult is a subclass of tuple, without saying that it is namedtuple. What do you think about documenting it as a namedtuple? It has an useful _replace method which allows to change some part of URL before passing it to urlunsplit. It may also require updating typeshed - I noticed this issue because mypy shows an error when SplitResult._replace is used. ---------- messages: 269964 nosy: kmike priority: normal severity: normal status: open title: Document that SplitResult & friends are namedtuples _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 21:58:46 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 08 Jul 2016 01:58:46 +0000 Subject: [New-bugs-announce] [issue27465] IDLE:Make help source menu entries unique and sorted. Message-ID: <1467943126.13.0.718896019337.issue27465@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The 'General' tab of the IDLE configuration menu allows a user to add entries to the Help menu that display a text when clicked. A user might want more than one text available for a given 'topic', such as a doc and how-to for a package. However, there is no need to have duplicate entries, as up to 30 chars are allowed. "Package - doc" and "Package - how" would be clearer than "Package" and "Package". Issue 27380 makes checking for unique entries easy as that is already done for user configuration file section names and the same base class is now used for help source names. Currently, names are displayed in the order added. I believe sorting would be better, especially when one adds more than 2 entries. That should also be easy. Existing duplicates would not be a problem for IDLE as the check would only apply when adding or editing an item. Python's stable list.sort would keep existing duplicates in the same relative order. I will *not* use the doc path to break ties. ---------- assignee: terry.reedy messages: 269965 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE:Make help source menu entries unique and sorted. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 7 23:24:20 2016 From: report at bugs.python.org (Robby Daigle) Date: Fri, 08 Jul 2016 03:24:20 +0000 Subject: [New-bugs-announce] [issue27466] [Copy from github user macartur] time2netscape missing comma Message-ID: <1467948260.35.0.112204143726.issue27466@psf.upfronthosting.co.za> New submission from Robby Daigle: For the time2netscape function. expected: Wed, DD-Mon-YYYY HH:MM:SS GMT got: Wed DD-Mon-YYYY HH:MM:SS GMT In Lib/http/cookiejar.py, line 116 suggests that the format should include a comma while line 123 does not include the comma in the formatted string. Wondering if 116 or 123 is wrong. ---------- components: Library (Lib) hgrepos: 347 messages: 269968 nosy: Robby Daigle priority: normal severity: normal status: open title: [Copy from github user macartur] time2netscape missing comma versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 8 00:16:32 2016 From: report at bugs.python.org (Joe) Date: Fri, 08 Jul 2016 04:16:32 +0000 Subject: [New-bugs-announce] [issue27467] distutils.config API different between <=3.5.1 and 3.5.2 Message-ID: <1467951392.72.0.939570638824.issue27467@psf.upfronthosting.co.za> New submission from Joe: In Python 3k releases leading up to 3.5.2, distutils.config imported "ConfigParser", but now imports "RawConfigParser" in the latest release. The documentation indicates "RawConfigParser" is considered legacy and "ConfigParser" should be used in its place. Was this change intentional, and if not, will it be reverted to the previous behavior for the next patch release? Thanks, Joe ---------- components: Distutils messages: 269970 nosy: dstufft, eric.araujo, jhunkeler priority: normal severity: normal status: open title: distutils.config API different between <=3.5.1 and 3.5.2 type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 8 10:54:31 2016 From: report at bugs.python.org (Adria Garriga) Date: Fri, 08 Jul 2016 14:54:31 +0000 Subject: [New-bugs-announce] [issue27468] Erroneous memory behaviour for objects created in another thread Message-ID: <1467989671.36.0.557850749029.issue27468@psf.upfronthosting.co.za> New submission from Adria Garriga: I create several objects in the main thread, and then spawn several threads that "take ownership" of one object each. Within that thread, the objects' attributes' values are not consistent. The bug only happens sometimes. from threading import Thread import pdb n_threads = 8 def f(self): self.obj[0] = 0 t = 0 while True: if t != self.obj[0]: pdb.set_trace() # should not happen t += 1 self.obj[0] += 1 for _ in range(n_threads): t = Thread(target=lambda: f(t)) t.obj = [0] t.start() Tested in Python 2.7.11 under Ubuntu 16.04 LTS and OS X. The bug does not happen in Python 3.5 or Python 3.6 . Attached is a very similar program that exhibits the same issue, but which may be clearer and can sometimes be killed with Ctrl-C. ---------- components: Library (Lib) files: test.py messages: 269988 nosy: Adria Garriga priority: normal severity: normal status: open title: Erroneous memory behaviour for objects created in another thread type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file43663/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 8 11:38:52 2016 From: report at bugs.python.org (=?utf-8?q?Adam_Barto=C5=A1?=) Date: Fri, 08 Jul 2016 15:38:52 +0000 Subject: [New-bugs-announce] [issue27469] Unicode filename gets crippled on Windows when drag and drop Message-ID: <1467992332.72.0.0240653508758.issue27469@psf.upfronthosting.co.za> New submission from Adam Barto?: When a Python script is run by drag-and-dropping another file on it in Windows explorer, the other file's path becomes sys.argv[1]. However, when the path contains a Unicode characters (e.g. ?), it gets crippled ? it is replaced by ordinary question mark. Maybe this is not Python's fault. Calling directly GetCommandLineW already contains that question mark. I'm just curious whether the original path even can be reconstructed. ---------- components: Unicode, Windows messages: 269991 nosy: Drekin, ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Unicode filename gets crippled on Windows when drag and drop type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 8 12:23:05 2016 From: report at bugs.python.org (Matthew Gilson) Date: Fri, 08 Jul 2016 16:23:05 +0000 Subject: [New-bugs-announce] [issue27470] -3 commandline option documented differently via man Message-ID: <1467994985.16.0.513883147731.issue27470@psf.upfronthosting.co.za> New submission from Matthew Gilson: The man page for python says: > Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix. The official documentation (https://docs.python.org/2/using/cmdline.html#cmdoption-3) does not mention 2to3 at all: > Warn about Python 3.x possible incompatibilities by emitting a DeprecationWarning for features that are removed or significantly changed in Python 3. This seems like a pretty big oversight when the following code issues no warnings (presumably because 2to3 can trivially handle this change): ``` from __future__ import print_function class test(object): def __nonzero__(self): return False t = test() if t: print('Hello') ``` ---------- assignee: docs at python components: Documentation messages: 269994 nosy: docs at python, mgilson priority: normal severity: normal status: open title: -3 commandline option documented differently via man versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 8 17:57:07 2016 From: report at bugs.python.org (Noah Petherbridge) Date: Fri, 08 Jul 2016 21:57:07 +0000 Subject: [New-bugs-announce] [issue27471] sre_constants.error: bad escape \d Message-ID: <1468015027.73.0.234433787808.issue27471@psf.upfronthosting.co.za> New submission from Noah Petherbridge: I found a bug in Python 3.6.0a2 that wasn't present on previous versions of Python concerning the "\d" escape sequence as used in the following regular expression: import re s = "hello" s = re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', s) (The purpose of this regular expression was to translate the literal regexp string "(\d+?)" to be a non-capturing literal regexp string, to eventually be used as a re pattern). When running this code in 3.6.0a2 I receive the following stack traces: - - - - - - - - - - Traceback (most recent call last): File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/sre_parse.py", line 877, in parse_template this = chr(ESCAPES[this][1]) KeyError: '\\d' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 4, in s = re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', s) File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 181, in sub return _compile(pattern, flags).sub(repl, string, count) File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 324, in _subx template = _compile_repl(template, pattern) File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/re.py", line 311, in _compile_repl p = sre_parse.parse_template(repl, pattern) File "/home/kirsle/.pyenv/versions/3.6.0a2/lib/python3.6/sre_parse.py", line 880, in parse_template raise s.error('bad escape %s' % this, len(this)) sre_constants.error: bad escape \d at position 3 - - - - - - - - - - However, the script runs without crashing on Python 3.5.1 and 2.7.11 % python --version Python 3.6.0a2 ---------- components: Regular Expressions messages: 270010 nosy: Noah Petherbridge, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: sre_constants.error: bad escape \d type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 9 11:12:35 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 09 Jul 2016 15:12:35 +0000 Subject: [New-bugs-announce] [issue27472] add the 'unix_shell' attribute to test.support Message-ID: <1468077155.86.0.151085889776.issue27472@psf.upfronthosting.co.za> New submission from Xavier de Gaye: '/bin/sh' is hard-coded in few places in the test suite, but the Android shell is at '/system/bin/sh', see msg266084. ---------- assignee: xdegaye components: Tests messages: 270044 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: add the 'unix_shell' attribute to test.support type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 9 12:46:44 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 09 Jul 2016 16:46:44 +0000 Subject: [New-bugs-announce] [issue27473] bytes_concat seems to check overflow using undefined behaviour Message-ID: <1468082804.63.0.768933034734.issue27473@psf.upfronthosting.co.za> New submission from Xiang Zhang: bytes_concat uses following code to check overflow: size = va.len + vb.len; if (size < 0): { PyErr_NoMemory(); goto done; } This is wrong since signed ints overflow is undefined bahaviour. But one point is that Python's Makefile defines -fwrapv with gcc and clang. So I am not sure this needs to be changed or not. But in other parts of Python code I don't see any overflow check like this. I only see pre-calculated overflow checks. ---------- messages: 270053 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: bytes_concat seems to check overflow using undefined behaviour _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 9 13:42:39 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 09 Jul 2016 17:42:39 +0000 Subject: [New-bugs-announce] [issue27474] Unify exception in _Py_bytes_contains for integers Message-ID: <1468086159.4.0.976753811511.issue27474@psf.upfronthosting.co.za> New submission from Xiang Zhang: Now, `sys.maxsize+1 in b'foo'` raises "TypeError: 'int' does not support the buffer interface" which seems weird. In such case, I don't think there is any difference between sys.maxsize+1 and 256. So I suggest make it emits the same exceptions as `256 in b'foo'`, "ValueError: byte must be in range(0, 256)". ---------- files: _Py_bytes_contains.patch keywords: patch messages: 270058 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Unify exception in _Py_bytes_contains for integers type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43668/_Py_bytes_contains.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 10 12:49:07 2016 From: report at bugs.python.org (Szabolcs Dombi) Date: Sun, 10 Jul 2016 16:49:07 +0000 Subject: [New-bugs-announce] [issue27475] define_macros uses incorrect parameter for msvc compilers Message-ID: <1468169347.46.0.375922519741.issue27475@psf.upfronthosting.co.za> New submission from Szabolcs Dombi: define_macros will generate parameters like -D msvc compilers expect /D and ignore -D link: https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx ---------- components: Windows messages: 270102 nosy: Szabolcs Dombi, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: define_macros uses incorrect parameter for msvc compilers versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 10 14:52:52 2016 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 10 Jul 2016 18:52:52 +0000 Subject: [New-bugs-announce] [issue27476] Introduce a .github folder with PULL_REQUEST_TEMPLATE Message-ID: <1468176772.48.0.730450174113.issue27476@psf.upfronthosting.co.za> New submission from Senthil Kumaran: PULL_REQUEST_TEMPLATE will discourage pull requests in github repo and will instead point to python hg repo and dev guide. This will be removed after the hg to git migration is complete. ---------- assignee: orsenthil messages: 270124 nosy: orsenthil priority: normal severity: normal status: open title: Introduce a .github folder with PULL_REQUEST_TEMPLATE type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 10 16:19:37 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jul 2016 20:19:37 +0000 Subject: [New-bugs-announce] [issue27477] IDLE: Switch dialogs to ttk widgets. Message-ID: <1468181977.57.0.555586182066.issue27477@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Scrollbars and the new query module now use ttk widgets. Time to convert the other dialogs. Changing imports is straightforward. Use of an option that can only be changed in the style may be harder. There was one instance of this among the scrollbars (converted in #24750) and I just skipped the minor tweak, and let the scrollbar in question look like all the rest. The most difficult issue is changes in allowed methods. For instance, the state of tk checkbuttons and radiobuttons can be controlled by either setting a control variable or by calling methods. For ttk, the methods are gone. First are the search dialog modules: searchbase, search, replace, and grep. The tk-only 'anchor' option is used but has no effect since the 'width' option is not used to allocate extra space for the buttons. The tk-only select method is used, but at least in searchbase, it has no effect, as it always sets the button to the state it already had. Its use in test files, however, has to be replaced, not deleted. IDLE does not control the common dialogs. But we could choose to replace them, I would not do that for the os file dialogs, but already replaced the 'ask' messagebox used for Open Module for behavioral reasons (#27380). ---------- messages: 270131 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: Switch dialogs to ttk widgets. type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 10 20:51:20 2016 From: report at bugs.python.org (Joshua) Date: Mon, 11 Jul 2016 00:51:20 +0000 Subject: [New-bugs-announce] [issue27478] Python Can't run Message-ID: <1468198280.51.0.00893594715031.issue27478@psf.upfronthosting.co.za> New submission from Joshua: I am using the book, Beginning Programming with Python For Dummies and I am stuck. On chapter 10 of the book, there is a dialog box that says"Changing the current python directory". Inside the dialog box there is an instruction on how to change directory, which I followed. I typed: "os.chdir(C:\the python root directory) and press enter and my problem started. The application can't run anything again. When I try to run, I get this message "IDLE's subprocess didn't make connection. Either IDLE cant start a subprocess or personal firewall software is blocking the connection". I have re-installed many times, tried google to see if i can find anything but none has helped. I am new in programming and I will really appreciate your assistant. ---------- components: IDLE messages: 270146 nosy: Keboku priority: normal severity: normal status: open title: Python Can't run type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 10 21:04:08 2016 From: report at bugs.python.org (Elizabeth Myers) Date: Mon, 11 Jul 2016 01:04:08 +0000 Subject: [New-bugs-announce] [issue27479] Slicing strings out of bounds does not raise IndexError Message-ID: <1468199048.87.0.686110972402.issue27479@psf.upfronthosting.co.za> New submission from Elizabeth Myers: When slicing strings, IndexError is not raised when the slices are out of bounds, even for negative indexes. Like so: >>> "test"[-1000:1000] 'test' >>> "test"[-1000:1] 't' >>> ""[-100:100] '' This seems more like a bug than useful behaviour to me. ---------- messages: 270147 nosy: Elizacat priority: normal severity: normal status: open title: Slicing strings out of bounds does not raise IndexError versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 04:54:33 2016 From: report at bugs.python.org (Martin Mokrejs) Date: Mon, 11 Jul 2016 08:54:33 +0000 Subject: [New-bugs-announce] [issue27480] Cannot link _crypt and _nis modules on a host with glibc-2.12 Message-ID: <1468227273.47.0.675242679806.issue27480@psf.upfronthosting.co.za> New submission from Martin Mokrejs: Hi, it seems at least python 3.4.3-r5 on a Gentoo Linux. Failed to build these modules: _crypt nis ---------- files: build.log messages: 270163 nosy: mmokrejs priority: normal severity: normal status: open title: Cannot link _crypt and _nis modules on a host with glibc-2.12 type: compile error versions: Python 3.4 Added file: http://bugs.python.org/file43684/build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 04:55:36 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 11 Jul 2016 08:55:36 +0000 Subject: [New-bugs-announce] [issue27481] Replace TypeError with ValueError in doc regarding "embedded NUL character" Message-ID: <1468227336.42.0.208326485001.issue27481@psf.upfronthosting.co.za> New submission from Xiang Zhang: Errors regarding "embedded NUL character" were changed from TypeError to ValueError, in r92365, issue22215, but the doc doesn't get updated. Add a patch to apply the change in doc. ---------- assignee: docs at python components: Documentation files: null_characters_doc.patch keywords: patch messages: 270164 nosy: docs at python, serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Replace TypeError with ValueError in doc regarding "embedded NUL character" versions: Python 3.6 Added file: http://bugs.python.org/file43685/null_characters_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 10:21:45 2016 From: report at bugs.python.org (mtowalski) Date: Mon, 11 Jul 2016 14:21:45 +0000 Subject: [New-bugs-announce] [issue27482] heap-buffer-overflow on address 0x6250000078ff Message-ID: <1468246905.12.0.769586892118.issue27482@psf.upfronthosting.co.za> New submission from mtowalski: PoC is attached. Version: 2.7.12 ================================================================= ==4461==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6250000078ff at pc 0x000000508e70 bp 0x7ffe3e88db60 sp 0x7ffe3e88db58 READ of size 1 at 0x6250000078ff thread T0 #0 0x508e6f in tok_nextc /home/mtowalski/tmp/python/Python-2.7.12/Parser/tokenizer.c:954:28 #1 0x4ff581 in tok_get /home/mtowalski/tmp/python/Python-2.7.12/Parser/tokenizer.c:1232:17 #2 0x4ff581 in PyTokenizer_Get /home/mtowalski/tmp/python/Python-2.7.12/Parser/tokenizer.c:1681:0 #3 0x4fae5d in parsetok /home/mtowalski/tmp/python/Python-2.7.12/Parser/parsetok.c:159:16 #4 0x7c9a92 in PyParser_ASTFromFile /home/mtowalski/tmp/python/Python-2.7.12/Python/pythonrun.c:1499:15 #5 0x7c9e49 in PyRun_FileExFlags /home/mtowalski/tmp/python/Python-2.7.12/Python/pythonrun.c:1354:11 #6 0x7c8a7e in PyRun_SimpleFileExFlags /home/mtowalski/tmp/python/Python-2.7.12/Python/pythonrun.c:948:13 #7 0x4f80b9 in Py_Main /home/mtowalski/tmp/python/Python-2.7.12/Modules/main.c:640:23 #8 0x7feaeb493f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287:0 #9 0x42adc5 in _start ??:? 0x6250000078ff is located 1 bytes to the left of 8192-byte region [0x625000007900,0x625000009900) allocated by thread T0 here: #0 0x4c8d3c in malloc ??:? #1 0x4fe75d in PyTokenizer_FromFile /home/mtowalski/tmp/python/Python-2.7.12/Parser/tokenizer.c:759:29 SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/mtowalski/tmp/python/Python-2.7.12/python+0x508e6f) Shadow bytes around the buggy address: 0x0c4a7fff8ec0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a7fff8ed0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a7fff8ee0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a7fff8ef0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a7fff8f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c4a7fff8f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa] 0x0c4a7fff8f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a7fff8f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a7fff8f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a7fff8f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a7fff8f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==4461==ABORTING ---------- components: Interpreter Core files: python-heap-buffer-overflow-e6f-581-e5d.py messages: 270181 nosy: mtowalski priority: normal severity: normal status: open title: heap-buffer-overflow on address 0x6250000078ff type: crash versions: Python 2.7 Added file: http://bugs.python.org/file43691/python-heap-buffer-overflow-e6f-581-e5d.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 12:50:30 2016 From: report at bugs.python.org (Maciej Fijalkowski) Date: Mon, 11 Jul 2016 16:50:30 +0000 Subject: [New-bugs-announce] [issue27483] Expose HEAD_LOCK/HEAD_UNLOCK in pystate.c Message-ID: <1468255830.37.0.284681994761.issue27483@psf.upfronthosting.co.za> New submission from Maciej Fijalkowski: Hi The use case here is for C-based statistical profilers. When running vmprof on linux/os x, you can get the current thread state from PyThreadState_GetUnchecked or a similar solution. However, on windows you need to walk all the interpreter state, for which there is an API. However that API is only ever used with locks (HEAD_LOCK/HEAD_UNLOCK), which are not exposed, which turns API mostly useless. ---------- messages: 270188 nosy: fijall, haypo priority: normal severity: normal status: open title: Expose HEAD_LOCK/HEAD_UNLOCK in pystate.c type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 12:56:56 2016 From: report at bugs.python.org (Rufus V. Smith) Date: Mon, 11 Jul 2016 16:56:56 +0000 Subject: [New-bugs-announce] [issue27484] Some Examples in Format String Syntax are incorrect or poorly worded Message-ID: <1468256216.77.0.446527786917.issue27484@psf.upfronthosting.co.za> New submission from Rufus V. Smith: In section 6.1.3 Format String Syntax, some examples have incorrect or poorly worded comments: Original: "Harold's a clever {0!s}" # Calls str() on the argument first "Bring out the holy {name!r}" # Calls repr() on the argument first "More {!a}" # Calls ascii() on the argument first Suggested Changes: "Harold's a clever {0!s}" # Calls str() on first positional argument "Bring out the holy {name!r}" # Calls repr() on the named argument 'name' "More {!a}" # Calls ascii() on first positional argument (v. 3.1 and later) ---------- assignee: docs at python components: Documentation messages: 270189 nosy: RufusVS, docs at python priority: normal severity: normal status: open title: Some Examples in Format String Syntax are incorrect or poorly worded _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 14:02:03 2016 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 11 Jul 2016 18:02:03 +0000 Subject: [New-bugs-announce] [issue27485] urllib.splitport -- is it official or not? Message-ID: <1468260123.51.0.000787877209911.issue27485@psf.upfronthosting.co.za> New submission from Guido van Rossum: I've seen and written some code that uses urllib.splitport() [1], but it's not in the export list, nor in the docs. However I see no easy other way to perform the same function. Should we make it official, or get rid of it? It's used internally in urllib/request.py [2]. There's a test for it in test_urlparse.py [3], but another test [4] also acknowledges that it's "undocumented" (which suggests that the author of that test didn't know what to do with it either). Same question for the others in that list [4]: 'splitattr', 'splithost', 'splitnport', 'splitpasswd', 'splitport', 'splitquery', 'splittag', 'splittype', 'splituser', 'splitvalue', 'Quoter', 'ResultBase', 'clear_cache', 'to_bytes', 'unwrap', References: [1] https://hg.python.org/cpython/file/tip/Lib/urllib/parse.py#l956 [2] https://hg.python.org/cpython/file/tip/Lib/urllib/request.py#l106 [3] https://hg.python.org/cpython/file/tip/Lib/test/test_urlparse.py#l1015 [4] https://hg.python.org/cpython/file/tip/Lib/test/test_urlparse.py#l946 ---------- messages: 270193 nosy: gvanrossum priority: normal severity: normal status: open title: urllib.splitport -- is it official or not? versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 14:41:34 2016 From: report at bugs.python.org (=?utf-8?b?7Iah67OR7Jqw?=) Date: Mon, 11 Jul 2016 18:41:34 +0000 Subject: [New-bugs-announce] [issue27486] FTPlib hangs on some pasv responses Message-ID: <1468262494.01.0.466520589745.issue27486@psf.upfronthosting.co.za> New submission from ???: FTPlib hangs on PASV responses when the connected server is within its local network. Here's my fix that checks the target address with ipaddress lib: https://github.com/python/cpython/pull/28/files ---------- components: Library (Lib) messages: 270198 nosy: ??? priority: normal severity: normal status: open title: FTPlib hangs on some pasv responses type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 16:18:11 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Mon, 11 Jul 2016 20:18:11 +0000 Subject: [New-bugs-announce] [issue27487] -m switch regression in Python 3.5.2 (under rare circumstances) Message-ID: <1468268291.19.0.631980361837.issue27487@psf.upfronthosting.co.za> New submission from Wolfgang Maier: As a result of Issue14285 Python 3.5.2 now imports packages in runpy. _get_module_details before calling importlib.util.find_spec. Although I'm not sure how important this is, I wanted to report that this new behaviour can have a side-effect under pretty exotic circumstances. When __init__.py imports the same module that is supposed to be invoked via the -m switch and that module replaces its own entry in sys.modules with another object, this causes importlib.util.find_spec to fail with a *very* cryptic: Error while finding spec for 'package.module' (ValueError: package.module.__spec__ is not set) without an exception traceback. I have no idea whether any other package would be affected by this, but it took me quite some time today to trace the cause of this and it is not what you'd expect from a maintenance release. I think the changed behaviour in runpy should at least be documented (beyond just mentioning the issue in the changelog). ---------- components: Library (Lib) messages: 270202 nosy: martin.panter, ncoghlan, wolma priority: normal severity: normal status: open title: -m switch regression in Python 3.5.2 (under rare circumstances) type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 16:26:10 2016 From: report at bugs.python.org (Monti Carlo) Date: Mon, 11 Jul 2016 20:26:10 +0000 Subject: [New-bugs-announce] [issue27488] Underscore not showing Mac El Capitan Message-ID: <1468268770.26.0.794680081595.issue27488@psf.upfronthosting.co.za> New submission from Monti Carlo: Trying to type in underscore and it just made a space... Downloaded 3.5.2 and it works fine. ---------- components: IDLE messages: 270205 nosy: Monti Carlo priority: normal severity: normal status: open title: Underscore not showing Mac El Capitan versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 16:55:40 2016 From: report at bugs.python.org (Joel Handwell) Date: Mon, 11 Jul 2016 20:55:40 +0000 Subject: [New-bugs-announce] [issue27489] Win 10, choco install python gets message: Access to the path 'C:\WINDOWS\system32\**\**.exe.ignore' is denied. Message-ID: <1468270540.45.0.165403304626.issue27489@psf.upfronthosting.co.za> New submission from Joel Handwell: While installing python 3.5.1 using chocolatey package manager on Windows 10, I got following message: python3 v3.5.1 WARNING: The names of some imported commands from the module 'chocolateyInstaller' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. Downloading python3 64 bit from 'https://www.python.org/ftp/python/3.5.1/python-3.5.1-amd64.exe' Progress: 100% - Saving 28.25 MB of 28.25 MB (29627072/29627072) Download of python3Install.exe (28.25 MB) completed. Installing python3... python3 has been installed. Access to the path 'C:\WINDOWS\system32\Boot\winload.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\Boot\winresume.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\difx64.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\DPTopologyApp.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\DPTopologyAppv2_0.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\GfxUIEx.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\Gfxv2_0.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\Gfxv4_0.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\igfxCUIService.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\igfxEM.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\igfxext.exe.ignore' is denied. Access to the path 'C:\WINDOWS\system32\DriverStore\FileRepository\64dp4256.inf_amd64_9191bdaf5e95d43e\igfxHK.exe.ignore' is denied. ---------- components: Installation messages: 270209 nosy: joelhandwell priority: normal severity: normal status: open title: Win 10, choco install python gets message: Access to the path 'C:\WINDOWS\system32\**\**.exe.ignore' is denied. type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 11 18:42:18 2016 From: report at bugs.python.org (Thomas Perl) Date: Mon, 11 Jul 2016 22:42:18 +0000 Subject: [New-bugs-announce] [issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency Message-ID: <1468276938.3.0.370267656827.issue27490@psf.upfronthosting.co.za> New submission from Thomas Perl: Problem description: Trying to cross-compile $(LIBRARY) (libpython2.7.a for example) causes "pgen" to be built, even when it's not used in the cross-compilation case (only a file copy is done to generate $(GRAMMAR_H) and $(GRAMMAR_C)). The current rule for $(PGEN) in Makefile.pre.in does not include $(CFLAGS): https://hg.python.org/cpython/file/tip/Makefile.pre.in#l810 This causes problems when $(CFLAGS) changes the ARM float ABI, e.g.: CFLAGS="-mfloat-abi=hard" This causes the following issues at link time: 1. The .o files that get linked into "pgen" are built with CFLAGS (which is good, because some of them are used for libpython as well) 2. When the "pgen" binary gets built, the $(CFLAGS) are not used 3. Compiler fails to build "pgen" with different float ABI settings ===== [...] arm-none-eabi-gcc -c -fno-strict-aliasing -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -fomit-frame-pointer -ffunction-sections -DARM11 -D_3DS -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Parser/pgenmain.o Parser/pgenmain.c arm-none-eabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Objects/obmalloc.o Python/mysnprintf.o Python/pyctype.o Parser/tokenizer_pgen.o Parser/printgrammar.o Parser/pgenmain.o -o Parser/pgen /Users/thp/pkg/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld: error: Parser/acceler.o uses VFP register arguments, Parser/pgen does not /Users/thp/pkg/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file Parser/acceler.o [...] ===== Note that the error message is repeated for all .o files linked into pgen, I've only included one here for demonstration purposes. The following patch (against a Python 2.7.12 tarball, similar fix for Hg tip and Python 3) fixes the issue for me: ===== diff -u Python-2.7.12/Makefile.pre.in Python-2.7.12-fix/Makefile.pre.in --- Python-2.7.12/Makefile.pre.in 2016-06-25 23:49:31.000000000 +0200 +++ Python-2.7.12-fix/Makefile.pre.in 2016-07-12 00:17:02.000000000 +0200 @@ -698,7 +698,7 @@ fi $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) + $(CC) $(OPT) $(CFLAGS) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) Parser/grammar.o: $(srcdir)/Parser/grammar.c \ $(srcdir)/Include/token.h \ ===== Also note that the same $(CFLAGS) needs to be added to the rule for $(BUILDPYTHON) if one wants to build that as well, but in my case, I only did a "make libpython2.7.a", and that indirectly depends on pgen ($(LIBRARY) -> $(LIBRARY_OBJS) -> $(PYTHON_OBJS) -> Python/graminit.o -> $(GRAMMAR_C) -> $(GRAMMAR_H) -> $(PGEN), which results in that error message, so libpython2.7.a can't be built). Another fix could be to make it so that $(GRAMMAR_H) does not depend on $(PGEN) if $(cross_compiling) is "yes" (if you read the rule contents for $(GRAMMAR_H), you'll find that indeed $(PGEN) isn't used at all if $(cross_compiling) is "yes". At least for GNU make, it might be possible to avoid building "pgen" in that case as follows and removing $(PGEN) from the default dependencies of $(GRAMMAR_H): ifneq ($(cross_compiling),yes) $(GRAMMAR_H): $(PGEN) endif If this is a more acceptable solution, one could probably rewrite the "test "$(cross_compiling" != "yes"; then..." part of the make rules from $(GRAMMAR_H) and $(GRAMMAR_C) with Make's ifeq, here's a patch for that instead (this also makes the dependencies more clear, since $(GRAMMAR_H) does not depend on $(GRAMMAR_INPUT) for the cross-input case, as it is not used): ===== diff -u Python-2.7.12/Makefile.pre.in Python-2.7.12-fix/Makefile.pre.in --- Python-2.7.12/Makefile.pre.in 2016-06-25 23:49:31.000000000 +0200 +++ Python-2.7.12-fix/Makefile.pre.in 2016-07-12 00:37:43.000000000 +0200 @@ -680,22 +680,21 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h +ifeq ($(cross_compiling),yes) +$(GRAMMAR_H): $(srcdir)/Include/graminit.h + @$(MKDIR_P) Include + cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp + mv $(GRAMMAR_H).tmp $(GRAMMAR_H) +$(GRAMMAR_C): $(srcdir)/Python/graminit.c + cp $(srcdir)/Python/graminit.c $(GRAMMAR_C).tmp + mv $(GRAMMAR_C).tmp $(GRAMMAR_C) +else $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) @$(MKDIR_P) Include - # Avoid copying the file onto itself for an in-tree build - if test "$(cross_compiling)" != "yes"; then \ - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \ - else \ - cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp; \ - mv $(GRAMMAR_H).tmp $(GRAMMAR_H); \ - fi + $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) $(GRAMMAR_C): $(GRAMMAR_H) - if test "$(cross_compiling)" != "yes"; then \ - touch $(GRAMMAR_C); \ - else \ - cp $(srcdir)/Python/graminit.c $(GRAMMAR_C).tmp; \ - mv $(GRAMMAR_C).tmp $(GRAMMAR_C); \ - fi + touch $(GRAMMAR_C) +endif $(PGEN): $(PGENOBJS) $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) ===== See also (slightly related, the "avoid running" part is fixed, but the "avoid building" part is not fixed): https://bugs.python.org/issue22625 ---------- components: Cross-Build messages: 270211 nosy: Alex.Willmer, Thomas Perl priority: normal severity: normal status: open title: ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency type: compile error versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 01:26:59 2016 From: report at bugs.python.org (Minmin Gong) Date: Tue, 12 Jul 2016 05:26:59 +0000 Subject: [New-bugs-announce] [issue27491] Errors when building with UNICODE character set Message-ID: <1468301219.72.0.359104811522.issue27491@psf.upfronthosting.co.za> New submission from Minmin Gong: Switch the pythoncore's character set to UNICODE, some compile errors about Windows APIs show up. A patch is attached to fix this. ---------- components: Windows files: 0001-Fix-building-with-UNICODE-character-set.patch keywords: patch messages: 270228 nosy: Minmin.Gong, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Errors when building with UNICODE character set type: compile error versions: Python 3.5 Added file: http://bugs.python.org/file43696/0001-Fix-building-with-UNICODE-character-set.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 03:09:41 2016 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 12 Jul 2016 07:09:41 +0000 Subject: [New-bugs-announce] [issue27492] Enhance bytearray_repr with bytes_repr's logic Message-ID: <1468307381.71.0.764408700488.issue27492@psf.upfronthosting.co.za> New submission from Xiang Zhang: Right now bytearray_repr's implementation mimics old string_repr, but it has a drawback: It arbitrarily checks overflow using four times the bytearray object's length, but the representation length of the value can range from 1 to 4. I think we can use bytes_repr's logic which calculates the actual output length. ---------- components: Interpreter Core files: bytearray_repr.patch keywords: patch messages: 270231 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Enhance bytearray_repr with bytes_repr's logic type: enhancement versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43697/bytearray_repr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 05:14:44 2016 From: report at bugs.python.org (Richard) Date: Tue, 12 Jul 2016 09:14:44 +0000 Subject: [New-bugs-announce] [issue27493] logging module fails with unclear error when supplied a (Posix)Path Message-ID: <1468314884.39.0.604549697605.issue27493@psf.upfronthosting.co.za> New submission from Richard: No idea if I should be reporting this here, but it came with the default installation, so here goes: On a mac, I supplied a basicConfig object to the logging class that contains a PosixPath instance for the "filename" attribute. consequently, it fails with the error message "'PosixPath' object has no attribute 'startswith'" without specifying where the issue lies. offending value: STATUSLOG_PATH = Path('~/logFiles/Reseller/').expanduser() Relevant part of the traceback (which didn't print by default): File "/Users/rhendrikse/Documents/PythonScripts/Reseller/Reseller/application/application.py", line 41, in __setup_logger logging.basicConfig(level=logging.DEBUG, format=DEFS.RUNLOG_FORMAT, filename=DEFS.RUNLOG_PATH) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 1744, in basicConfig h = FileHandler(filename, mode) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 998, in __init__ self.baseFilename = os.path.abspath(filename) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", line 357, in abspath if not isabs(path): File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", line 64, in isabs return s.startswith(sep) AttributeError: 'PosixPath' object has no attribute 'startswith' ---------- components: Library (Lib) messages: 270233 nosy: rhendrikse priority: normal severity: normal status: open title: logging module fails with unclear error when supplied a (Posix)Path versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 06:29:13 2016 From: report at bugs.python.org (Jakub Stasiak) Date: Tue, 12 Jul 2016 10:29:13 +0000 Subject: [New-bugs-announce] [issue27494] 2to3 parser failure caused by a comma after a generator expression Message-ID: <1468319353.83.0.357995670089.issue27494@psf.upfronthosting.co.za> New submission from Jakub Stasiak: Test file (test.py): print(set(x for x in range(2),)) Python runs it nicely: % python2 test.py set([0, 1]) % python3 test.py {0, 1} 2to3 parser (on both Python 2.7.11 and 3.5.2) chokes on it though: % /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin/2to3 test.py RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=u')', context=('', (1, 30)) RefactoringTool: No files need to be modified. RefactoringTool: There was 1 error: RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=u')', context=('', (1, 30)) % /usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/bin/2to3 test.py RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=')', context=('', (1, 30)) RefactoringTool: No files need to be modified. RefactoringTool: There was 1 error: RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=')', context=('', (1, 30)) For reference: https://github.com/smarkets/flake8-strict/issues/9 (project using lib2to3 parser) ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 270236 nosy: jstasiak priority: normal severity: normal status: open title: 2to3 parser failure caused by a comma after a generator expression type: crash versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 07:30:29 2016 From: report at bugs.python.org (Danilo J. S. Bellini) Date: Tue, 12 Jul 2016 11:30:29 +0000 Subject: [New-bugs-announce] [issue27495] Pretty printing sorting for set and frozenset instances Message-ID: <1468323029.69.0.352634397545.issue27495@psf.upfronthosting.co.za> New submission from Danilo J. S. Bellini: The pprint pretty printer in Python 3 sorts sets/frozensets only if their length don't fit in one single line/row for the given width, else it was just leaving repr(my_set_instance) alone, like: >>> import string, pprint >>> pprint.pprint(set(string.digits)) {'7', '5', '2', '4', '1', '9', '6', '3', '0', '8'} That order is quite random in Python 3.2+. But on Python 2.6 and 2.7, the result is shown as: set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']) So for using pprint in doctests (or anything alike) with sets/frozensets, the pretty printer isn't as useful in Python 3 than it is in Python 2. The pprint tests for non-nested set/frozenset were only using some small ranges for testing. I've written a patch to solve that. ---------- components: Library (Lib) files: pprint_small_set_sorted.patch keywords: patch messages: 270237 nosy: danilo.bellini priority: normal severity: normal status: open title: Pretty printing sorting for set and frozenset instances type: behavior versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43698/pprint_small_set_sorted.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 09:10:49 2016 From: report at bugs.python.org (Zack Weinberg) Date: Tue, 12 Jul 2016 13:10:49 +0000 Subject: [New-bugs-announce] [issue27496] unicodedata.name() doesn't have names for control characters Message-ID: <1468329049.33.0.201400438769.issue27496@psf.upfronthosting.co.za> New submission from Zack Weinberg: unicodedata.name() doesn't have name information for the C0 and C1 control characters. To see this, run pprint.pprint(["U+{:04X} {}".format(n, unicodedata.name(chr(n), "")) for n in range(256)]) and you will observe printed for U+0000 through U+001F and U+007F through U+009F. These characters do have official Unicode names and they should be known to name(). I may see if I can come up with a patch for this one, in my copious free time. ---------- components: Library (Lib) messages: 270242 nosy: zwol priority: normal severity: normal status: open title: unicodedata.name() doesn't have names for control characters type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 11:14:08 2016 From: report at bugs.python.org (Logan) Date: Tue, 12 Jul 2016 15:14:08 +0000 Subject: [New-bugs-announce] [issue27497] csv module: Add return value to DictWriter.writeheader Message-ID: <1468336448.04.0.83850338242.issue27497@psf.upfronthosting.co.za> New submission from Logan: Currently, DictWriter.writeheader() is defined like: def writeheader(self): header = dict(zip(self.fieldnames, self.fieldnames)) self.writerow(header) It would be useful to have it return the value of writerow(): def writeheader(self): header = dict(zip(self.fieldnames, self.fieldnames)) return self.writerow(header) This would useful because: 1) It would match the behavior of DictWriter.writerow 2) It would enable DictWriter.writeheader to be used in within a generator function (ala https://docs.djangoproject.com/en/1.9/howto/outputting-csv/#streaming-large-csv-files) ---------- messages: 270248 nosy: lsowen priority: normal severity: normal status: open title: csv module: Add return value to DictWriter.writeheader type: enhancement versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 11:54:02 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 12 Jul 2016 15:54:02 +0000 Subject: [New-bugs-announce] [issue27498] Regression in repr() of class object Message-ID: <1468338842.06.0.843714859349.issue27498@psf.upfronthosting.co.za> New submission from Guido van Rossum: In Python 3.6, the repr() of a class includes its memory address. This is going to cause a lot of problems for tests in 3rd party code that expects the nice and clean instead of ??. I understand the desire to provide more clarity in case somehow two class objects created at different times have the same name -- but I'm not sure I like to rub the hex address in the user's face all the time. Can we please roll this back or think about a better way to reveal this that won't break so many 3rd party tests? ---------- messages: 270251 nosy: gvanrossum priority: normal severity: normal status: open title: Regression in repr() of class object versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 11:59:47 2016 From: report at bugs.python.org (Daniel Holth) Date: Tue, 12 Jul 2016 15:59:47 +0000 Subject: [New-bugs-announce] [issue27499] PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API Message-ID: <1468339187.51.0.412519931192.issue27499@psf.upfronthosting.co.za> New submission from Daniel Holth: When compiling my cryptacular extension https://bitbucket.org/dholth/cryptacular I noticed -DPy_LIMITED_API -DPY_SSIZE_T_CLEAN creates a binary that does not actually use the limited api. This causes segfaults on Linux but does not appear to cause problems on Windows. I found some emails suggestid PY_SSIZE_T_CLEAN was supposed to go away entirely? ---------- components: Extension Modules messages: 270252 nosy: dholth priority: normal severity: normal status: open title: PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 13:55:35 2016 From: report at bugs.python.org (Sebastien Bourdeauducq) Date: Tue, 12 Jul 2016 17:55:35 +0000 Subject: [New-bugs-announce] [issue27500] ProactorEventLoop cannot open connection to ::1 Message-ID: <1468346135.06.0.410333112523.issue27500@psf.upfronthosting.co.za> New submission from Sebastien Bourdeauducq: The following code fails with "OSError: [WinError 10022] An invalid argument was supplied". import asyncio loop = asyncio.ProactorEventLoop() asyncio.set_event_loop(loop) loop.run_until_complete(asyncio.open_connection("::1", 4242)) This is a regression in 3.5.2. 3.5.1 does not have this bug. Connecting to 127.0.0.1 does not cause the problem. ---------- components: asyncio messages: 270258 nosy: gvanrossum, haypo, sebastien.bourdeauducq, yselivanov priority: normal severity: normal status: open title: ProactorEventLoop cannot open connection to ::1 versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 14:07:23 2016 From: report at bugs.python.org (Daniel Moisset) Date: Tue, 12 Jul 2016 18:07:23 +0000 Subject: [New-bugs-announce] [issue27501] Create a collections.abc class that describes PEP 3118 buffer Message-ID: <1468346843.82.0.455431578723.issue27501@psf.upfronthosting.co.za> New submission from Daniel Moisset: The buffer protocol is a low level C protocol, but even if it doesn't expose a specific python API, it's currently not possible to say "this object implements the buffer protocol" in Python This might be useful for some applications, including PEP-484 typing hints. It would be useful to have a collections.abc.Buffer which already registers the types that already support the protocol (bytes, strings, array.array, struct, mmap, ctype arrays/pointers, etc) ---------- messages: 270261 nosy: Daniel Moisset priority: normal severity: normal status: open title: Create a collections.abc class that describes PEP 3118 buffer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 15:09:33 2016 From: report at bugs.python.org (Dhiraj) Date: Tue, 12 Jul 2016 19:09:33 +0000 Subject: [New-bugs-announce] [issue27502] Python -m Module Vulnerable to Buffer Over Flow. Message-ID: <1468350573.84.0.544949544506.issue27502@psf.upfronthosting.co.za> New submission from Dhiraj: Hello Sir , The Module of Python " -m SimpleHTTPServer " is vulnerable to Buffer Over Flow. Step : I have prepared a python script which is sending more than 5000+ Values to the Module in GET Method , and as soon as , I run that Script , the Python -m SimpleHTTPServer which is running on the Victim's system Generator?s a huge Line or Error where as Exception handling is not done Proper , as if the Server do not get crash , but if the fuzzing script is run again and again it gets Crashed , and Buffer Over Flow is been Taken place. In our Scenario Kali Linux machine is victims system running the server module and Linux Mint is sending the fuzzing script. Please have a look on the POC below. I ll be happy to hear from the team. Thank You ---------- files: POC-Python.zip messages: 270264 nosy: DhirajMishra priority: normal severity: normal status: open title: Python -m Module Vulnerable to Buffer Over Flow. type: security versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43699/POC-Python.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 19:32:11 2016 From: report at bugs.python.org (Maxim Sobolev) Date: Tue, 12 Jul 2016 23:32:11 +0000 Subject: [New-bugs-announce] [issue27503] support RUSAGE_THREAD as a constant in the resource module Message-ID: <1468366331.88.0.761138440335.issue27503@psf.upfronthosting.co.za> New submission from Maxim Sobolev: This is duplicate of the #10440, which has been added in 2010 into 3.x but never merged. ---------- files: patch-Modules_resource.c messages: 270275 nosy: Maxim Sobolev priority: normal severity: normal status: open title: support RUSAGE_THREAD as a constant in the resource module type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file43700/patch-Modules_resource.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 20:40:21 2016 From: report at bugs.python.org (Mitchell Model) Date: Wed, 13 Jul 2016 00:40:21 +0000 Subject: [New-bugs-announce] [issue27504] Missing assertion methods in unittest documentation Message-ID: <1468370421.07.0.622363937754.issue27504@psf.upfronthosting.co.za> New submission from Mitchell Model: In looking at the source for unittest.TestCase I was very surprised to see quite a few assertion methods that are not included in the module documentation. Every available assertion method should be included in the library documentation. Users should not have to look at the source to see what's available ? in fact, why would it even occur to the typical user to do that? Also, I think the phrase "provides several assert methods to check for and report failures" is an understatement ? it provides MANY assert methods. I think "assertion method" is a better term than "assert method". ---------- assignee: docs at python components: Documentation messages: 270278 nosy: MLModel, docs at python priority: normal severity: normal status: open title: Missing assertion methods in unittest documentation type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 12 21:32:01 2016 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 13 Jul 2016 01:32:01 +0000 Subject: [New-bugs-announce] [issue27505] Missing documentation for setting module __class__ attribute Message-ID: <1468373521.97.0.915242819681.issue27505@psf.upfronthosting.co.za> New submission from Nick Coghlan: Python 3.5 added the ability to set module __class__ attributes by way of http://bugs.python.org/issue22986 However, this isn't covered in the What's New guide or anywhere else in the documentation, and even in the NEWS file it appears under the cryptic title "Issue #22986: Allow changing an object?s __class__ between a dynamic type and static type in some cases." for 3.5.0a1 This should be documented somewhere (perhaps in the data model section of the language reference?) and an example given of using the feature to emit DeprecationWarning for access to a particular module level attribute. It should also be mentioned in the Python 3.5 What's New documentation. ---------- assignee: docs at python components: Documentation messages: 270285 nosy: docs at python, ncoghlan, njs priority: normal severity: normal stage: needs patch status: open title: Missing documentation for setting module __class__ attribute type: enhancement versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 13 05:48:57 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 13 Jul 2016 09:48:57 +0000 Subject: [New-bugs-announce] [issue27506] bytes/bytearray delete acts as keyword argument Message-ID: <1468403337.28.0.33019551319.issue27506@psf.upfronthosting.co.za> New submission from Xiang Zhang: Write a patch to make bytes/bytearray.translate's delete argument support acting as keyword arguments. This won't break any backwards compatibility and make the method more flexible to use. Besides, in the C code level, it stops using argument clinic's legacy optional group feature and removes the unnecessary group_right_1 parameter. ---------- components: Interpreter Core files: bytes_translate_delete_as_keyword_arguments.patch keywords: patch messages: 270303 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: bytes/bytearray delete acts as keyword argument type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43703/bytes_translate_delete_as_keyword_arguments.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 13 13:12:28 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 13 Jul 2016 17:12:28 +0000 Subject: [New-bugs-announce] [issue27507] bytearray.extend lacks overflow check when increasing buffer Message-ID: <1468429948.12.0.767304648411.issue27507@psf.upfronthosting.co.za> New submission from Xiang Zhang: As the title, bytearray.extend simply use `buf_size = len + (len >> 1) + 1;` to determine next *buf_size* when increasing buffer. But this can overflow in theory. So I suggest adding overflow check. ---------- components: Interpreter Core files: add_bytearray_extend_overflow_check.patch keywords: patch messages: 270327 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: bytearray.extend lacks overflow check when increasing buffer type: enhancement versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43707/add_bytearray_extend_overflow_check.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 13 13:20:48 2016 From: report at bugs.python.org (JA) Date: Wed, 13 Jul 2016 17:20:48 +0000 Subject: [New-bugs-announce] [issue27508] process thread with implicit join is killed unexpectedly Message-ID: <1468430448.11.0.0781111425971.issue27508@psf.upfronthosting.co.za> New submission from JA: On Ubuntu 16.04 python '3.5.1+ (default, Mar 30 2016, 22:46:26) \n[GCC 5.3.1 20160330]' The following code prints "hi" 4 times: import multiprocessing import time import threading class dumb(threading.Thread): def __init__(self): super(dumb, self).__init__() def run(self): while True: print("hi") time.sleep(1) def test(): for i in range(2): bar = dumb() bar.start() def main(): p = [] for i in range(2): p.append(multiprocessing.Process(target=test)) for i in p: i.start() for i in p: i.join() if __name__ == '__main__': main() Note: The above code runs fine on Python 3.5.2 (64-bit) on Windows 10 Joining the threads in test fixes the problem: def test(): p = [] for i in range(2): bar = dumb() bar.start() p.append(bar) for i in p: i.join() ---------- messages: 270329 nosy: JA priority: normal severity: normal status: open title: process thread with implicit join is killed unexpectedly versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 02:36:51 2016 From: report at bugs.python.org (Charles G.) Date: Thu, 14 Jul 2016 06:36:51 +0000 Subject: [New-bugs-announce] [issue27509] Some tests breaks PGO build on Windows Message-ID: <1468478211.0.0.475693084569.issue27509@psf.upfronthosting.co.za> New submission from Charles G.: Environment: Python 3.5.2 Visual Studio 2015 Update 2 Windows 7 amd64 I tried to build python with pgo (build.bat --pgo) but found that no python35!1.pgc or python!1.pgc was created. Then I run the tests one by one while checking the existence of python35!1.pgc and found that these tests when run prevents above pgcs from being created: test_concurrent_futures test_faulthandler test_multiprocessing_main_handling test_multiprocessing_spawn test_os test_subprocess I'm not sure of the reason why no pgc is produced when running these tests. ---------- components: Windows messages: 270374 nosy: Charles G., paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Some tests breaks PGO build on Windows type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 03:51:52 2016 From: report at bugs.python.org (Decorater) Date: Thu, 14 Jul 2016 07:51:52 +0000 Subject: [New-bugs-announce] [issue27510] Found some Solution build missconfigurations. Message-ID: <1468482712.8.0.771661721324.issue27510@psf.upfronthosting.co.za> New submission from Decorater: I went in and looked in the batch build list to find some missconfigurations So, I went in and selected the right ones that I can see currently. ---------- components: Build, Windows files: pcbuild.sln messages: 270380 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Found some Solution build missconfigurations. type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43711/pcbuild.sln _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 05:06:36 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 14 Jul 2016 09:06:36 +0000 Subject: [New-bugs-announce] [issue27511] Add PathLike objects support to BZ2File Message-ID: <1468487196.41.0.384134655138.issue27511@psf.upfronthosting.co.za> New submission from Xiang Zhang: Attach a patch to add PathLike objects support to BZ2File. ---------- files: add_PathLike_objects_support_to_BZ2File.patch keywords: patch messages: 270385 nosy: brett.cannon, ethan.furman, xiang.zhang priority: normal severity: normal status: open title: Add PathLike objects support to BZ2File Added file: http://bugs.python.org/file43712/add_PathLike_objects_support_to_BZ2File.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 05:28:13 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 14 Jul 2016 09:28:13 +0000 Subject: [New-bugs-announce] [issue27512] os.fspath is certain to crash when exception raised in __fspath__ Message-ID: <1468488493.55.0.648642707869.issue27512@psf.upfronthosting.co.za> New submission from Xiang Zhang: When any exception is raised inside __fspath__, operations involving it like os.fspath, open are certain to crash. >>> import os >>> class Test: ... def __fspath__(self): ... raise RuntimeError ... >>> os.fspath(Test()) Segmentation fault (core dumped) Attach a patch to fix this. ---------- components: Extension Modules files: fix_fspath_crash.patch keywords: patch messages: 270386 nosy: brett.cannon, ethan.furman, xiang.zhang priority: normal severity: normal status: open title: os.fspath is certain to crash when exception raised in __fspath__ type: crash versions: Python 3.6 Added file: http://bugs.python.org/file43713/fix_fspath_crash.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 06:50:11 2016 From: report at bugs.python.org (Hans-Peter Jansen) Date: Thu, 14 Jul 2016 10:50:11 +0000 Subject: [New-bugs-announce] [issue27513] email.utils.getaddresses raises exception from erroneous message get_all input Message-ID: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> New submission from Hans-Peter Jansen: An unfortunate combination of get_all and getaddresses results in a Traceback: Traceback (most recent call last): File "misc/decode_from_header.py", line 17, in print('From: %s' % email.utils.getaddresses(val)) File "/usr/lib64/python3.4/email/utils.py", line 112, in getaddresses all = COMMASPACE.join(fieldvalues) TypeError: sequence item 0: expected str instance, Header found Here's the relevant part of it: Content-type: text/html;charset=iso-8859-1 From: Ita? Uniclass. Obviously, the From header is iso-8859-1 encoded as well, and violates RFC 2822 as such. But making it crash in the usual combination of val = msg.get('from') email.utils.getaddresses([val]) isn't the real McCoy either.. ---------- components: email files: iso-8859-1-encoded-from-header.mail messages: 270399 nosy: barry, frispete, r.david.murray priority: normal severity: normal status: open title: email.utils.getaddresses raises exception from erroneous message get_all input type: crash versions: Python 3.4 Added file: http://bugs.python.org/file43714/iso-8859-1-encoded-from-header.mail _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 08:33:51 2016 From: report at bugs.python.org (ppperry) Date: Thu, 14 Jul 2016 12:33:51 +0000 Subject: [New-bugs-announce] [issue27514] SystemError when compiling deeply nested for loops Message-ID: <1468499631.41.0.70687115065.issue27514@psf.upfronthosting.co.za> New submission from ppperry: The following code: for a in range(26): for b in range(26): for c in range(26): for d in range(26): for e in range(26): for f in range(26): for g in range(26): for h in range(26): for i in range(26): for j in range(26): for k in range(26): for l in range(26): for m in range(26): for o in range(26): for p in range(26): for q in range(26): for r in range(26): for s in range(26): for t in range(26): for u in range(26): for v in range(26): for w in range(26): pass fails to compile with `SystemError:too many statically nested blocks`, which was described as a serious bug in issue27081. ---------- components: Interpreter Core messages: 270405 nosy: benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, ppperry, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: SystemError when compiling deeply nested for loops type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 16:48:35 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 14 Jul 2016 20:48:35 +0000 Subject: [New-bugs-announce] [issue27515] Dotted name re-import does not rebind after deletion Message-ID: <1468529315.51.0.393890498474.issue27515@psf.upfronthosting.co.za> New submission from Terry J. Reedy: https://docs.python.org/3/reference/simple_stmts.html#the-import-statement says that import , where can optionally be a dotted name referring to a module within a package, does two things: 1. Find a module object corresponding to , creating it if necessary. 2. Bind the object to the name in the local namespace. In short, 'import x' is shorthand for "x = __import__('x', ...)". AFAIK, this works for simple names, including re-imports after name deletion. >>> import email; email >>> del email >>> import email; email However, the same is not true for dotted names. >>> import email.charset; email.charset >>> del email.charset >>> import email.charset; email.charset Traceback (most recent call last): File "", line 1, in import email.charset; email.charset AttributeError: module 'email' has no attribute 'charset' It appears that for dotted names, when step 1 is cut short by finding the cached module, step 2 is (improperly) omitted. I consider this a bug in the code rather than the doc. I think the name binding should not depend on how the module was found. I don't know whether the bug is somewhere in importlib or in the core machinery that uses it. This bug, in relation to tkinter package modues, prevented and AFAIK prevents me from fixing the bug of #25507 in 3.x versions prior to 3.6 (Tkinter in 2.x was not a package). (For 3.6, I can and will refactor idlelib to eliminate the need for the deletion by preventing excess imports.) ---------- components: Interpreter Core, Library (Lib) messages: 270438 nosy: brett.cannon, eric.snow, ncoghlan, terry.reedy priority: normal severity: normal stage: test needed status: open title: Dotted name re-import does not rebind after deletion type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 18:50:14 2016 From: report at bugs.python.org (Palm Kevin) Date: Thu, 14 Jul 2016 22:50:14 +0000 Subject: [New-bugs-announce] [issue27516] Wrong initialization of python path with embeddable distribution Message-ID: <1468536614.57.0.563747018021.issue27516@psf.upfronthosting.co.za> New submission from Palm Kevin: The way the python path is initialized with the embeddable python distribution makes no sense for me. If no environment variable PYTHONPATH is set, then the path is initialized like this: [python352]\python35.zip;.\DLLs;.\lib;[folder_of_executable] --> the distribution folder itself is not in the path ([python352]), an import of _socket will thus fail ! --> Having DLLs and lib in the path is useless (Notice, that when the PYTHONHOME is initialized, then the path '[python352]' is also used for DLLs and lib (instead of '.\') If the environment variable PYTHONPATH is set, then the path is extended like this: [python352]\python35.zip;[folder_of_executable] --> the distribution folder itself is not in the path ([python352]), an import of _socket will thus fail ! I would prefer this behavior: * python path is not initialized anymore with 'DLLs' and 'lib' * the distribution-folder should always be added to the python-path ---------- messages: 270447 nosy: palm.kevin priority: normal severity: normal status: open title: Wrong initialization of python path with embeddable distribution type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 14 21:03:30 2016 From: report at bugs.python.org (Benjamin Fogle) Date: Fri, 15 Jul 2016 01:03:30 +0000 Subject: [New-bugs-announce] [issue27517] LZMACompressor and LZMADecompressor raise exceptions if given empty strings twice Message-ID: <1468544610.85.0.0793383244022.issue27517@psf.upfronthosting.co.za> New submission from Benjamin Fogle: To reproduce: >>> import lzma >>> c = lzma.LZMACompressor() >>> c.compress(b'') b'\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F' >>> c.compress(b'') b'' >>> c.compress(b'') Traceback (most recent call last): File "", line 1, in _lzma.LZMAError: Insufficient buffer space >>> d = lzma.LZMADecompressor() >>> d.decompress(b'') b'' >>> d.decompress(b'') Traceback (most recent call last): File "", line 1, in _lzma.LZMAError: Insufficient buffer space This can occur anytime during compression/decompression when an empty string is passed twice in a row. The problem is that that liblzma interprets a call to lzma_code() with avail_in == 0 as a buffer full condition. The second time in a row it encounters this, it returns LZMA_BUF_ERROR as per documentation. The attached patch prevents this condition from occurring. ---------- components: Extension Modules files: lzma.patch keywords: patch messages: 270451 nosy: benfogle priority: normal severity: normal status: open title: LZMACompressor and LZMADecompressor raise exceptions if given empty strings twice type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43727/lzma.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 06:39:07 2016 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 15 Jul 2016 10:39:07 +0000 Subject: [New-bugs-announce] [issue27518] small typo error in Grammar/Grammar Message-ID: <1468579147.6.0.884332252172.issue27518@psf.upfronthosting.co.za> New submission from St?phane Wirtel: Here is a small patch for the Grammar/Grammar file, there is a typo in the comments. ---------- assignee: docs at python components: Documentation files: Grammar.diff keywords: patch messages: 270475 nosy: docs at python, matrixise priority: normal severity: normal status: open title: small typo error in Grammar/Grammar versions: Python 3.6 Added file: http://bugs.python.org/file43730/Grammar.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 07:12:37 2016 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 15 Jul 2016 11:12:37 +0000 Subject: [New-bugs-announce] [issue27519] update the references to http://mercurial.selenic.com Message-ID: <1468581157.12.0.317486616514.issue27519@psf.upfronthosting.co.za> New submission from St?phane Wirtel: In the devguide, there are some references to http://mercurial.selenic.com/wiki/ but the website has been migrated to http://mercurial-scm.org/wiki/ ---------- assignee: docs at python components: Documentation messages: 270476 nosy: docs at python, matrixise priority: normal severity: normal status: open title: update the references to http://mercurial.selenic.com versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 11:27:01 2016 From: report at bugs.python.org (Decorater) Date: Fri, 15 Jul 2016 15:27:01 +0000 Subject: [New-bugs-announce] [issue27520] Issue when building PGO Message-ID: <1468596421.99.0.279689022473.issue27520@psf.upfronthosting.co.za> New submission from Decorater: I get this issue when trying a PGO build it seems that some projects do not create a pgd. (the link to simplify the size on here) https://bpaste.net/show/c704ee912c53 ---------- components: Build, Tests, Windows messages: 270487 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Issue when building PGO versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 13:26:50 2016 From: report at bugs.python.org (Dor Dankner) Date: Fri, 15 Jul 2016 17:26:50 +0000 Subject: [New-bugs-announce] [issue27521] Misleading compress level header on files created with gzip Message-ID: <1468603610.22.0.92461778532.issue27521@psf.upfronthosting.co.za> New submission from Dor Dankner: When creating a gzip file using the gzip module, the wrong header is set as the compress level when not using the default (9). the reason is that the header is set blindly as \002, without really checking what compress level is. Patch to fix that behaviour is provided :) (Patch tested on python 3.5, but relevant to 2.x versions too) ---------- components: Extension Modules files: gzip_compressionlvl_header_fix.patch keywords: patch messages: 270490 nosy: ddorda priority: normal severity: normal status: open title: Misleading compress level header on files created with gzip type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43732/gzip_compressionlvl_header_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 15:17:55 2016 From: report at bugs.python.org (Costas) Date: Fri, 15 Jul 2016 19:17:55 +0000 Subject: [New-bugs-announce] [issue27522] Reference cycle in email.feedparser Message-ID: <1468610275.0.0.18157946386.issue27522@psf.upfronthosting.co.za> New submission from Costas: Background: We have two (clusters of) servers running a high-throughput websocket application. One runs under Python 2.7, the other has been migrated to 3.4. Very similar code runs on both servers, and both manually call the gc periodically to reduce latency. Problem: We noticed that under load the 3.4 server seems to slowly "leak" memory between gc collections, while the 2.7 server doesn't have this issue. Investigation: I tracked down the source of all the garbage to email.feedparser, which is used by http.server to parse the headers of incoming requests. The initialiser of the FeedParser class creates a reference cycle by putting a lambda function into a member variable. The lambda contains a closure with its surrounding scope that points to the object, and the object points back to the lambda. Proposed fix: The lambda can be harmlessly replaced by a boolean value, which doesn't cause the problem, and it's much more readable too. I'm attaching a little patch. ---------- components: email files: emailfeedparsergc.patch keywords: patch messages: 270503 nosy: Costas, barry, r.david.murray priority: normal severity: normal status: open title: Reference cycle in email.feedparser type: resource usage versions: Python 3.5 Added file: http://bugs.python.org/file43733/emailfeedparsergc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 17:05:45 2016 From: report at bugs.python.org (Decorater) Date: Fri, 15 Jul 2016 21:05:45 +0000 Subject: [New-bugs-announce] [issue27523] Silence Socket Depreciation Warnings. Message-ID: <1468616745.33.0.508663213615.issue27523@psf.upfronthosting.co.za> New submission from Decorater: I have made a patch to some of the warnings to silence them hopefully this will help a lot. ---------- files: socketmodule.c.patch keywords: patch messages: 270512 nosy: Decorater priority: normal severity: normal status: open title: Silence Socket Depreciation Warnings. versions: Python 3.6 Added file: http://bugs.python.org/file43737/socketmodule.c.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 17:06:32 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 15 Jul 2016 21:06:32 +0000 Subject: [New-bugs-announce] [issue27524] Update os.path for PEP 519/__fspath__() Message-ID: <1468616792.91.0.199248434704.issue27524@psf.upfronthosting.co.za> New submission from Brett Cannon: As per PEP 519, os.path needs to be updated to support __fspath__(). ---------- assignee: brett.cannon components: Library (Lib) messages: 270513 nosy: brett.cannon priority: release blocker severity: normal stage: test needed status: open title: Update os.path for PEP 519/__fspath__() type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 17:14:53 2016 From: report at bugs.python.org (Dor Dankner) Date: Fri, 15 Jul 2016 21:14:53 +0000 Subject: [New-bugs-announce] [issue27525] Wrong OS header on file created by gzip module Message-ID: <1468617293.43.0.813584223225.issue27525@psf.upfronthosting.co.za> New submission from Dor Dankner: The gzip module generates files with wrong OS header, by putting "Unknown" OS, instead of checking and filling the user's OS. >From the gzip RFC (rfc1952): "This identifies the type of file system on which compression took place. This may be useful in determining end-of-line convention for text files." The following patch contains a fix that fills the current OS flag (and testcase ;) ) * The bug is relevant to python 2.x too, but I did not test the patch on it. ** also, I did not run the testcase on Win/Mac, however it should work. ---------- components: Extension Modules files: gzip_os_header_fix_and_tests.patch keywords: patch messages: 270515 nosy: ddorda priority: normal severity: normal status: open title: Wrong OS header on file created by gzip module type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43738/gzip_os_header_fix_and_tests.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 15 22:09:05 2016 From: report at bugs.python.org (R. David Murray) Date: Sat, 16 Jul 2016 02:09:05 +0000 Subject: [New-bugs-announce] [issue27526] test_venv.TestEnsurePip fails mysteriously when /tmp is too small Message-ID: <1468634945.4.0.415897452337.issue27526@psf.upfronthosting.co.za> New submission from R. David Murray: I've been having a failure in test_venv when running the tests suite for some months now. Since the buildbots aren't, I was guessing it was a local problem. I finally got around to looking at it today, and I had no clue what was wrong here, after setting maxDiff to None: ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/rdmurray/python/p35/Lib/test/test_venv.py", line 381, in test_with_pip self.assertEqual(err, "") AssertionError: 'Traceback (most recent call last):\n Fil[741 chars]\'\n' != '' - Traceback (most recent call last): - File "/home/rdmurray/python/p35/Lib/runpy.py", line 174, in _run_module_as_main - mod_name, mod_spec, code = _get_module_details(mod_name, _Error) - File "/home/rdmurray/python/p35/Lib/runpy.py", line 133, in _get_module_details - return _get_module_details(pkg_main_name, error) - File "/home/rdmurray/python/p35/Lib/runpy.py", line 109, in _get_module_details - __import__(pkg_name) - File "/tmp/tmpcpx0dj2o/lib/python3.5/site-packages/pip/__init__.py", line 14, in - from pip.utils import get_installed_distributions, get_prog - File "/tmp/tmpcpx0dj2o/lib/python3.5/site-packages/pip/utils/__init__.py", line 27, in - from pip._vendor import pkg_resources - ImportError: cannot import name 'pkg_resources' It turns out that the problem was that the virtual machine I was running this in had a /tmp that was too small for pip to operate. I've had this problem often with pip on my VMs. I'm reporting this because it seems to me reasonably likely that ensurepip will fail mysteriously if /tmp is too small. I'm OK with this issue getting closed as won't fix, since my setup is rather odd and it may be that no one else will run in to this. But it may be that someone else will, and at least there will be a bug report to find. ---------- messages: 270532 nosy: dstufft, r.david.murray priority: normal severity: normal status: open title: test_venv.TestEnsurePip fails mysteriously when /tmp is too small type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 01:16:03 2016 From: report at bugs.python.org (Decorater) Date: Sat, 16 Jul 2016 05:16:03 +0000 Subject: [New-bugs-announce] [issue27527] Make not yielding from or awaiting a coroutine a SyntaxError Message-ID: <1468646163.93.0.141694067848.issue27527@psf.upfronthosting.co.za> New submission from Decorater: Currently there is a waring printed in python when you try to call a coroutine without yieling from or awaiting it but I would like it to be a SyntaxError when this happens instead. ---------- components: Windows messages: 270538 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Make not yielding from or awaiting a coroutine a SyntaxError versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 03:47:50 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 16 Jul 2016 07:47:50 +0000 Subject: [New-bugs-announce] [issue27528] Document that filterwarnings(message=...) matches the start of a message Message-ID: <1468655270.19.0.264691959865.issue27528@psf.upfronthosting.co.za> New submission from Martin Panter: I assumed that the ?message? parameter could be used to match any substring of a warning message, but it turns out it calls regex.match(), which is anchored at the beginning of the search string (but is not anchored at the end). I propose this patch to clarify the documentation, and add some tests. ---------- assignee: docs at python components: Documentation files: match-start.patch keywords: patch messages: 270546 nosy: docs at python, martin.panter priority: normal severity: normal stage: patch review status: open title: Document that filterwarnings(message=...) matches the start of a message versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43744/match-start.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 04:59:54 2016 From: report at bugs.python.org (Mirano Tuk) Date: Sat, 16 Jul 2016 08:59:54 +0000 Subject: [New-bugs-announce] [issue27529] Tkinter memory leak on OS X Message-ID: <1468659594.57.0.874170107699.issue27529@psf.upfronthosting.co.za> New submission from Mirano Tuk: There seems to be a memory leak in tkinter on OSX (Windows and Linux don't seem to be affected). Explicitly calling Tk.update() sometimes permanently allocates a multiple of 4096 bytes. Allocation happens more frequently if update calls are in close succession. import time from tkinter import Tk root = Tk() while True: root.update() # Huge memory leak while True: root.update() # No memory leaks time.sleep(1) Issue occurs on python3.3 and above, did not test on older versions. ---------- components: Macintosh, Tkinter messages: 270550 nosy: Mirano Tuk, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Tkinter memory leak on OS X type: resource usage versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 13:05:44 2016 From: report at bugs.python.org (Daniel Lord) Date: Sat, 16 Jul 2016 17:05:44 +0000 Subject: [New-bugs-announce] [issue27530] Non-Critical Compiler WARNING: Python Embedding C++11 does not allow non-constant string literals Message-ID: <1468688744.22.0.0620333802067.issue27530@psf.upfronthosting.co.za> New submission from Daniel Lord: ERROR SUMMARY: abstract.h:1332:60: warning: ISO C++ forbids converting a string constant to ?char*? [-Wwrite-strings] #define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL) ISSUE CRITICALITY: Non-fatal Warning (will become an error eventually when deprecations expire and errors are introduced in c++XX or later) COMPILER: g++ -std=c++11 g++ 4.2.1 $g++ -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.3.0 (clang-703.0.31) Target: x86_64-apple-darwin15.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin FILE: abstract.h WORKAROUND: add compiler option: -Wc++11-compat-deprecated-writable-strings and -Wwritable-strings. In theory anyway: doesn't seem to work (still get the warning) and when I tried g++ 5.3.0, the compiler marks that option as an error and unsupported. g++-5.3.0: error: unrecognized command line option ?-Wwritable-strings? g++-5.3.0: error: unrecognized command line option ?-Wc++11-compat-deprecated-writable-strings? ERROR MESSAGE: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] pList = PyMapping_Keys(pDict); ^ /Users/xxxxxx/anaconda/include/python2.7/abstract.h:1332:49: note: expanded from macro 'PyMapping_Keys' #define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL) ^ 1 warning generated. OFFENDING STATEMNT: #define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL) PROBLEM: "keys" is a string literal but not declared as a constant. COMMENTS: This is not a big deal...yet. I can compile with g++ C++11 using the above flag to allow deprecated writeable string literals for my application embedding Python 2.7. However, I assume the embedding code is replete with non-constant string literals which eventually need to be fixed though this is the first one I have run into. ---------- components: Extension Modules messages: 270572 nosy: Daniel Lord priority: normal severity: normal status: open title: Non-Critical Compiler WARNING: Python Embedding C++11 does not allow non-constant string literals type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 14:00:02 2016 From: report at bugs.python.org (Michael Killough) Date: Sat, 16 Jul 2016 18:00:02 +0000 Subject: [New-bugs-announce] [issue27531] Documentation for assert_not_called() has wrong signature Message-ID: <1468692002.86.0.178541373215.issue27531@psf.upfronthosting.co.za> New submission from Michael Killough: The documentation for `Mock.assert_not_called` gives its signature as `assert_not_called(*args, **kwargs)`. Since 01ae1ac2daf4, its signature has just been `assert_not_called()`. I've attached a trivial patch that updates the documentation to match the new signature. ---------- assignee: docs at python components: Documentation files: docs-assert_not_called.patch keywords: patch messages: 270577 nosy: docs at python, mjkillough priority: normal severity: normal status: open title: Documentation for assert_not_called() has wrong signature versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43754/docs-assert_not_called.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 15:08:05 2016 From: report at bugs.python.org (James Lu) Date: Sat, 16 Jul 2016 19:08:05 +0000 Subject: [New-bugs-announce] [issue27532] Dictionary iterator has no len() Message-ID: <1468696085.0.0.60768174571.issue27532@psf.upfronthosting.co.za> New submission from James Lu: This would be useful for libraries like tqdm (progress bar module). ---------- components: Interpreter Core messages: 270581 nosy: James.Lu priority: normal severity: normal status: open title: Dictionary iterator has no len() type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 16:13:54 2016 From: report at bugs.python.org (Jeremy Spiegel) Date: Sat, 16 Jul 2016 20:13:54 +0000 Subject: [New-bugs-announce] [issue27533] release GIL in nt._isdir Message-ID: <1468700034.79.0.260183682177.issue27533@psf.upfronthosting.co.za> New submission from Jeremy Spiegel: In Modules/posixmodule.c, the function os__isdir_impl calls GetFileAttributesA/GetFileAttributesW without releasing the GIL. This is problematic since it can result in disk or network I/O, depending on the filesystem. ---------- components: Library (Lib) files: _isdir.patch keywords: patch messages: 270583 nosy: jeremyspiegel priority: normal severity: normal status: open title: release GIL in nt._isdir Added file: http://bugs.python.org/file43755/_isdir.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 19:19:16 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 16 Jul 2016 23:19:16 +0000 Subject: [New-bugs-announce] [issue27534] IDLE: Reduce number and time for user process imports Message-ID: <1468711156.27.0.318866145341.issue27534@psf.upfronthosting.co.za> New submission from Terry J. Reedy: This issue continues #25507. I still want to reduce the number of modules imported when run.py starts a user process and the time they require. In the process, I expect to reduce the number of tkinter module imports that need to be reversed and thereby make parts of the #25507 fix unnecessary. "New changeset 93d325c64104 by Terry Jan Reedy in branch 'default': Issue #25507: Move 4 objects from pyshell to run and switch inports. https://hg.python.org/cpython/rev/93d325c64104" This commit for #25507 was not needed for the fix I eventually choose, but it reduced the size of sys.modules in the user process from 193 to 156. I have since determined that it reduced the time for startup imports on my machine from .45 to .25 seconds. I now regard it as the first patch for this issue. The attached file was explained in msg270522. This and similar refactorings should be done when or after I have otherwise revised the module and tests in question. For a Windows build of repository 3.6, importing tkinter into a fresh python process increases len(sys.modules) from 41 to 65. But run only imports tkinter so it can call _tkinter.tkapp().eval('update') in its interactive input loop. If other indirect imports were eliminated, I suspect _tkinter could be imported instead. ---------- assignee: terry.reedy components: IDLE files: run_autocomplete.diff keywords: patch messages: 270592 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: Reduce number and time for user process imports type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43759/run_autocomplete.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 21:53:43 2016 From: report at bugs.python.org (=?utf-8?b?0JDQu9C10LrRgdCw0L3QtNGAINCa0LDRgNC/0LjQvdGB0LrQuNC5?=) Date: Sun, 17 Jul 2016 01:53:43 +0000 Subject: [New-bugs-announce] [issue27535] Memory leaks when opening tons of files Message-ID: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> New submission from ????????? ??????????: Actually, this issue is related to the warning module. The test script creates a lot of files with different names and deletes them. On the first pass the scripts calls the `f.close()` method for every file. On the second it doesn't. As a result, on the first pass, the memory consumption is constant and is about 3.9 Mb for my environment. For the second pass, the memory consumption constantly grows up to 246 Mb for 1 million files. I.e. memory leak is about 254 bytes for every opened file. This happens because of warning about not closed files. The memory is consumed for storing all possible warning messages generated for different file names to prevent further warnings with the same messages. Which is not the case if we are always opening new files. While not calling f.close() **might** lead to memory issues, the warning which notifies about this **absolutely guaranteed** leads to memory issue. Although f.close() is highly recommended, this is still the issue for code which doesn't use it for some reasons and doesn't experience other problems with not closed files because files are actually always closed in IOBase.__del__. This issue was discovered in this report: https://github.com/python-pillow/Pillow/issues/2019 The best way to fix this is excluding file name from warning message. As a result, the message for every file will be the same and warnings registry will not grow. For now, the message looks like this: ./memory.py:23: ResourceWarning: unclosed file <_io.FileIO name='__999.tmp' mode='wb' closefd=True> open_files(number, close) It may looks like this: ./memory.py:23: ResourceWarning: unclosed file open_files(number, close) ---------- components: IO files: memory.py messages: 270600 nosy: ????????? ?????????? priority: normal severity: normal status: open title: Memory leaks when opening tons of files type: resource usage versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file43762/memory.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 16 23:04:17 2016 From: report at bugs.python.org (Louis Taylor) Date: Sun, 17 Jul 2016 03:04:17 +0000 Subject: [New-bugs-announce] [issue27536] Convert readme to markdown Message-ID: <1468724657.01.0.14643953429.issue27536@psf.upfronthosting.co.za> New submission from Louis Taylor: Since the move to github is happening, the readme should probably be changed to markdown in order to render nicer on the github web interface. Issue 27476 introduced a .github folder, so it seems that preemptive changes for the migration are okay. ---------- files: readme-to-markdown.patch keywords: patch messages: 270604 nosy: louis.taylor priority: normal severity: normal status: open title: Convert readme to markdown type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43763/readme-to-markdown.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 02:02:29 2016 From: report at bugs.python.org (pablo sacristan) Date: Sun, 17 Jul 2016 06:02:29 +0000 Subject: [New-bugs-announce] [issue27537] Segfault Via Resource Exhaustion Message-ID: <1468735349.04.0.416587593882.issue27537@psf.upfronthosting.co.za> New submission from pablo sacristan: The code is very simple: import sys sys.setrecursionlimit(1<<20) test=lambda test:test(test) test(test) It basically works by changing the recursion limit and then starting an infinite recursion, this quickly gives a segfault. This can be used to crash python. ---------- messages: 270611 nosy: pabstersac priority: normal severity: normal status: open title: Segfault Via Resource Exhaustion versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 02:16:53 2016 From: report at bugs.python.org (pablo sacristan) Date: Sun, 17 Jul 2016 06:16:53 +0000 Subject: [New-bugs-announce] [issue27538] Segfault on error in code object checking Message-ID: <1468736213.35.0.202003298623.issue27538@psf.upfronthosting.co.za> New submission from pablo sacristan: The code is also simple on this one: from types import CodeType as code exec code(0, 2, 3, 0, "lol lolol", (), (), (), "", "", 0, "") The interpreter isn't checking if the code object is correct, therefore it is possible to segfault by putting wrong opcodes and more. ---------- messages: 270612 nosy: pabstersac priority: normal severity: normal status: open title: Segfault on error in code object checking versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 03:32:11 2016 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 17 Jul 2016 07:32:11 +0000 Subject: [New-bugs-announce] [issue27539] negative Fraction ** negative int not normalized Message-ID: <1468740731.71.0.38394274484.issue27539@psf.upfronthosting.co.za> New submission from Vedran ?a?i?: I already wrote http://bugs.python.org/msg270548, but can't seem to reopen the issue, so I think the best thing is to report the bug separately. So, in issue http://bugs.python.org/issue21136, performance enhancement https://hg.python.org/cpython/rev/91d7fadac271/ enabled a shortcut for some operations (__pow__ among them) to avoid reducing the result to lowest terms if it can be concluded it's already reduced. However, the logic has a corner case that was handled incorrectly. If a negative Fraction is raised to a negative integer, the result is a Fraction with a negative denominator, which is not normalized and in fact breaks many other operations (which rightly assume their operands to be normalized). >>> import fractions >>> fractions.Fraction(-1, 2) ** -1 Fraction(2, -1) >>> _ == -2 False Of course, the easy fix would be to change line 52 of fractions.py to _normalize=True - but that would reintroduce the slowness talked about in http://bugs.python.org/issue21136#msg215409. Alternative fix is to branch depending on the sign of the base, which might be messy if we intend to be completely general -- for example, in finite quotient rings, fractions don't have well-defined signs. [BTW I'm not quite sure why the code in fractions.py is so general, with many weird cases trying to support every imaginable construction - maybe someone really wanted such a level of generality. I don't, so I'd be fine with this working only on ordinary int/int Fractions.] ---------- components: Library (Lib) messages: 270616 nosy: Vedran.?a?i? priority: normal severity: normal status: open title: negative Fraction ** negative int not normalized type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 04:43:32 2016 From: report at bugs.python.org (Armin Rigo) Date: Sun, 17 Jul 2016 08:43:32 +0000 Subject: [New-bugs-announce] [issue27540] msvcrt.ungetwch() calls _ungetch() Message-ID: <1468745012.08.0.321893951317.issue27540@psf.upfronthosting.co.za> New submission from Armin Rigo: In Python 2.7, PC/msvcrtmodule.c, the function msvcrt_ungetwch() calls _ungetch() instead of _ungetwch() as was probably intended. ---------- components: Extension Modules messages: 270620 nosy: arigo priority: normal severity: normal status: open title: msvcrt.ungetwch() calls _ungetch() type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 04:54:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 17 Jul 2016 08:54:36 +0000 Subject: [New-bugs-announce] [issue27541] Repr of collection's subclasses Message-ID: <1468745676.7.0.929499219743.issue27541@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The repr of subclasses of some collection classes contains a name of the subclass: >>> class S(set): pass ... >>> S([1, 2, 3]) S({1, 2, 3}) >>> import collections >>> class OD(collections.OrderedDict): pass ... >>> OD({1: 2}) OD([(1, 2)]) >>> class C(collections.Counter): pass ... >>> C('senselessness') C({'s': 6, 'e': 4, 'n': 2, 'l': 1}) But the repr of subclasses of some collection classes contains a name of the base class: >>> class BA(bytearray): pass ... >>> BA([1, 2, 3]) bytearray(b'\x01\x02\x03') >>> class D(collections.deque): pass ... >>> D([1, 2, 3]) deque([1, 2, 3]) >>> class DD(collections.defaultdict): pass ... >>> DD(int, {1: 2}) defaultdict(, {1: 2}) Shouldn't a name of the subclass always be used? ---------- components: Extension Modules, Interpreter Core messages: 270621 nosy: rhettinger, serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Repr of collection's subclasses type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 07:31:26 2016 From: report at bugs.python.org (Julien) Date: Sun, 17 Jul 2016 11:31:26 +0000 Subject: [New-bugs-announce] [issue27542] Segfault in gcmodule.c:360 visit_decref Message-ID: <1468755086.8.0.27245311458.issue27542@psf.upfronthosting.co.za> New submission from Julien: Was running `python -m pip install ansible` when I got a "segmentation fault". bt is: (gdb) bt #0 0x00000000004a7ec4 in visit_decref () at ../Modules/gcmodule.c:360 #1 0x00000000004a7fa9 in dict_traverse () at ../Objects/dictobject.c:2144 #2 0x00000000004a6f88 in subtract_refs () at ../Modules/gcmodule.c:385 #3 collect.lto_priv () at ../Modules/gcmodule.c:925 #4 0x0000000000500d2e in PyGC_Collect () at ../Modules/gcmodule.c:1440 #5 0x0000000000500184 in Py_Finalize () at ../Python/pythonrun.c:448 #6 0x0000000000525148 in Py_Exit (sts=0) at ../Python/pythonrun.c:1783 #7 0x0000000000522553 in handle_system_exit () at ../Python/pythonrun.c:1151 #8 0x0000000000521e46 in PyErr_PrintEx () at ../Python/pythonrun.c:1161 #9 0x0000000000520dc9 in RunModule.lto_priv.1258 () at ../Modules/main.c:194 #10 0x000000000049de26 in Py_Main () at ../Modules/main.c:587 #11 0x00007fddb03e25f0 in __libc_start_main (main=0x49d710
, argc=6, argv=0x7ffdfcb8cfe8, init=, fini=, rtld_fini=, stack_end=0x7ffdfcb8cfd8) at libc-start.c:291 #12 0x000000000049d639 in _start () Problem looks obvious: (gdb) p (((PyObject*)(op))->ob_type) $86202 = (struct _typeobject *) 0x0 But `subtract_refs()` from `Modules/gcmodule.c:385` is iterating a very long chained list, and I'm not sure it's of any help iterating over it. Can provide core dump if of any help. Python version: Python 2.7.12 PIP version: pip 8.1.2 from /usr/lib/python2.7/dist-packages (python 2.7) Looks reproductible: ``` $ python -m pip install --user ansible Collecting ansible Collecting jinja2 (from ansible) Using cached Jinja2-2.8-py2.py3-none-any.whl Collecting setuptools (from ansible) Using cached setuptools-24.0.3-py2.py3-none-any.whl Collecting PyYAML (from ansible) Collecting pycrypto>=2.6 (from ansible) Collecting paramiko (from ansible) Using cached paramiko-2.0.1-py2.py3-none-any.whl Collecting MarkupSafe (from jinja2->ansible) Collecting cryptography>=1.1 (from paramiko->ansible) Collecting pyasn1>=0.1.7 (from paramiko->ansible) Using cached pyasn1-0.1.9-py2.py3-none-any.whl Collecting enum34 (from cryptography>=1.1->paramiko->ansible) Using cached enum34-1.1.6-py2-none-any.whl Collecting idna>=2.0 (from cryptography>=1.1->paramiko->ansible) Using cached idna-2.1-py2.py3-none-any.whl Collecting cffi>=1.4.1 (from cryptography>=1.1->paramiko->ansible) Using cached cffi-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl Collecting ipaddress (from cryptography>=1.1->paramiko->ansible) Using cached ipaddress-1.0.16-py27-none-any.whl Collecting six>=1.4.1 (from cryptography>=1.1->paramiko->ansible) Using cached six-1.10.0-py2.py3-none-any.whl Collecting pycparser (from cffi>=1.4.1->cryptography>=1.1->paramiko->ansible) Installing collected packages: MarkupSafe, jinja2, setuptools, PyYAML, pycrypto, enum34, idna, pycparser, cffi, ipaddress, six, pyasn1, cryptography, paramiko, ansible Successfully installed MarkupSafe-0.23 PyYAML-3.11 ansible-2.1.0.0 cffi-1.7.0 cryptography-1.4 enum34-1.1.6 idna-2.1 ipaddress-1.0.16 jinja2-2.8 paramiko-2.0.1 pyasn1-0.1.9 pycparser-2.14 pycrypto-2.6.1 setuptools-24.0.3 six-1.10.0 Segmentation fault (core dumped) ``` I tried installing only a few packages to see if one in particular causes the bug and yes, cffi may be the one: ``` $ python -m pip install --user cffi Collecting cffi Using cached cffi-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl Collecting pycparser (from cffi) Installing collected packages: pycparser, cffi Successfully installed cffi-1.7.0 pycparser-2.14 Segmentation fault (core dumped) ``` But not pycparser alone: ``` $ python -m pip install --user pycparser Collecting pycparser Installing collected packages: pycparser Successfully installed pycparser-2.14 ``` ---------- components: Interpreter Core messages: 270633 nosy: sizeof priority: normal severity: normal status: open title: Segfault in gcmodule.c:360 visit_decref versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 14:14:01 2016 From: report at bugs.python.org (Marc) Date: Sun, 17 Jul 2016 18:14:01 +0000 Subject: [New-bugs-announce] [issue27543] from module import function creates package reference to the module Message-ID: <1468779241.06.0.301525903069.issue27543@psf.upfronthosting.co.za> New submission from Marc: Hello, I've found an issue in python 2.7 and 3.4 and I don't if this is a bug or a feature that acts strange to me. The import of a module or method from a module creates a reference in the package to that module only the first time, which could lead to unexpected behavior. Description: In following code there's one line marked with 'this line fixes the code to what I expected' 1. Without that line package.a.test() results in 'from module a' 2. With the line package.a.test() results in 'from module b' Situation 1 is unexpected because I did not create the reference to 'module a', python did that with the statement 'from package.a import test' and this will happen from any place in the code that loads 'module a' for the first time. The documentation says that this reference will not be created. Kind regards, Marc # FILES USED # # test.py # package # __init__.py # a.py # b.py # --------------------- # Content of a.py: def test(): print('from module a') # --------------------- # Content of a.py: def test(): print('from module b') # --------------------- # Content of __init__.py #import a # <--- this line fixes the code to what I expected import b as a from a import test # --------------------- # Content of test.py import package print(dir(package)) package.a.test() ---------- components: Interpreter Core messages: 270658 nosy: m.nijland priority: normal severity: normal status: open title: from module import function creates package reference to the module type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 21:25:16 2016 From: report at bugs.python.org (hannah) Date: Mon, 18 Jul 2016 01:25:16 +0000 Subject: [New-bugs-announce] [issue27544] Document checking dict types Message-ID: <1468805116.02.0.14575319212.issue27544@psf.upfronthosting.co.za> New submission from hannah: While there is documentation that dict.keys(), dict.values(), and dict.items() are now view objects(https://docs.python.org/3/library/stdtypes.html#dict-views), there's no mention dictviews, dict_keys, dict_values, and dict_items not being built-ins. This is confusing because type(dict.keys()) returns dict_keys, type(dict.values()) returns dict_values, etc., and the documentation uses `dictview` as the object signature, and so it's unclear how to do object introspection on dictview objects. The #python-dev channel suggested that the canonical way to do the object introspection is to use the collections.abc.mapview types; the documentation for dicts should reflect this (and that dictview and the rest are not __builtin__ types/in the python namspace). ---------- assignee: docs at python components: Documentation messages: 270672 nosy: docs at python, story645 priority: normal severity: normal status: open title: Document checking dict types type: enhancement versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 17 23:08:09 2016 From: report at bugs.python.org (Decorater) Date: Mon, 18 Jul 2016 03:08:09 +0000 Subject: [New-bugs-announce] [issue27545] missing pyshellext.vcxproj prevents puilding 3.6 Message-ID: <1468811289.51.0.698571569689.issue27545@psf.upfronthosting.co.za> New submission from Decorater: I have a issue with building 3.6 now since I got the last hg update it seems the github repo is broken too. This does need a fix. ---------- components: Build messages: 270677 nosy: Decorater priority: normal severity: normal status: open title: missing pyshellext.vcxproj prevents puilding 3.6 type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 00:10:10 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 18 Jul 2016 04:10:10 +0000 Subject: [New-bugs-announce] [issue27546] Integrate tkinter and asyncio (and async) Message-ID: <1468815010.57.0.709565417017.issue27546@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The last week of last February, there was a discussion of this topic on python-ideas as part of "How the heck does async/await work in Python 3.5". I would like to re-start the discussion along with rescuing the two big chunks of code that were posted. Guido, you said "it would be very useful to have an asyncio loop integrated with Tkinter". Were you thinking of something added to either the asyncio or tkinter modules? What would be the minimum that you think would be worth adding? What would a mininal test look like? There are, of course, multiple strategies. Maxime posted the code I copied into the attached tkselector.py. No example usage was given. I cannot run it on Windows because it uses a unix-only function. Maxime, for us to use this, you need to sign the contributor agreement, which can be done via the net. See https://www.python.org/psf/contrib/ As soon as I submit this, I will also upload my tkloop.py. It defines a TkEventLoop class that adds root.update in the run_forever method. It then uses the class for working example of a asyncio callback modifying a tk widget at times intervals. As I note in the doc string, there is an issue with asyncio's _run_once() blocking forever. I recently noticed that idlelib.run.main does something similar, running a loop that gets user input with 1/20 second timeout and calling tkapp.eval('update') whenever there is none. Motivations: 1. Mix gui events (key, mouse, and others) with i/o events. 2. Use gui events with the new async syntax. My simple example, in the callback typical of tkinter apps, has widgets, callback, and dynamics defined in different places. I would like to be able to write the app in a more 'natural' style, using loops: something like async def display_date(interval, end_time, loop=ai.get_event_loop()): label = tk.Label(root) label.pack() async for tick in timer(interval, end_time, loop): label['text'] = datetime.datetime.now() Some python-tkinter beginners try to do something like this, except that for time delays they use while and time.sleep. There have been many Stackoverflow questions about the resulting failures. I would like to find out if I presume that converting my example to something like the above, using TkEventLoop, could be done easily enough by someone who knows how. For only supporting tk events, it would be better to have a tkinter implementation of the needed subset of asyncio.events.AbstractEventLoop. The run and call methods are needed, the io methods not, but I am not sure where to draw the line in between. The implementation of a few methods should be fairly easy: run_forever is mainloop, close is destroy; run_until_complete will be harder. ---------- files: tkselector.py messages: 270688 nosy: Maxime S, gvanrossum, serhiy.storchaka, terry.reedy, yselivanov priority: normal severity: normal stage: test needed status: open title: Integrate tkinter and asyncio (and async) type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43769/tkselector.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 01:39:04 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 05:39:04 +0000 Subject: [New-bugs-announce] [issue27547] Integer Overflow Crash On float(array.array()) Message-ID: <1468820344.69.0.285015698444.issue27547@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow because python doesn't check the length as it does with bytearray() and it still goes on, so by doing something like: >>> import array >>> float(array.array("L",b"a"*0xFFFFFFFFFFFFFFF+100000**8000000000)) It returns: Python(2179,0x7fff7ad6a000) malloc: *** mach_vm_map(size=1152921504606851072) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug And then it just crashes Or you can skip the error and just do: >>> import array >>> float(array.array("L",b"a"*0xFFFFFFFFFFFFFFF**10000000000**80000000000000000)) That will just make python freeze until you restart it, which is as good as crashed. The file would be: import array float(array.array("L",b"a"*0xFFFFFFFFFFFFFFF**10000000000**80000000000000000)) Hope it helps ;) ---------- messages: 270700 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow Crash On float(array.array()) versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 01:54:55 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 05:54:55 +0000 Subject: [New-bugs-announce] [issue27548] Integer Overflow On bin() Message-ID: <1468821295.01.0.886780512463.issue27548@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow in bin() because python incorrectly checks the length of the input in bin(). bin(0xFFFFFFFFFFFFFFF+100000**8000000000) That line will freeze python until you restart it, which basically is a crash because python stops working completely. Hope it helps ;) ---------- messages: 270702 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow On bin() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 01:54:59 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 05:54:59 +0000 Subject: [New-bugs-announce] [issue27549] Integer Overflow Crash On bytearray() Message-ID: <1468821299.76.0.127950361859.issue27549@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow because python doesn't check the length correctly on bytearray: bytearray(0xFFFFFFFFFFFFFFF**10000000000**80000000000000000) That will not return an overflow message, and even though my hex knowledge is very bad I do believe 0xFFFFFFFFFFFFFFF**10000000000**80000000000000000 is more than 0xFFFFFFFFFFFFFFFF which does return a overflow message. Hope it helps ;) ---------- messages: 270703 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow Crash On bytearray() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 01:56:32 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 05:56:32 +0000 Subject: [New-bugs-announce] [issue27550] Integer Overflow Crash On Arithmetic Operations Message-ID: <1468821392.71.0.241203163582.issue27550@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow because python doesn't check the length correctly on arithmetic operations: 0xFFFFFFFFFFFFFFF**10000000000**80000000000000000 Just that line will freeze python, no oveflow message appears, no memory error, and python basically crashes because it just stops working. Hope it helps ;) ---------- messages: 270704 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow Crash On Arithmetic Operations versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 01:56:39 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 05:56:39 +0000 Subject: [New-bugs-announce] [issue27551] Integer Overflow On print() Message-ID: <1468821399.2.0.180204407388.issue27551@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow because python doesn't check the length correctly on print() statements: print(0xFFFFFFFFFFFFFFF**10000000000**80000000000000000) That will overflow and python would stop working, so it would be as good as crashed :) Hope it helps ;) ---------- messages: 270705 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow On print() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:02:39 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:02:39 +0000 Subject: [New-bugs-announce] [issue27552] Integer Overflow On min() Message-ID: <1468821759.48.0.396391812874.issue27552@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow on min() statements because python incorrectly checks the length to put the overflow message, so it is possible to overflow min() min(0xFFFFFFFFFFFFFFF+100000**8000000000) That line freezes python until you restart it, which is basically as if you were crashing it, the effect is the same, python stops working. Hope it helps ;) ---------- messages: 270706 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow On min() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:04:24 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:04:24 +0000 Subject: [New-bugs-announce] [issue27553] Integer Overflow On unicode() Message-ID: <1468821864.13.0.013612270682.issue27553@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow in unicode() because python incorrectly checks the length of unicode(): unicode(0xFFFFFFFFFFFFFFF+100000**8000000000) That freezes python until you restart it which is basically the same effect as crashing python. Hope it helps ;) ---------- messages: 270707 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow On unicode() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:05:41 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:05:41 +0000 Subject: [New-bugs-announce] [issue27554] Integer Overflow On dir() Message-ID: <1468821941.88.0.767862457306.issue27554@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow in dir(): dir(0xFFFFFFFFFFFFFFF+100000**8000000000) That line will freeze python until you restart it, which makes it have the same effect as a crash. Hope it helps ;) ---------- messages: 270708 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow On dir() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:11:29 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:11:29 +0000 Subject: [New-bugs-announce] [issue27555] Integer Overflow on oct() Message-ID: <1468822289.98.0.19542711871.issue27555@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow on oct() because of incorrectly checking the length. oct(0xFFFFFFFFFFFFFFF+100000**8000000000) That line will freeze python until you restart it, which is as good as crashed. Hope it helps ;) ---------- messages: 270709 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow on oct() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:14:00 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:14:00 +0000 Subject: [New-bugs-announce] [issue27556] Integer overflow on hex() Message-ID: <1468822440.54.0.519269097524.issue27556@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow on hex() because python incorrectly checks the length of the value to return overflow message if it were too big. hex(0xFFFFFFFFFFFFFFF+100000**8000000000) That line will freeze python until you restart it, which is the same thing as crashing python. Hope it helps ;) ---------- messages: 270710 nosy: pabstersac priority: normal severity: normal status: open title: Integer overflow on hex() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:21:48 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 06:21:48 +0000 Subject: [New-bugs-announce] [issue27557] Integer Overflow on int() Message-ID: <1468822908.93.0.0686992762741.issue27557@psf.upfronthosting.co.za> New submission from pablo sacristan: There is an integer overflow on int() because python incorrectly checks the length of the input. int(0xFFFFFFFFFFFFFFF+100000**8000000000) That line of code will freeze python until you restart it, which is as annoying as if python had crashed. Hope it helps ;) ---------- messages: 270711 nosy: pabstersac priority: normal severity: normal status: open title: Integer Overflow on int() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 02:26:43 2016 From: report at bugs.python.org (Romuald Brunet) Date: Mon, 18 Jul 2016 06:26:43 +0000 Subject: [New-bugs-announce] [issue27558] SystemError inside multiprocessing.dummy Pool.map Message-ID: <1468823203.61.0.708048243679.issue27558@psf.upfronthosting.co.za> New submission from Romuald Brunet: Raising without a previous exception inside a method called from multiprocessing.dummy.Pool.map will trigger a SystemError. SystemError: PyEval_EvalFrameEx returned NULL without setting an error Traceback (most recent call last): File "example.py", line 16, in main() File "example.py", line 11, in main result = pool.map(test, [1]) File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/multiprocessing/pool.py", line 260, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/multiprocessing/pool.py", line 608, in get raise self._value File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar return list(map(*args)) SystemError: PyEval_EvalFrameEx returned NULL without setting an error Reproducible example is attached ---------- components: Interpreter Core files: example.py messages: 270713 nosy: Romuald priority: normal severity: normal status: open title: SystemError inside multiprocessing.dummy Pool.map type: behavior versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file43772/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 05:08:05 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 09:08:05 +0000 Subject: [New-bugs-announce] [issue27559] Crash On bytearray() Message-ID: <1468832885.3.0.732999083359.issue27559@psf.upfronthosting.co.za> New submission from pablo sacristan: There is a crash on bytearray(), not really a crash but rather the process gets killed by the kernel, but that is a crash, and the keyboard interrupt stops working while bytearray is working, so you can either restart python or wait for python to get killed by the kernel. The biggest problem is that while bytearray() is trying to do something, you can't interrupt it just doesn't work for some reason. This should be enough for bytearray to crash : bytearray(0xFFFFFFFFFF) It crashes after some time with a Killed: 9 error. Hope it helps ;) ---------- messages: 270731 nosy: pabstersac priority: normal severity: normal status: open title: Crash On bytearray() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 05:08:54 2016 From: report at bugs.python.org (pablo sacristan) Date: Mon, 18 Jul 2016 09:08:54 +0000 Subject: [New-bugs-announce] [issue27560] zlib.compress() crash and keyboard interrupt stops working Message-ID: <1468832934.6.0.711776862351.issue27560@psf.upfronthosting.co.za> New submission from pablo sacristan: zlib.compress crashes when you put a lot of stuff into it and even when you try keyboard interrupts it doesn't work for some reason, and Python gets killed because trying to compress so much data gets the Python process get killed by the kernel. If you put a large amount of data in it will get killed quicker. A problem is that keyboard interrupts stop working while the program is running, which is usually around 5 - 15 seconds during which python stops working (including interrupts) until it gets killed by the kernel. This may be used to crash python remotely if a server takes user input and runs it through zlib.compress(b'variable' * 2**32) which is not very likely. You probably should set a limit for what you compress and how much it is. The output is: Killed: 9 Even though you try doing keyboard interrupt it doesn't work. ---------- files: crash.py messages: 270732 nosy: pabstersac priority: normal severity: normal status: open title: zlib.compress() crash and keyboard interrupt stops working Added file: http://bugs.python.org/file43774/crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 09:30:51 2016 From: report at bugs.python.org (Kirk Hansen) Date: Mon, 18 Jul 2016 13:30:51 +0000 Subject: [New-bugs-announce] [issue27561] Warn against subclassing builtins, and overriding their methods Message-ID: <1468848651.49.0.804648096873.issue27561@psf.upfronthosting.co.za> New submission from Kirk Hansen: I tried subclassing dict, and overriding its __setitem__ and __getitem__ and got some interesting results. See http://stackoverflow.com/questions/38362420/subclassing-dict-dict-update-returns-incorrrect-value-python-bug?noredirect=1#comment64142710_38362420 for an example. I tried sub-classing UserDict.UserDict and experienced some of the same problems. Eventually, I discovered that subclassing MutableMapping was my best bet. After an hour or two of searching and reading I discovered that CPython will not call overridden built-in methods of the same object (https://pypy.readthedocs.io/en/latest/cpython_differences.html#subclasses-of-built-in-types). This behaviour could (and did) cause some hard to track down bugs in code. I briefly looked at the later versions of python documentation and didn't see a mention of this (sorry if it's there), but python2.7 definitely does not mention this. In fact, python2.7 seems to __encourage__ users to subclass the built-ins (see the note https://docs.python.org/2.7/library/stdtypes.html?highlight=dict#built-in-types). Subclassing dict to __extend__ functionality is great, but there should be a big bad warning when trying to __override__ built-ins like __setitem__ and __getitem__. ---------- assignee: docs at python components: Documentation messages: 270754 nosy: Kirk Hansen, docs at python priority: normal severity: normal status: open title: Warn against subclassing builtins, and overriding their methods type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 09:48:21 2016 From: report at bugs.python.org (Iovan Irinel) Date: Mon, 18 Jul 2016 13:48:21 +0000 Subject: [New-bugs-announce] [issue27562] Import error encodings (Windows xp compatibility) Message-ID: <1468849701.41.0.980015051967.issue27562@psf.upfronthosting.co.za> New submission from Iovan Irinel: I have python embeded intro my application. I wanted to upgrade to python 2.7.12 i use also a static library. Not DLL. I have defined "Py_NO_ENABLE_SHARE" Ok, all work fine with 2.7.6 I want to say this error happen just when i run it under windows xp. Under windows 10 it works , my application start.. Pythoncore and application is build with v140_xp toolset i user visual studio 2015. I can make a video with error if is necessary. Thanks. Traceback (most recent call last): File "Lib/site.py", line 548, in File "Lib/site.py", line 537, in main File "Lib/site.py", line 465, in aliasmbcs File "Lib/locale.py", line 13, in ImportError: No module named encodings I made more test and i come with a reply. ---------- components: Windows messages: 270756 nosy: Iovan Irinel, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Import error encodings (Windows xp compatibility) versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 10:27:43 2016 From: report at bugs.python.org (Ram Rachum) Date: Mon, 18 Jul 2016 14:27:43 +0000 Subject: [New-bugs-announce] [issue27563] docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean) Message-ID: <1468852063.19.0.0147283697672.issue27563@psf.upfronthosting.co.za> Changes by Ram Rachum : ---------- assignee: docs at python components: Documentation nosy: cool-RR, docs at python priority: normal severity: normal status: open title: docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean) versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 11:29:06 2016 From: report at bugs.python.org (Tom Middleton) Date: Mon, 18 Jul 2016 15:29:06 +0000 Subject: [New-bugs-announce] [issue27564] 2.7.12 Windows Installer package broken. Message-ID: <1468855746.01.0.612957751077.issue27564@psf.upfronthosting.co.za> New submission from Tom Middleton: I was running: Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. I downloaded the msi for Python 2.7.12 and attempted to run it. During the installation it gave me the following error: "There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor." Then it "rolls back" the action, which killed my current 2.7.11 installation. Despite that it states: "Python 2.7.12 setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again." (pardon any typos in the error messages since I wasn't able to copy the text directly.) I attempted this twice with the same result. Thanks, Tom ---------- components: Installation messages: 270762 nosy: busfault priority: normal severity: normal status: open title: 2.7.12 Windows Installer package broken. type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 15:31:04 2016 From: report at bugs.python.org (Claudiu Saftoiu) Date: Mon, 18 Jul 2016 19:31:04 +0000 Subject: [New-bugs-announce] [issue27565] Offer error context manager for code.interact Message-ID: <1468870264.4.0.689422874662.issue27565@psf.upfronthosting.co.za> New submission from Claudiu Saftoiu: When debugging code that raises unexpected exceptions, I often find myself doing this: try: some_code except: import code; code.interact(local=locals()) raise My suggestion is a context manager to make this less verbose: with code.interact_on_error(): some_code The effect would be the same: if an exception is caught, `code.interact` is called with the locals of the function, and re-raised when `code.interact` ends. ---------- components: Library (Lib) messages: 270786 nosy: Claudiu Saftoiu priority: normal severity: normal status: open title: Offer error context manager for code.interact type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 15:50:39 2016 From: report at bugs.python.org (David D) Date: Mon, 18 Jul 2016 19:50:39 +0000 Subject: [New-bugs-announce] [issue27566] Freeze: winmakemakefile.py: clean: Linux instead of Windows command Message-ID: <1468871439.96.0.540268707664.issue27566@psf.upfronthosting.co.za> New submission from David D: The command for the clean target in the Windows makefile is the same as the one in the Linux one: using `rm -f`. Should be changed to `del /f` or `erase /f`. ---------- components: Demos and Tools, Windows messages: 270787 nosy: David D, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Freeze: winmakemakefile.py: clean: Linux instead of Windows command type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 16:00:36 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 18 Jul 2016 20:00:36 +0000 Subject: [New-bugs-announce] [issue27567] Add constants EPOLLRDHUP and EPOLLHUP to module select. Message-ID: <1468872036.69.0.576706331519.issue27567@psf.upfronthosting.co.za> New submission from ???? ?????????: These constants are supported since Linux kernel 2.6.17 ---------- messages: 270788 nosy: mmarkk priority: normal severity: normal status: open title: Add constants EPOLLRDHUP and EPOLLHUP to module select. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 18:30:13 2016 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Rampin?=) Date: Mon, 18 Jul 2016 22:30:13 +0000 Subject: [New-bugs-announce] [issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts Message-ID: <1468881013.81.0.152859673137.issue27568@psf.upfronthosting.co.za> New submission from R?mi Rampin: https://httpoxy.org/ It is possible to set the HTTP_PROXY in CGI scripts by passing the Proxy header. If the script is a Python script and downloads files, urllib will happily use the attacker-supplied proxy to make requests. This should be mitigated like it is in Perl (since 2001), Ruby, and libraries like curl. See also: bug against python-requests https://github.com/kennethreitz/requests/issues/3422 ---------- components: Library (Lib) messages: 270795 nosy: remram priority: normal severity: normal status: open title: "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 21:47:21 2016 From: report at bugs.python.org (Ricardo Esperanza) Date: Tue, 19 Jul 2016 01:47:21 +0000 Subject: [New-bugs-announce] [issue27569] Windows install problems Message-ID: <1468892841.27.0.521360350751.issue27569@psf.upfronthosting.co.za> New submission from Ricardo Esperanza: Downloaded 3.5.2 package and recived following errors during install also tried with 3.6 version and got same errors Using Win 10 X64 attached complete log [13A0:26B4][2016-07-18T22:40:59]i305: Verified acquired payload: exe_JustForMe at path: C:\Users\Ricardo\AppData\Local\Package Cache\.unverified\exe_JustForMe, moving to: C:\Users\Ricardo\AppData\Local\Package Cache\{33B10015-A9B1-4210-B50A-26C6443979B0}v3.5.2150.0\exe.msi. [13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to install MSI package. [13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to configure per-user MSI package. [13A0:0EE0][2016-07-18T22:40:59]i319: Applied execute package: core_JustForMe, result: 0x80070643, restart: None [13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to execute MSI package. [13A0:0EE0][2016-07-18T22:40:59]i318: Skipped rollback of package: core_JustForMe, action: Uninstall, already: Absent ---------- components: Installation files: Python 3.5.2 (32-bit)_20160718224049.log messages: 270801 nosy: ricardoe priority: normal severity: normal status: open title: Windows install problems versions: Python 3.5 Added file: http://bugs.python.org/file43782/Python 3.5.2 (32-bit)_20160718224049.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 18 22:57:10 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 19 Jul 2016 02:57:10 +0000 Subject: [New-bugs-announce] [issue27570] Avoid memcpy(. . ., NULL, 0) etc calls Message-ID: <1468897030.77.0.552858173381.issue27570@psf.upfronthosting.co.za> New submission from Martin Panter: This patch fixes errors reported by GCC?s undefined behaviour sanitizer about calling functions with a null pointer: ./configure CC="gcc -fsanitize=undefined" Using Issue 22605 as a precedent, I propose to avoid calling memcpy() and memmove() for zero-length copies when there may be a null pointer. ---------- components: Interpreter Core, ctypes files: memcpy-null.patch keywords: patch messages: 270806 nosy: martin.panter priority: normal severity: normal stage: patch review status: open title: Avoid memcpy(. . ., NULL, 0) etc calls type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43784/memcpy-null.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 03:03:03 2016 From: report at bugs.python.org (Decorater) Date: Tue, 19 Jul 2016 07:03:03 +0000 Subject: [New-bugs-announce] [issue27571] 3.6 Seems to be ignoring all pyd's installed and compiled by pip Message-ID: <1468911783.53.0.349371581627.issue27571@psf.upfronthosting.co.za> New submission from Decorater: in 3.5 the following would succed: >>>import nacl._sodium None but in 3.6 (I even compiled it for 3.6 specifically) this happens: >>>import nacl._sodium Traceback (most recent call last): import nacl._sodium ImportError: No module named 'nacl._sodium' ---------- messages: 270815 nosy: Decorater priority: normal severity: normal status: open title: 3.6 Seems to be ignoring all pyd's installed and compiled by pip versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 04:56:16 2016 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 19 Jul 2016 08:56:16 +0000 Subject: [New-bugs-announce] [issue27572] Support bytes-like objects when base is given to int() Message-ID: <1468918576.73.0.596747914515.issue27572@psf.upfronthosting.co.za> New submission from Xiang Zhang: Right now, int() supports bytes-like objects when *base* is not given: >>> int(memoryview(b'100')) 100 When *base* is given bytes-like objects are not supported: >>> int(memoryview(b'100'), base=2) Traceback (most recent call last): File "", line 1, in TypeError: int() can't convert non-string with explicit base Is there any obvious reason not to support it when *base* is given? I suggest add it. ---------- components: Interpreter Core files: bytes_like_support_to_int.patch keywords: patch messages: 270818 nosy: martin.panter, xiang.zhang priority: normal severity: normal status: open title: Support bytes-like objects when base is given to int() versions: Python 3.6 Added file: http://bugs.python.org/file43789/bytes_like_support_to_int.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 08:55:40 2016 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 19 Jul 2016 12:55:40 +0000 Subject: [New-bugs-announce] [issue27573] code.interact() should print an exit message Message-ID: <1468932940.76.0.523388198835.issue27573@psf.upfronthosting.co.za> New submission from Steven D'Aprano: Way too often I've lost track of whether I'm in the code.interact() REPL or the original REPL, or hit Ctrl-D once too often, and accidentally quit the real REPL. It is easy to lose track, since the real and imitation REPL both use the same prompts. It would be useful if code.interact() and the InteractiveConsole printed a message when they exited. ---------- components: Library (Lib) files: code.patch keywords: patch messages: 270822 nosy: steven.daprano priority: normal severity: normal status: open title: code.interact() should print an exit message type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43791/code.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 12:03:55 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 19 Jul 2016 16:03:55 +0000 Subject: [New-bugs-announce] [issue27574] Faster parsing keyword arguments Message-ID: <1468944235.85.0.107735525995.issue27574@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Parsing keyword arguments is much more slow than parsing positional arguments. Parsing time can be larger that useful execution time. $ ./python -m timeit "b'a:b:c'.split(b':', 1)" 1000000 loops, best of 3: 0.638 usec per loop $ ./python -m timeit "b'a:b:c'.split(b':', maxsplit=1)" 1000000 loops, best of 3: 1.64 usec per loop The main culprit is that Python strings are created for every keyword name on every call. Proposed patch adds alternative API that caches keyword names as Python strings in special object. Argument Clinic is changed to use this API in generated file. An effect of the optimization: $ ./python -m timeit "b'a:b:c'.split(b':', maxsplit=1)" 1000000 loops, best of 3: 0.826 usec per loop Invocations of PyArg_ParseTupleAndKeywords() in non-generated code are kept, since API is not stable yet. Later I'm going to cache parsed format strings and speed up parsing positional arguments too. ---------- components: Interpreter Core files: faster_keyword_args_parse.patch keywords: patch messages: 270832 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Faster parsing keyword arguments type: performance versions: Python 3.6 Added file: http://bugs.python.org/file43794/faster_keyword_args_parse.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 13:51:47 2016 From: report at bugs.python.org (David Su) Date: Tue, 19 Jul 2016 17:51:47 +0000 Subject: [New-bugs-announce] [issue27575] dict viewkeys intersection slow for large dicts Message-ID: <1468950707.74.0.640405379684.issue27575@psf.upfronthosting.co.za> New submission from David Su: In dictobject.c, the function dictviews_and performs a very expensive set creation operation on the keys of the self dict object: >From Python 2.7: ... static PyObject* dictviews_and(PyObject* self, PyObject *other) { PyObject *result = PySet_New(self); ... tmp = PyObject_CallMethod(result, "intersection_update", "(O)", other); ... Similar logic can be found in the Python 3 code as well. For large dicts (~10 000 000 keys), it takes a significant amount of time to copy the keys into a new set, and also wastes a lot of memory. This issue is amplified when the intersection operation is performed many times. This implementation uses O(len(self)) time and space, while it is expected to use O(min(len(self), len(other)) time and space. Solution 1: Manually copy the keys of the dict into a set, and perform all intersection operations on that set. However, still wastes lots of memory. Solution 2 (Recommended): Port the intersection logic from the set class to the dict view class. ---------- components: Library (Lib) messages: 270836 nosy: David Su2 priority: normal severity: normal status: open title: dict viewkeys intersection slow for large dicts type: performance versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 19 17:01:30 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 19 Jul 2016 21:01:30 +0000 Subject: [New-bugs-announce] [issue27576] An unexpected difference between dict and OrderedDict Message-ID: <1468962090.7.0.636707577928.issue27576@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: Consider the following code: $ cat x.py from collections import OrderedDict class X: def items(self): print('items') return [] def keys(self): print('keys') return [] print(dict(X())) print(OrderedDict(X())) When I run it under python 3.4, I get $ python3.4 x.py keys {} keys OrderedDict() but under python 3.5, I get $ python3.5 x.py keys {} items OrderedDict() Under 3.4 both dict and OrderedDict constructors call the keys() method of the underlying object (and then call __getitem__ repeatedly if keys() returns a non-empty list), but in 3.5 OrderedDict behavior changed and it calls the values() method instead. ---------- keywords: 3.4regression messages: 270842 nosy: belopolsky priority: normal severity: normal status: open title: An unexpected difference between dict and OrderedDict type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 20 04:17:22 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 20 Jul 2016 08:17:22 +0000 Subject: [New-bugs-announce] [issue27577] tuple and list parameter name conflicts between doc and implementation Message-ID: <1469002642.37.0.996165914529.issue27577@psf.upfronthosting.co.za> New submission from Xiang Zhang: For tuple and list, their signatures are tuple([iterable]) and list([iterable]). But actually they support keyword argument *sequence*. The parameter names in doc are sometimes just placeholders but sometimes are real parameter names. So I suggest make the implementation and doc more compliant. One method is make the parameter name in implementation *iterable*. The other is totally suppress keyword argument since it is never documented. This is not a necessary change but I think the compliment is not a bad idea. ---------- components: Interpreter Core messages: 270858 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: tuple and list parameter name conflicts between doc and implementation type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 20 08:05:58 2016 From: report at bugs.python.org (Alexander Todorov) Date: Wed, 20 Jul 2016 12:05:58 +0000 Subject: [New-bugs-announce] [issue27578] inspect.findsource raises exception with empty __init__.py Message-ID: <1469016358.37.0.125453636257.issue27578@psf.upfronthosting.co.za> New submission from Alexander Todorov: $ python2 Python 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> from pykickstart import handlers >>> inspect.getsource(handlers) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.7/inspect.py", line 701, in getsource lines, lnum = getsourcelines(object) File "/usr/lib64/python2.7/inspect.py", line 690, in getsourcelines lines, lnum = findsource(object) File "/usr/lib64/python2.7/inspect.py", line 538, in findsource raise IOError('could not get source code') IOError: could not get source code >>> There is a `pykickstart/handlers/__init__.py` file which is empty and the above import works fine as you can see. However `inspect.findsource` raises an exception. The same problem exists in Python 3.5 as well. The error comes from here: 532 module = getmodule(object, file) 533 if module: 534 lines = linecache.getlines(file, module.__dict__) 535 else: 536 lines = linecache.getlines(file) 537 if not lines: 538 raise IOError('could not get source code') At this point `lines` is an empty list and we raise the exception. I'm hitting this problem when using a mutation testing tool that relies on getsource (which calls findsource). One possible workaround is to add a comment in the __init__.py file and everything seems to be working then. Another one is to patch the tool I'm using to take into account empty __init__.py files. ---------- components: Library (Lib) messages: 270867 nosy: Alexander Todorov priority: normal severity: normal status: open title: inspect.findsource raises exception with empty __init__.py type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 20 10:42:29 2016 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 20 Jul 2016 14:42:29 +0000 Subject: [New-bugs-announce] [issue27579] Add a tutorial for AsyncIO in the documentation Message-ID: <1469025749.21.0.829921979586.issue27579@psf.upfronthosting.co.za> New submission from St?phane Wirtel: The documentation of AsyncIO is well written for a developer, but it's a reference. We have the description of all the methods, classes, etc... But we want to learn to develop with AsyncIO, it's difficult, because there is no many examples in this reference and we have to look for some examples on Internet. Could we add a AsyncIO tutorial|cookbook|howto ? because we have a "Logging Cookbook" but not a "AsyncIO 101". Thank you Stephane ---------- assignee: docs at python components: Documentation messages: 270876 nosy: asvetlov, docs at python, haypo, matrixise, yselivanov priority: normal severity: normal status: open title: Add a tutorial for AsyncIO in the documentation versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 01:02:48 2016 From: report at bugs.python.org (Bobby Ocean) Date: Thu, 21 Jul 2016 05:02:48 +0000 Subject: [New-bugs-announce] [issue27580] CSV Null Byte Error Message-ID: <1469077368.13.0.160030895608.issue27580@psf.upfronthosting.co.za> New submission from Bobby Ocean: I think this has been asked before, but it has been awhile and I think needs to be re-addressed. Why doesn't the CSV module handle NULL bytes? Let me do some examples, ascii = [chr(n) for n in range(256)] #No errors print(ascii) #No errors print(dict(zip(ascii,ascii))) #No errors open('temp','r').writelines(ascii) #No errors f=open('temp','r') for line in f: print(line) #No errors f.close() Python hsndles every ascii chr, DEL, ESC, RETURN, etc. It displays those characters, uses them as keys or values, etc. But now try, import csv data = csv.DictReader(ascii) for line in data: print(line) #NULL Byte Error But we can quick fix this easily, ascii.pop(0) data = csv.DictReader(ascii) for line in data: print(line) #No Errors Doesn't it seem odd that we allow the use of every chr as keys, vslues, prints, etc. but then we hold a special exception for using the csv module and yhat special exception is not the ESC or DEL or any other non-printable chr, the exception is for the NULL? ---------- components: Extension Modules messages: 270908 nosy: bobbyocean priority: normal severity: normal status: open title: CSV Null Byte Error type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 01:36:48 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 21 Jul 2016 05:36:48 +0000 Subject: [New-bugs-announce] [issue27581] Fix overflow check in PySequence_Tuple Message-ID: <1469079408.21.0.622161481276.issue27581@psf.upfronthosting.co.za> New submission from Xiang Zhang: Overflow check in PySequence_Tuple relies on undefined behaviour, fix it. ---------- components: Interpreter Core files: overflow_check_in_PySequence_Tuple.patch keywords: patch messages: 270909 nosy: martin.panter, serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Fix overflow check in PySequence_Tuple type: enhancement versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43806/overflow_check_in_PySequence_Tuple.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 07:54:14 2016 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 21 Jul 2016 11:54:14 +0000 Subject: [New-bugs-announce] [issue27582] Mispositioned SyntaxError caret for unknown code points Message-ID: <1469102054.52.0.839726574023.issue27582@psf.upfronthosting.co.za> New submission from Nick Coghlan: Reporting by Rustom Mody on python-ideas, the SyntaxError caret is confusingly mispositioned when an invalid Unicode codepoint appears as part of a larger sequence of invalid codepoints and/or valid identifier characters: >>> varname = ?d?a?t?apoint File "", line 1 varname = ?d?a?t?apoint ^ SyntaxError: invalid character in identifier >>> varname = ?d?a?t?apoint.evidence File "", line 1 varname = ?d?a?t?apoint.evidence ^ SyntaxError: invalid character in identifier >>> varname = ?d?a?t?apoint[evidence] File "", line 1 varname = ?d?a?t?apoint[evidence] ^ SyntaxError: invalid character in identifier >>> varname = ?d?a?t?apoint(evidence) File "", line 1 varname = ?d?a?t?apoint(evidence) ^ SyntaxError: invalid character in identifier If the invalid character is a non-identifiers ASCII character, the error message loses the trailing "in identifier" phrase and points to the correct place: >>> varname = $d$a$t$apoint File "", line 1 varname = $d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = d$a$t$apoint File "", line 1 varname = d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = ^d$a$t$apoint File "", line 1 varname = ^d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = !d$a$t$apoint File "", line 1 varname = !d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = `d$a$t$apoint File "", line 1 varname = `d$a$t$apoint ^ SyntaxError: invalid syntax ---------- messages: 270914 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Mispositioned SyntaxError caret for unknown code points type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 08:54:13 2016 From: report at bugs.python.org (rk) Date: Thu, 21 Jul 2016 12:54:13 +0000 Subject: [New-bugs-announce] [issue27583] configparser: modifying default_section at runtime Message-ID: <1469105653.63.0.572086425799.issue27583@psf.upfronthosting.co.za> New submission from rk: Modifying "default_section" in the configparser at runtime does not behave as described. The documentation says about default_section: When default_section is given, it specifies the name for the special section holding default values for other sections and interpolation purposes (normally named "DEFAULT"). This value can be retrieved and changed on runtime using the default_section instance attribute. [https://docs.python.org/3/library/configparser.html] So, if I modify default_section at runtime, the default values for other sections should then come from the new default_section. But this is not the case. Instead, the default-values still come from self._default, which was set by self._read. So, this is either a bug in the library or a bug in the documentation. I've attached a testcase. ---------- components: Library (Lib) files: bug_configparser_default_section.py messages: 270918 nosy: rk priority: normal severity: normal status: open title: configparser: modifying default_section at runtime type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43808/bug_configparser_default_section.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 11:36:30 2016 From: report at bugs.python.org (Cathy Avery) Date: Thu, 21 Jul 2016 15:36:30 +0000 Subject: [New-bugs-announce] [issue27584] New addition of vSockets to the python socket module Message-ID: <1469115390.74.0.838831983223.issue27584@psf.upfronthosting.co.za> New submission from Cathy Avery: I have added AF_VSOCK support to python's 3.6 socket module ( socketmodule.c socketmodule.h cloned from https://hg.python.org/cpython ). The implementation is very similar to AF_NETLINK. AF_VSOCK requires the VMware-specific VMCI transport which is currently upstream or the virtio-vsock drivers developed by Stefan Hajnoczi at Red Hat. The virtio-vsock drivers are not upstream yet but more information with source and build instructions can be found at http://qemu-project.org/Features/VirtioVsock. More information on vSocket programming can be found at https://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/ws9_esx60_vmci_sockets.pdf The VMCI transport supports SOCK_DGRAM and SOCK_STREAM on both Linux and Windows. Virtio-vsock currently supports SOCK_STREAM only on Linux. My python addition supports SOCK_STREAM and SOCK_DGRAM calls on Linux only. I have tested my implementation on both driver sets on Linux. Attached is a diff file so you can see which files I've modified. These include a new configure.ac. I have already tested the new file generation by running autoreconf. Also included in the patch is an updated socket.rst file however I could not get the final html page to be double spaced. ---------- components: Library (Lib) files: vsocket.patch hgrepos: 349 keywords: patch messages: 270935 nosy: Cathy Avery, gregory.p.smith priority: normal severity: normal status: open title: New addition of vSockets to the python socket module type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43816/vsocket.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 13:06:41 2016 From: report at bugs.python.org (sss) Date: Thu, 21 Jul 2016 17:06:41 +0000 Subject: [New-bugs-announce] [issue27585] asyncio.Lock deadlock after cancellation Message-ID: <1469120801.4.0.62510822161.issue27585@psf.upfronthosting.co.za> New submission from sss: The lock.py file prints DEADLOCK HERE _locked: False _waiters: deque([]) I think the problem is that acquire() will block because of the cancelled future in _waiters, but release() has already ran so no one will wake it up. ---------- components: asyncio files: lock.py messages: 270944 nosy: gvanrossum, haypo, sss, yselivanov priority: normal severity: normal status: open title: asyncio.Lock deadlock after cancellation versions: Python 3.5 Added file: http://bugs.python.org/file43820/lock.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 21 17:03:42 2016 From: report at bugs.python.org (Bruce Eckel) Date: Thu, 21 Jul 2016 21:03:42 +0000 Subject: [New-bugs-announce] [issue27586] Is this a regular expression library bug? Message-ID: <1469135022.02.0.0194014811902.issue27586@psf.upfronthosting.co.za> New submission from Bruce Eckel: This looks suspicious to me, like it could be a library bug, but before chasing it down I was hoping someone might be able to tell me whether I might be on to something: Traceback (most recent call last): File "update_extracted_example_output.py", line 22, in new_javatext = find_output.sub(new_output, javatext) File "C:\Python35\lib\re.py", line 325, in _subx template = _compile_repl(template, pattern) File "C:\Python35\lib\re.py", line 312, in _compile_repl p = sre_parse.parse_template(repl, pattern) File "C:\Python35\lib\sre_parse.py", line 872, in parse_template raise s.error("missing <") sre_constants.error: missing < at position 100 (line 4, column 41) ---------- components: Library (Lib) messages: 270956 nosy: Bruce Eckel priority: normal severity: normal status: open title: Is this a regular expression library bug? type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 03:22:12 2016 From: report at bugs.python.org (Pavel Belikov) Date: Fri, 22 Jul 2016 07:22:12 +0000 Subject: [New-bugs-announce] [issue27587] Issues, reported by PVS-Studio static analyzer Message-ID: <1469172132.31.0.293406285451.issue27587@psf.upfronthosting.co.za> New submission from Pavel Belikov: To demonstrate the capabilities of our analyzer, we regularly perform analysis of open source projects. We had recently checked the CPython project. Here is the link to the article about it: http://www.viva64.com/en/b/0414/ Official page of the analyzer: http://www.viva64.com/en/pvs-studio/ If you have any questions, or if you are interested in the evaluation of our static analyzer or in any other source code quality control services that our company provides, please contact us at support at viva64.com. ---------- messages: 270974 nosy: pavel-belikov priority: normal severity: normal status: open title: Issues, reported by PVS-Studio static analyzer type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 05:50:51 2016 From: report at bugs.python.org (Gareth Rees) Date: Fri, 22 Jul 2016 09:50:51 +0000 Subject: [New-bugs-announce] [issue27588] Type objects are hashable and comparable for equality but this is not documented Message-ID: <1469181051.15.0.925508125369.issue27588@psf.upfronthosting.co.za> New submission from Gareth Rees: The type objects constructed by the metaclasses in the typing module are hashable and comparable for equality: >>> from typing import * >>> {Mapping[str, int], Mapping[int, str]} {typing.Mapping[int, str], typing.Mapping[str, int]} >>> Union[str, int, float] == Union[float, int, str] True >>> List[int] == List[float] False but this is not clearly documented in the documentation for the typing module (there are a handful of examples using equality, but it's not explicit that these are runnable). It would be nice if there were explicit documentation for these properties of type objects. ---------- assignee: docs at python components: Documentation messages: 270981 nosy: Gareth.Rees, docs at python priority: normal severity: normal status: open title: Type objects are hashable and comparable for equality but this is not documented type: enhancement versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 06:08:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 22 Jul 2016 10:08:25 +0000 Subject: [New-bugs-announce] [issue27589] asyncio doc: issue in as_completed() doc Message-ID: <1469182105.52.0.303554063448.issue27589@psf.upfronthosting.co.za> New submission from STINNER Victor: Remark on as_completed() doc by Hynek. https://docs.python.org/dev/library/asyncio-task.html#asyncio.as_completed Futures are yielded in an unexpected order: as soon as a future completes. ---------- assignee: docs at python components: Documentation, asyncio messages: 270982 nosy: docs at python, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: asyncio doc: issue in as_completed() doc versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 11:11:06 2016 From: report at bugs.python.org (Yujie Chen) Date: Fri, 22 Jul 2016 15:11:06 +0000 Subject: [New-bugs-announce] [issue27590] tarfile module next() method hides exceptions Message-ID: <1469200266.16.0.443973453456.issue27590@psf.upfronthosting.co.za> New submission from Yujie Chen: I have seen a similar ticket, however that was opened 2 years ago and has nothing more than a brief description. So I opened this new one here, hoping to get some answers. tarfile.TarFile object is iterable and has a next() method. next() will parse the header and save parsed info. During parsing, a lot of checks are done, to make sure the header is valid. And if there is something wrong with the header, exceptions will be thrown. next() catches a lot of them but not reraise what it catches in all cases. I have a tgz file, one of the headers is corrupted with a wrong checksum section. thus during parsing, InvalidHeaderError was thrown. next() catches that but hide it silently. From source code (https://hg.python.org/cpython/file/2.7/Lib/tarfile.py#l2335), we can see that InvalidHeaderError will ONLY be raised if it happens in the beginning of the tar file. Actually, a lot of exceptions are hidden by tarfile module. tarfile module simply thinks these exceptions mark the end of tarball. Why does tarfile module hide so many exceptions? or in other words, why does tarfile treat these exceptions as the end marker of tarball but not errors? Is it because of this from GNU doc: "At the end of the archive file there are two 512-byte blocks filled with binary zeros as an end-of-file marker. A reasonable system should write such end-of-file marker at the end of an archive, but must not assume that such a block exists when reading an archive."? Thanks! ---------- components: Library (Lib) messages: 270990 nosy: JieGhost priority: normal severity: normal status: open title: tarfile module next() method hides exceptions type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 11:12:39 2016 From: report at bugs.python.org (Chris Angelico) Date: Fri, 22 Jul 2016 15:12:39 +0000 Subject: [New-bugs-announce] [issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds Message-ID: <1469200359.36.0.370469252953.issue27591@psf.upfronthosting.co.za> New submission from Chris Angelico: Originally reported (if you can call it "reported") here: http://www.viva64.com/en/b/0414/ AFAICT, this is an easy and inconsequential fix. ---------- files: uninitialized-pointer.patch keywords: patch messages: 270991 nosy: Rosuav priority: normal severity: normal status: open title: multiprocessing: Possible uninitialized pointer use in Windows builds versions: Python 3.6 Added file: http://bugs.python.org/file43832/uninitialized-pointer.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 14:02:23 2016 From: report at bugs.python.org (Cristi Fati) Date: Fri, 22 Jul 2016 18:02:23 +0000 Subject: [New-bugs-announce] [issue27592] FIPS_mode() and FIPS_mode_set() functions in Python (ssl) Message-ID: <1469210543.94.0.196720087995.issue27592@psf.upfronthosting.co.za> New submission from Cristi Fati: During last years, the FIPS mode, has become more and more popular, especially in US (probably because it was "promoted" by government institutions). All OpenSSL versions (didn't check 1.0.0 or lower since they're no longer supported), have the "basic FIPS functionality", even if built without openssl-fips module. By "basic FIPS functionality", I mean the 2 functions: - `int FIPS_mode(void)` - used to get the current FIPS mode (for non FIPS openssl, it simply returns 0) - `int FIPS_mode_set(int r)` - used to set the current FIPS mode in the currently loaded libcrypto/libeay32 (for non FIPS openssl it sets the openssl error: "error:0F06D065:common libcrypto routines:FIPS_mode_set:fips mode not supported") The goal of this patch is to add the 2 functions in Python (3.4.4 source tarball) - ssl (and _ssl) module - in order to be able to control FIPS mode from within a Python process (I am aware that some platforms allow setting FIPS at a global level, but this offers more granularity). The patch is simple, for the getter it simply returns the OpenSSL function value, while for the setter it doesn't return anything but throws an exception if some error occurs. Note0 (about how do I set the error): `_setSSLError(ERR_error_string(ERR_get_error(), NULL) , 0, __FILE__, __LINE__);` as opposed to the regular way: `_setSSLError(NULL, 0, __FILE__, __LINE__);`. I didn't use the whole make_ssl_data.py mechanism because: - 1 - it binds against the OpenSSL version used at compile time - 1.1 - on Ux (where Python modules are dynamically linked to OpenSSL), if compiling against one OpenSSL version and at runtime another (newer) version which defines new functionality (and new error codes) is present, if one of those newer errors is encountered, the error message won't be as complete: "ssl.SSLError: fips mode already set (_ssl.c:3763)" as opposed to "ssl.SSLError: error:2D078072:FIPS routines:FIPS_module_mode_set:fips mode already set (_ssl.c:3763)" - 1.2 - on Win (where Python modules are statically linked to OpenSSL), there won't be such a problem. However, regarding static linking (this is not related to this post), this is not a scalable solution (now if only _ssl and _hashlib link to OpenSSL, it's __sort of__ OK, but if another one, or more will be added it won't be), so dynamic linking should be used, although that comes with its problems. 2 possible ways to solve them: - 1.2.1 - simply dynamic link to OpenSSL and at runtime it will fail importing the modules; this will happen a lot since (as opposed to Ux), I think that there's a 90%+ chance that no OpenSSL is installed on a Win machine - 1.2.2 - dynamic link to OpenSSL and also redistribute the OpenSSL dlls (although I didn't check what this would mean from licensing PoV). This would also raise the problem of precedence: which dlls should be used by default if an OpenSSL version is installed on the machine. - 2 - It is simpler (here I might be missing something). To me it seems cleaner to delegate the job to (runtime) OpenSSL instead of make_ssl_data.py and the logic from `fill_and_set_sslerror` (which could be removed in the future, I'd say). Note1: The whole thing could also be applied to hashlib (simply copy the changes from ssl.py to hashlib.py - to have as less duplicate code as possible), but since due to hashlib caching, changing the FIPS mode on the fly won't be reflected in the possibility/impossibility of using a hash (e.g. `md5`), I figured that it doesn't worth the effort. As a workaround, for someone who really needs to set it, they can do it from ssl. ---------- files: Python-3.4.4-ssl_fips.patch keywords: patch messages: 271006 nosy: CristiFati priority: normal severity: normal status: open title: FIPS_mode() and FIPS_mode_set() functions in Python (ssl) type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file43833/Python-3.4.4-ssl_fips.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 17:43:25 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 22 Jul 2016 21:43:25 +0000 Subject: [New-bugs-announce] [issue27593] Deprecate sys._mercurial and create sys._git Message-ID: <1469223805.51.0.614192375682.issue27593@psf.upfronthosting.co.za> New submission from Brett Cannon: This is part of the GitHub migration. And by "deprecate" sys._mercurial I mean fill it with default values (https://www.python.org/dev/peps/pep-0512/#deprecate-sys-mercurial). ---------- components: Library (Lib) messages: 271037 nosy: brett.cannon priority: normal severity: normal status: open title: Deprecate sys._mercurial and create sys._git _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 18:32:06 2016 From: report at bugs.python.org (ap) Date: Fri, 22 Jul 2016 22:32:06 +0000 Subject: [New-bugs-announce] [issue27594] Assertion failure when running "test_ast" tests with coverage. Message-ID: <1469226726.58.0.53789092151.issue27594@psf.upfronthosting.co.za> New submission from ap: This is with a build of the default branch on OS X 10.11.6: $ hg identify fada654c5f72 tip $ ./python.exe --version Python 3.6.0a3+ $ The "test_ast" tests appear to run fine without coverage tracking enabled: $ ./python.exe -m test test_ast Run tests sequentially 0:00:00 [1/1] test_ast 1 test OK. Total duration: 0:00:07 $ But when coverage tracking is enabled, an assertion fails: $ ./python.exe -m test --coverage -D`pwd`/coverage_data test_ast Run tests sequentially 0:00:00 [1/1] test_ast Assertion failed: (line > 0), function _PyCode_CheckLineNumber, file Objects/codeobject.c, line 717. Fatal Python error: Aborted Current thread 0x00007fff76279000 (most recent call first): File "test", line 0 in File "/python-dev/cpython/Lib/test/test_ast.py", line 559 in test_level_as_none File "/python-dev/cpython/Lib/unittest/case.py", line 600 in run File "/python-dev/cpython/Lib/unittest/case.py", line 648 in __call__ File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/python-dev/cpython/Lib/unittest/suite.py", line 122 in run File "/python-dev/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/python-dev/cpython/Lib/test/support/__init__.py", line 1709 in run File "/python-dev/cpython/Lib/test/support/__init__.py", line 1810 in _run_suite File "/python-dev/cpython/Lib/test/support/__init__.py", line 1844 in run_unittest File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 179 in test_runner File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 180 in runtest_inner File "/python-dev/cpython/Lib/test/libregrtest/runtest.py", line 144 in runtest File "", line 1 in File "/python-dev/cpython/Lib/trace.py", line 469 in runctx File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 330 in run_tests_sequential File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 406 in run_tests File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 466 in _main File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 446 in main File "/python-dev/cpython/Lib/test/libregrtest/main.py", line 508 in main File "/python-dev/cpython/Lib/test/__main__.py", line 2 in File "/python-dev/cpython/Lib/runpy.py", line 85 in _run_code File "/python-dev/cpython/Lib/runpy.py", line 184 in _run_module_as_main Abort trap: 6 $ ---------- components: Tests messages: 271038 nosy: ap priority: normal severity: normal status: open title: Assertion failure when running "test_ast" tests with coverage. versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 22 18:52:34 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 22 Jul 2016 22:52:34 +0000 Subject: [New-bugs-announce] [issue27595] Document PEP 495 (Local Time Disambiguation) features Message-ID: <1469227954.48.0.374414498519.issue27595@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: PEP 495 has been implemented in issue 24773. This issue is created to track the necessary changes to the datetime module documentation. ---------- assignee: belopolsky components: Documentation messages: 271041 nosy: akira, belopolsky, haypo, stub, tim.peters priority: normal severity: normal stage: needs patch status: open title: Document PEP 495 (Local Time Disambiguation) features type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 06:49:43 2016 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 23 Jul 2016 10:49:43 +0000 Subject: [New-bugs-announce] [issue27596] Build failure with Xcode 8 beta on OSX 10.11 Message-ID: <1469270983.6.0.702583698233.issue27596@psf.upfronthosting.co.za> New submission from Ronald Oussoren: I just noticed that building the Xcode 8 beta 2 on OSX 10.11 results in a link failure of the python binary. Based on a quick glance at the error (before switching back to Xcode 7): 1) macOS 10.12 appears to have a getentropy function that's detected by the configure script. 2) For some reason the build environment for configure and the actual build are different resulting in the link error. Even with the link failure fixed the build will fail because getentropy isn't present on 10.11 and hence the binary won't work on 10.11. IMHO it would be worthwhile to at least create a patch that makes it possible to use Xcode 8 for building on OSX 10.11, and better yet deploy on older OSX releases. Based on the invasiveness of such a patch we could discuss if the patch would be acceptable for merging. ---------- assignee: ronaldoussoren components: Macintosh messages: 271069 nosy: ned.deily, ronaldoussoren priority: low severity: normal stage: needs patch status: open title: Build failure with Xcode 8 beta on OSX 10.11 type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 06:58:10 2016 From: report at bugs.python.org (Ram Rachum) Date: Sat, 23 Jul 2016 10:58:10 +0000 Subject: [New-bugs-announce] [issue27597] Add usage examples for TracebackException, StackSummary and FrameSummary Message-ID: <1469271490.04.0.794512221992.issue27597@psf.upfronthosting.co.za> New submission from Ram Rachum: I saw these new interesting classes in the `traceback` docs, but if I were shown an example of how they are used, I might get inspired to use them in my own code. ---------- assignee: docs at python components: Documentation messages: 271072 nosy: cool-RR, docs at python priority: normal severity: normal status: open title: Add usage examples for TracebackException, StackSummary and FrameSummary type: enhancement versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 11:46:49 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 23 Jul 2016 15:46:49 +0000 Subject: [New-bugs-announce] [issue27598] Add SizedIterable to collections.abc and typing Message-ID: <1469288809.56.0.543825422436.issue27598@psf.upfronthosting.co.za> New submission from Brett Cannon: See the discussion on python-ideas entitled "An ABC representing "Iterable, Sized, Container"". ---------- components: Library (Lib) messages: 271088 nosy: brett.cannon, gvanrossum priority: normal severity: normal stage: test needed status: open title: Add SizedIterable to collections.abc and typing versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 12:31:32 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 23 Jul 2016 16:31:32 +0000 Subject: [New-bugs-announce] [issue27599] Buffer overrun in binascii Message-ID: <1469291492.89.0.37008226611.issue27599@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: There is reading one byte past the end of the input buffer in binascii.b2a_qp(). Following example shows the behavior difference depending on the value of this byte: >>> binascii.b2a_qp(memoryview(b'..')[:-1]) b'.' >>> binascii.b2a_qp(bytes(memoryview(b'..')[:-1])) b'=2E' In rare cases (memoryview of mmap object or custom buffer) this can cause a segfault. Maybe there are similar issues with other binascii functions (not checked). ---------- components: Extension Modules messages: 271092 nosy: serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Buffer overrun in binascii type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 12:51:08 2016 From: report at bugs.python.org (Thanatas Pongpanotkorn) Date: Sat, 23 Jul 2016 16:51:08 +0000 Subject: [New-bugs-announce] [issue27600] None Message-ID: <1469292668.75.0.484494556791.issue27600@psf.upfronthosting.co.za> Changes by Thanatas Pongpanotkorn : ---------- hgrepos: 350 nosy: xaxadmin priority: normal severity: normal status: open title: None _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 14:17:52 2016 From: report at bugs.python.org (Aleksandr Koshkin) Date: Sat, 23 Jul 2016 18:17:52 +0000 Subject: [New-bugs-announce] [issue27601] Minor inaccuracy in hash documentation Message-ID: <1469297872.54.0.246840894647.issue27601@psf.upfronthosting.co.za> New submission from Aleksandr Koshkin: https://docs.python.org/3.6/library/stdtypes.html#hashing-of-numeric-types Look at semantics example for hash_complex function. The variable 'hash' is clearly misused - it is not defined or refers to builtin function 'hash'. Either way the example is incorrect. ---------- assignee: docs at python components: Documentation messages: 271097 nosy: docs at python, magniff priority: normal severity: normal status: open title: Minor inaccuracy in hash documentation versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 16:41:39 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 23 Jul 2016 20:41:39 +0000 Subject: [New-bugs-announce] [issue27602] Enable py launcher to launch repository Python. Message-ID: <1469306499.45.0.411476180863.issue27602@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Running a repository build by typing a path such as F:\Python\dev\36\PCbuild\win32\python_d.exe is tedious and error prone and I have to remember to omit '\win32' for 2.7 and it takes up much of a command line. I would like to be able to run something like py -register 3.6r # 'r' for repository, or possibly '+' and subsequently have py -3.6r launch the locally compiled but un-installed binary. Possible? I did not find 'py launcher' in Expert's Index or Components, so selected you two from memory and 'Windows'. Please modify Components and Nosy as appropriate. I have an impression that there is a launcher version for Mac but know nothing about it. ---------- components: Windows messages: 271111 nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: Enable py launcher to launch repository Python. type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 23 23:59:59 2016 From: report at bugs.python.org (Steve Dower) Date: Sun, 24 Jul 2016 03:59:59 +0000 Subject: [New-bugs-announce] [issue27603] Migrate IDLE context menu items to shell extension Message-ID: <1469332799.74.0.70339682021.issue27603@psf.upfronthosting.co.za> New submission from Steve Dower: Currently (on Windows) we register a set of subcommands in order to display an expanding list of versions of IDLE when users right-click a .py file. With issue27469, a proper shell extension was added, which means we can now use IContextMenu to implement the menu rather than fixed registry keys. This would allow us to detect all installed versions of IDLE and present them without having to register new keys (i.e. forwards and backwards compatibility). ---------- assignee: terry.reedy components: IDLE, Windows messages: 271123 nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: low severity: normal stage: needs patch status: open title: Migrate IDLE context menu items to shell extension type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 05:46:21 2016 From: report at bugs.python.org (Ram Rachum) Date: Sun, 24 Jul 2016 09:46:21 +0000 Subject: [New-bugs-announce] [issue27604] More details about `-O` flag Message-ID: <1469353581.38.0.811049911305.issue27604@psf.upfronthosting.co.za> New submission from Ram Rachum: I wanted to ensure that the `-O` flag doesn't really do anything more than remove assert statement and make `__debug__` equal `False`. But the documentation for `-O` doesn't cover it: https://docs.python.org/3/using/cmdline.html#cmdoption-O https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE It just says "basic optimizations". Are there any other optimizations except the two I mentioned? ---------- assignee: docs at python components: Documentation messages: 271142 nosy: cool-RR, docs at python priority: normal severity: normal status: open title: More details about `-O` flag type: enhancement versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 08:13:15 2016 From: report at bugs.python.org (Vasiliy Faronov) Date: Sun, 24 Jul 2016 12:13:15 +0000 Subject: [New-bugs-announce] [issue27605] Inconsistent calls to __eq__ from built-in __contains__ Message-ID: <1469362395.06.0.246923750082.issue27605@psf.upfronthosting.co.za> New submission from Vasiliy Faronov: Consider the attached example program. I expect it to run successfully, because the Python 3 language reference says [1]: > For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression `x in y` is equivalent to `any(x is e or x == e for e in y)`. and [2]: > `x==y` calls `x.__eq__(y)` Instead, under Python 3.5.2, the program crashes with an assertion error, because `dict.__contains__` calls `Bar.__eq__` instead of `Foo.__eq__`. The same happens if you replace the dict with a set or a frozenset. But if you replace it with a list or a tuple, the behavior is as documented. This seems to me like a bug in either the implementation or the documentation. The language reference clearly says [3] that equality should be symmetric "if possible", but is not required to be, and indeed that is hard to guarantee when different classes are involved. [1] https://docs.python.org/3/reference/expressions.html#membership-test-details [2] https://docs.python.org/3/reference/datamodel.html#object.__eq__ [3] https://docs.python.org/3/reference/expressions.html#value-comparisons ---------- files: contains_eq.py messages: 271145 nosy: vfaronov priority: normal severity: normal status: open title: Inconsistent calls to __eq__ from built-in __contains__ type: behavior Added file: http://bugs.python.org/file43857/contains_eq.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 08:27:43 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 24 Jul 2016 12:27:43 +0000 Subject: [New-bugs-announce] [issue27606] Android cross-built for armv5te with clang and '-mthumb' crashes with SIGSEGV or SIGILL Message-ID: <1469363263.55.0.186080490257.issue27606@psf.upfronthosting.co.za> New submission from Xavier de Gaye: Android ndk version r11c. The crash happens very early on python startup. The SIGILL occurs when python is built 'with-pydebug'. Python runs fine on the armv5te emulator when built with clang without '-mthumb'. Python runs fine on the armv5te emulator when built with gcc 4.9 with or without '-mthumb'. Attaching the strace and logcat output for each type of build. The backtrace when python is built 'with-pydebug' (but logcat.txt says that the SIGSEGV occurs at PyUnicode_DecodeUTF8Stateful when not built 'with-pydebug'): Program received signal SIGILL, Illegal instruction. 0xb6d77e0a in r_object (p=0xbed89588) at Python/marshal.c:1340 1340 idx = r_ref_reserve(flag, p); (gdb) bt #0 0xb6d77e0a in r_object (p=0xbed89588) at Python/marshal.c:1340 #1 0xb6d76ba2 in PyMarshal_ReadObjectFromString (str=0xb6e5f9ae <_Py_M__importlib> "c", len=30106) at Python/marshal.c:1584 #2 0xb6d72506 in PyImport_ImportFrozenModuleObject (name='_frozen_importlib') at Python/import.c:1187 #3 0xb6d727ec in PyImport_ImportFrozenModule (name=0xb6e49ac0 "_frozen_importlib") at Python/import.c:1236 #4 0xb6d7ff96 in import_init (interp=0xb6919068, sysmod=) at Python/pylifecycle.c:243 #5 0xb6d7fc80 in _Py_InitializeEx_Private (install_sigs=1, install_importlib=1) at Python/pylifecycle.c:413 #6 0xb6d80f30 in Py_InitializeEx (install_sigs=1) at Python/pylifecycle.c:450 #7 0xb6d80f3e in Py_Initialize () at Python/pylifecycle.c:456 #8 0xb6daa5e6 in Py_Main (argc=1, argv=0xb6901068) at Modules/main.c:678 #9 0xb6f9b84c in ?? () ---------- components: Cross-Build files: strace.txt messages: 271146 nosy: Alex.Willmer, xdegaye priority: normal severity: normal status: open title: Android cross-built for armv5te with clang and '-mthumb' crashes with SIGSEGV or SIGILL type: crash versions: Python 3.6 Added file: http://bugs.python.org/file43858/strace.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 11:46:17 2016 From: report at bugs.python.org (Sylvia van Os) Date: Sun, 24 Jul 2016 15:46:17 +0000 Subject: [New-bugs-announce] [issue27607] Enums never match if imported from another file Message-ID: <1469375177.67.0.287991264427.issue27607@psf.upfronthosting.co.za> New submission from Sylvia van Os: If main imports another file, and this file imports an Enum class from main, isinstance will return false for Enum variables set in this file, causing the Enums to never match. A proof of concept is added as a zip. I thank Kwpolska for simplifying my initial proof of concept. To test this, unzip both files into the same directory and launch main.py with Python 3. I have succesfully been able to reproduce this issue on Python 3.4.3. >From discussion on IRC with Vgr, PEP 499 may be related to this issue: https://www.python.org/dev/peps/pep-0499/. ---------- components: Interpreter Core files: a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip messages: 271164 nosy: Kwpolska, SylvieLorxu priority: normal severity: normal status: open title: Enums never match if imported from another file type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file43867/a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 13:37:20 2016 From: report at bugs.python.org (Aleksandr Koshkin) Date: Sun, 24 Jul 2016 17:37:20 +0000 Subject: [New-bugs-announce] [issue27608] Something wrong with str.upper().lower() chain? Message-ID: <1469381840.71.0.0990195629245.issue27608@psf.upfronthosting.co.za> New submission from Aleksandr Koshkin: For some reason >>> '?'.upper().lower() == '?' False ---------- components: Unicode messages: 271174 nosy: ezio.melotti, haypo, magniff priority: normal severity: normal status: open title: Something wrong with str.upper().lower() chain? type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 20:03:08 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 25 Jul 2016 00:03:08 +0000 Subject: [New-bugs-announce] [issue27609] IDLE completions: format, factor, and fix Message-ID: <1469404988.71.0.674184496094.issue27609@psf.upfronthosting.co.za> New submission from Terry J. Reedy: IDLE completions are currently implemented in two files: autocomplete.py and autocomplete_w.py. (Before 3.6, these were AutoComplete.py and AutoCompleteWindow.py.) The first handles 'open' events, decideds whether to open a window, and gathers possible completions. The second open a popup and works with the sorted list of possible completions. There are several tracker issues already. #15786 Code completion problems with mouse and . These lead to freezes on on Mac. Severity: bad; prioriy: high. #16198 Tabbing in string brings up completion when it should not. #17238 Enhance import statement completion. #18766 Add completions for un-imported modules (by importing). #18903 File completions are case sensitive, should not be on Windows. #21261 Complete dictionary keys. #22554 Popup window for names also. #27099 Convert autocomplete to normal feature, along with other 'extensions'. Add delay to current tab. Negative delay should disable auto-popups. #27534 Move objects needed by run to run.py and import from there. There are more that are not on the tracker. Patches may be attached here or to new issues. A. Use PEP8 style. 1.'return None' when there are non-None returns. 2. Docstrings for all functions. B. Merge autocomplete_w into autocomplete. This was anticipated in the renaming. #27534 should be done first if possible, or soon after. C. Refactor. 1 #27534. 2. Put list and scrollbar in Frame? For future single-window IDLE? This might make testing easier. 3. Anything else making tests easier. D. Make completions work for number literals ("1 .") as well a string literals ("'a'."). E?. Make completions work with Entry as well as Multicall wrapping text? Need use case first. Load Modules may need own code. Question: Why does 'dooneevent' appear in 2.x code and not 3.x code? Tests: The currently only for a subset of autocomplete methods. There are none for the buggy window. First, a patch for A.1, return None. ---------- assignee: terry.reedy messages: 271186 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE completions: format, factor, and fix type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 21:06:05 2016 From: report at bugs.python.org (Steve Dower) Date: Mon, 25 Jul 2016 01:06:05 +0000 Subject: [New-bugs-announce] [issue27610] Add PEP 514 metadata to Windows installer Message-ID: <1469408765.5.0.0268555752017.issue27610@psf.upfronthosting.co.za> New submission from Steve Dower: Now PEP 514 is accepted, we need to set more information when installing Python 3.6. ---------- assignee: steve.dower components: Windows messages: 271197 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add PEP 514 metadata to Windows installer type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 24 22:07:16 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 25 Jul 2016 02:07:16 +0000 Subject: [New-bugs-announce] [issue27611] test_tix cannot import _default_root after test_idle Message-ID: <1469412436.77.0.964864196793.issue27611@psf.upfronthosting.co.za> New submission from Martin Panter: $ ./python -m unittest -v test.test_{idle,tix} . . . test_tix (unittest.loader._FailedTest) ... ERROR ====================================================================== ERROR: test_tix (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: test_tix Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/unittest/loader.py", line 153, in loadTestsFromName module = __import__(module_name) File "/media/disk/home/proj/python/cpython/Lib/test/test_tix.py", line 11, in from tkinter import tix, TclError File "/media/disk/home/proj/python/cpython/Lib/tkinter/tix.py", line 30, in from tkinter import _cnfmerge, _default_root ImportError: cannot import name '_default_root' Without test_idle, test_tix is skipped for me: $ ./python -m unittest -v test.test_tix test_tix_available (test.test_tix.TestTix) ... skipped 'Tix not available' Reverting to before revision 064b29dde096 (Issue 24137) also fixes the failure. ---------- components: Tests messages: 271206 nosy: martin.panter, serhiy.storchaka, terry.reedy priority: normal severity: normal status: open title: test_tix cannot import _default_root after test_idle type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 02:27:54 2016 From: report at bugs.python.org (Matt Robenolt) Date: Mon, 25 Jul 2016 06:27:54 +0000 Subject: [New-bugs-announce] [issue27612] socket.gethostbyname resolving octal IP addresses incorrectly Message-ID: <1469428074.1.0.701366093272.issue27612@psf.upfronthosting.co.za> New submission from Matt Robenolt: This also affects socket.getaddrinfo on macOS only, but is fine on Linux. I've not tested on Windows to see behavior there. Given the IP address `0177.0000.0000.0001`, which is a valid octal format representing `127.0.0.1`, we can see varying results. Confirmed in both python 2.7 and 3.5. First, socket.gethostbyname is always wrong, and always returns `177.0.0.1`: ``` >>> socket.gethostbyname('0177.0000.0000.0001') '177.0.0.1' ``` This can be seen on both Linux and macOS. With `socket.getaddrinfo`, resolution is correct on Linux, but the bad 177.0.0.1 on macOS. Linux: ``` >>> socket.getaddrinfo('0177.0000.0000.0001', None)[0] (2, 1, 6, '', ('127.0.0.1', 0)) ``` macOS: ``` >>> socket.getaddrinfo('0177.0000.0000.0001', None)[0] (2, 2, 17, '', ('177.0.0.1', 0)) ``` This behavior exists in both 2.7.12 and 3.5.2 at least. I haven't tested many others, but I assume pretty universal. ---------- components: Library (Lib) messages: 271237 nosy: mattrobenolt priority: normal severity: normal status: open title: socket.gethostbyname resolving octal IP addresses incorrectly type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 07:42:11 2016 From: report at bugs.python.org (Grigory Statsenko) Date: Mon, 25 Jul 2016 11:42:11 +0000 Subject: [New-bugs-announce] [issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode Message-ID: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> New submission from Grigory Statsenko: JSONEncoder.iterencode doesn't work with empty iterators correctly. Steps: 1. Define an iterator that is recognized by json as a list (inherit from list and define nonzero __len__). 2. Use json.dump with data containing an empty iterator defined as described in step#1 (but doesn't generate any items) Expected result: it should be rendered as an empty list: '[]' Actual result: it is rendered as ']' (only the closing bracket) interestingly enough this behavior is not reproduced when using the dumps function. I tried other alternatives to the standard json module: simplejson, ujson, hjson All of them work as expected in this case (both brackets are rendered). Here is an example of the code that demonstrates this error (compares the results of the dump and dumps functions): import json as json import io class EmptyIterator(list): def __iter__(self): while False: yield 1 def __len__(self): return 1 def dump_to_str(data): return json.dumps(data) def dump_to_file(data): stream = io.StringIO() json.dump(data, stream) return stream.getvalue() data = {'it': EmptyIterator()} print('to str: {0}'.format(dump_to_str(data))) print('to file: {0}'.format(dump_to_file(data))) This prints: to str: {"it": []} to file: {"it": ]} ---------- messages: 271249 nosy: altvod priority: normal severity: normal status: open title: Empty iterator is rendered as a single bracket ] when using json's iterencode type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 11:05:39 2016 From: report at bugs.python.org (earl.chew) Date: Mon, 25 Jul 2016 15:05:39 +0000 Subject: [New-bugs-announce] [issue27614] Race in test_docxmlrpc.py Message-ID: <1469459139.76.0.959920407285.issue27614@psf.upfronthosting.co.za> New submission from earl.chew: The test test_docxmlrpc.py will sometimes hang because of a timing race. I've verified that this code is the same up to version 3.5 and master at https://github.com/python/cpython/blob/master/Lib/test/test_docxmlrpc.py A proposed patch is attached. ---------- components: Library (Lib) files: test_docxmlrpc.py messages: 271279 nosy: earl.chew priority: normal severity: normal status: open title: Race in test_docxmlrpc.py type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43881/test_docxmlrpc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 13:29:19 2016 From: report at bugs.python.org (Al Sweigart) Date: Mon, 25 Jul 2016 17:29:19 +0000 Subject: [New-bugs-announce] [issue27615] IDLE's debugger steps into PyShell.py for calls to print() et al Message-ID: <1469467759.18.0.354149143305.issue27615@psf.upfronthosting.co.za> New submission from Al Sweigart: Currently if the user "steps into" a print(), input(), sys.stdout.write() or other stdio-related call with the Source checkbox checked, it brings up PyShell.py. This is often confusing for beginner programmers (the target audience of IDLE) and most often not helpful for experienced developers who are stepping through their program. Comparing the cost/benefit, I'd be much more helpful for IDLE to not bring up PyShell.py and instead just treat every "step into" of a print()/input()/anything-that-goes-to-pyshell as a "step over" instead. ---------- assignee: terry.reedy components: IDLE messages: 271295 nosy: Al.Sweigart, terry.reedy priority: normal severity: normal status: open title: IDLE's debugger steps into PyShell.py for calls to print() et al versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 13:37:18 2016 From: report at bugs.python.org (Grant Hillebrand) Date: Mon, 25 Jul 2016 17:37:18 +0000 Subject: [New-bugs-announce] [issue27616] filedialog.askdirectory inconsistent on Windows between returning "C:/" and "C:/users" (no trailing slash) Message-ID: <1469468238.61.0.474363149897.issue27616@psf.upfronthosting.co.za> New submission from Grant Hillebrand: When running the following code on Windows 7 (64bit os), and selecting a root drive letter, eg C:, it returns "C:/", with a slash appended. When selecting any other path below root level, eg "C:/users" it returns "C:/users" - no slash appended. This then introduces an odd edge case in processing the output if the path is to be prepended to directory walk data and other file names. Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 >>> from tkinter import filedialog >>> SourcePath = filedialog.askdirectory() >>> print(SourcePath) C:/ >>> SourcePath = filedialog.askdirectory() >>> print(SourcePath) C:/NVIDIA >>> ---------- components: Tkinter, Windows messages: 271296 nosy: Grant Hillebrand, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: filedialog.askdirectory inconsistent on Windows between returning "C:/" and "C:/users" (no trailing slash) type: behavior versions: Python 3.3, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 15:28:00 2016 From: report at bugs.python.org (Michael Smith) Date: Mon, 25 Jul 2016 19:28:00 +0000 Subject: [New-bugs-announce] [issue27617] Compiled bdist_wininst missing from embedded distribution Message-ID: <1469474880.88.0.362049415558.issue27617@psf.upfronthosting.co.za> New submission from Michael Smith: It seems that the embedded distribution is missing bdist_wininst.pyc from the python35.zip . If you go to distutils\command, you'll notice only 23 compiled python files, where in the regular web based installer for the same Python version there are 24 python files in similar relevant folder. I encountered this while trying to install a library into the python runtime that had this import statement: import distutils.command.bdist_wininst ---------- components: Distutils messages: 271301 nosy: denimpowell, dstufft, eric.araujo priority: normal severity: normal status: open title: Compiled bdist_wininst missing from embedded distribution type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 16:55:03 2016 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 25 Jul 2016 20:55:03 +0000 Subject: [New-bugs-announce] [issue27618] docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently) Message-ID: <1469480103.96.0.342423272445.issue27618@psf.upfronthosting.co.za> New submission from Guido van Rossum: The docs for threading.Lock say 79534: .. versionchanged:: 3.3 79534: Changed from a factory function to a class. but the implementation in threading.py doesn't define a class named Lock, and in fact it is an alias for _thread.allocate_lock. Are the docs wrong, or is the source? Or did this get changed back later? ---------- messages: 271305 nosy: gvanrossum priority: normal severity: normal status: open title: docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 20:50:17 2016 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 26 Jul 2016 00:50:17 +0000 Subject: [New-bugs-announce] [issue27619] getopt should strip whitespace from long arguments Message-ID: <1469494217.58.0.75154224673.issue27619@psf.upfronthosting.co.za> New submission from Steven D'Aprano: As reported here: https://mail.python.org/pipermail/python-list/2016-July/711333.html there's a possible annoyance with getopt when you accidentally leave whitespace on a long option. On my Centos system, getopt ignores leading and trailing whitespace on long options. [steve at ando ~]$ getopt -o "" -l " spam , eggs " -- --spam --eggs arg --spam --eggs -- 'arg' Python's getopt should do the same. (Patch attached.) ---------- components: Library (Lib) files: getopt.patch keywords: patch messages: 271310 nosy: steven.daprano priority: normal severity: normal status: open title: getopt should strip whitespace from long arguments type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43884/getopt.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 25 20:54:51 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 26 Jul 2016 00:54:51 +0000 Subject: [New-bugs-announce] [issue27620] IDLE: Add keyboard equivalents for mouse actions. Message-ID: <1469494491.39.0.22722488108.issue27620@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Reading https://en.wikipedia.org/wiki/IBM_Common_User_Access and in particular "All operations could be done with either the mouse or the keyboard;", I checked IDLE's dialogs. The Windows dialogs accessed as common dialogs work correctly. I will assume true for other OSes until told otherwise. The new Query widget recogizes for [Ok] but not for [Cancel]. My omission, easily corrected. Search boxes cannot set options with keys. Notepad++ can. The Options dialog has no key equivalents. ---------- assignee: terry.reedy components: IDLE messages: 271311 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Add keyboard equivalents for mouse actions. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 02:02:46 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 26 Jul 2016 06:02:46 +0000 Subject: [New-bugs-announce] [issue27621] incorrectly works in IDLE Query dialogs Message-ID: <1469512966.74.0.594331033204.issue27621@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: When open new Query dialog in IDLE (e.g. "Open Module" dialog), move a focus on the Cancel button and press on keyboard, the OK button is invoked instead of Cancel. ---------- assignee: terry.reedy components: IDLE messages: 271326 nosy: serhiy.storchaka, terry.reedy priority: normal severity: normal status: open title: incorrectly works in IDLE Query dialogs type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 02:20:37 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Tue, 26 Jul 2016 06:20:37 +0000 Subject: [New-bugs-announce] [issue27622] int.to_bytes(): docstring is not precise Message-ID: <1469514037.92.0.489318728995.issue27622@psf.upfronthosting.co.za> New submission from ???? ?????????: Docstring says: The signed keyword-only argument determines whether two's complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised. But actually, (130).to_bytes(1, 'big', signed=True) will also trigger OverflowError ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 271327 nosy: docs at python, mmarkk priority: normal severity: normal status: open title: int.to_bytes(): docstring is not precise type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 02:26:20 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Tue, 26 Jul 2016 06:26:20 +0000 Subject: [New-bugs-announce] [issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero Message-ID: <1469514380.74.0.642597369558.issue27623@psf.upfronthosting.co.za> New submission from ???? ?????????: As you can see, these conversions are not consistent. What is use case to allow that? =================== In [22]: (-1).to_bytes(0, 'big', signed=True) Out[22]: b'' In [23]: (0).to_bytes(0, 'big', signed=True) Out[23]: b'' As you can see, two different values serialized to same empty bytes sequence. =================== In [28]: int.from_bytes(b'', 'big', signed=True) Out[28]: 0 In [29]: int.from_bytes(b'', 'big', signed=False) Out[29]: 0 Anyway, -1 can not be deserialized. =================== ---------- messages: 271329 nosy: mmarkk priority: normal severity: normal status: open title: int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 09:00:53 2016 From: report at bugs.python.org (Doug Hoskisson) Date: Tue, 26 Jul 2016 13:00:53 +0000 Subject: [New-bugs-announce] [issue27624] unclear documentation on Queue.qsize() Message-ID: <1469538053.41.0.353171937214.issue27624@psf.upfronthosting.co.za> New submission from Doug Hoskisson: The documentation for Queue.qsize(): "Return the approximate size of the queue." "approximate" is unclear. It might suggest some strategy used for approximating, or it might be the exact size at an arbitrary time. It should be made more clear. ---------- assignee: docs at python components: Documentation messages: 271362 nosy: Doug Hoskisson, docs at python priority: normal severity: normal status: open title: unclear documentation on Queue.qsize() versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 09:52:00 2016 From: report at bugs.python.org (Palm Kevin) Date: Tue, 26 Jul 2016 13:52:00 +0000 Subject: [New-bugs-announce] [issue27625] "make install" fails when no zlib support available Message-ID: <1469541120.27.0.508347520885.issue27625@psf.upfronthosting.co.za> New submission from Palm Kevin: It seems that on linux (red hat), the "make install" fails when no zlib support is available. (I have no zlib installed and I don't want to do so) I reproduced the problem with both python 3.5.1 and python 3.5.2 The command 'configure' and 'make' produced no errors, but the 'make install' failed with this error message: if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ LD_LIBRARY_PATH=/usr/ls/tmp/py/Python-3.5.2:/usr/ls/app/python35/lib:./ls/lib:./ls/lib:/usr/molis/uniface9606/common/lib:/usr/molis/dlm/Linux/amd64:/usr/oracle/product/11.2.0/lib:/usr/oracle/product/11.2.0/lib: ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Traceback (most recent call last): File "/usr/ls/tmp/py/Python-3.5.2/Lib/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/usr/ls/tmp/py/Python-3.5.2/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/__main__.py", line 4, in ensurepip._main() File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/__init__.py", line 209, in _main default_pip=args.default_pip, File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/__init__.py", line 116, in bootstrap _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/__init__.py", line 40, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available make: *** [install] Error 1 zlib is not required to run Python 3.5, it should thus not be required neither for setting up python. ---------- components: Build messages: 271366 nosy: palm.kevin priority: normal severity: normal status: open title: "make install" fails when no zlib support available type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 11:05:32 2016 From: report at bugs.python.org (=?utf-8?q?Ville_Skytt=C3=A4?=) Date: Tue, 26 Jul 2016 15:05:32 +0000 Subject: [New-bugs-announce] [issue27626] Spelling fixes Message-ID: <1469545532.64.0.917176953717.issue27626@psf.upfronthosting.co.za> Changes by Ville Skytt? : ---------- files: spelling.patch keywords: patch nosy: scop priority: normal severity: normal status: open title: Spelling fixes type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43895/spelling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 12:00:04 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 26 Jul 2016 16:00:04 +0000 Subject: [New-bugs-announce] [issue27627] clang fails to build ctypes on Android armv7 Message-ID: <1469548804.03.0.253610844682.issue27627@psf.upfronthosting.co.za> New submission from Xavier de Gaye: The build is done with: clang --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -target armv7-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 The error message: clang --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -target armv7-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-unused-value -Wno-empty-body -Qunused-arguments -Wno-parentheses-equality -Werror=declaration-after-statement -Ibuild/temp.linux-arm-3.6/libffi/include -Ibuild/temp.linux-arm-3.6/libffi -I./Modules/_ctypes/libffi/src -IInclude -I/sdcard/org.bitbucket.pyona/include -I. -I/home/xavier/src/android/pyona/build/python3.6-install-android-21-armv7/org.bitbucket.pyona/include -I/opt/android-ndk/platforms/android-21/arch-arm/usr/include -I./Include -I/home/xavier/src/android/pyona/build/python3.6-android-21-armv7 -c ./Modules/_ctypes/libffi/src/arm/sysv.S -o build/temp.linux-arm-3.6./Modules/_ctypes/libffi/src/arm/sysv.o -Wall -fexceptions ./Modules/_ctypes/libffi/src/arm/sysv.S:399:2: error: invalid instruction stmeqia r2, {r0, r1} ^ ---------- components: Cross-Build messages: 271385 nosy: Alex.Willmer, Chi Hsuan Yen, xdegaye priority: normal severity: normal stage: needs patch status: open title: clang fails to build ctypes on Android armv7 type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 13:34:35 2016 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 26 Jul 2016 17:34:35 +0000 Subject: [New-bugs-announce] [issue27628] ipaddress incompatibility with ipaddr: __contains__ between networks Message-ID: <1469554475.46.0.86096360489.issue27628@psf.upfronthosting.co.za> New submission from ?ukasz Langa: ipaddr historically let users compare if one network is within another network: https://github.com/google/ipaddr-py/blob/master/ipaddr.py#L643 ipaddress specifically prohibits this comparison: https://hg.python.org/cpython/file/tip/Lib/ipaddress.py#l675 What is the reason behind this change? I propose we restore this functionality for 3.6. It's a behavior change but arguably backwards compatible in the sense that between 3.3 and 3.5 this __contains__ comparison always returns False. It's also more on par with what ipaddr did in the past. Thoughts? ---------- assignee: pmoody components: Library (Lib) messages: 271399 nosy: berker.peksag, lukasz.langa, ncoghlan, pmoody priority: normal severity: normal stage: needs patch status: open title: ipaddress incompatibility with ipaddr: __contains__ between networks type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 19:21:45 2016 From: report at bugs.python.org (nemunaire) Date: Tue, 26 Jul 2016 23:21:45 +0000 Subject: [New-bugs-announce] [issue27629] Cannot create raw ssl.SSLSocket Message-ID: <1469575305.76.0.392837082138.issue27629@psf.upfronthosting.co.za> New submission from nemunaire: I got this stacktrace: File "test_ssl.py", line 3, in sock = ssl.SSLSocket(server_hostname="docs.python.org") File "/usr/lib/python3.4/ssl.py", line 536, in __init__ if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: AttributeError: 'NoneType' object has no attribute 'getsockopt' with this minimal code: import ssl sock = ssl.SSLSocket(server_hostname="docs.python.org") sock.connect(("docs.python.org", 443)) sock.sendall(b"GET /3/library/ssl.html HTTP/1.0\r\nHost: docs.python.org\r\n\r\n") print(sock.recv(4096).decode()) Whereas the None socket is correctly handled a few lines later: https://hg.python.org/cpython/file/tip/Lib/ssl.py#l715 All Python >= 3.3 are affected (since https://hg.python.org/cpython/rev/a00842b783cf) and can be patched with the same file, attached to this issue. ---------- components: Library (Lib) files: fix_sslsocket_init_without_socket_3.3-3_6.patch keywords: patch messages: 271419 nosy: nemunaire priority: normal severity: normal status: open title: Cannot create raw ssl.SSLSocket type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43900/fix_sslsocket_init_without_socket_3.3-3_6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 26 21:07:13 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 27 Jul 2016 01:07:13 +0000 Subject: [New-bugs-announce] [issue27630] Generator._encoded_EMTPY misspelling in email package Message-ID: <1469581633.21.0.276257861067.issue27630@psf.upfronthosting.co.za> New submission from Martin Panter: In the Generator.flatten() (Lib/email/generator.py), the code sets, among others, the instance attributes _EMPTY (correct spelling) and _encoded_EMTPY (misspelling). Further down in that class, _encoded_EMPTY (correct spelling) is set as a class attribute, and this correctly-spelt version appears to be used in the _handle_message_delivery_status() method. The BytesGenerator class inherits Generator and overrides the correctly-spelt _encoded_EMPTY class attribute. It seems that both _EMPTY and the misspelt _encoded_EMTPY instance attributes are not used. Perhaps they should be removed. Or perhaps they are not doing the job they were intended for and there is a real bug. ---------- components: email messages: 271424 nosy: barry, martin.panter, r.david.murray priority: normal severity: normal status: open title: Generator._encoded_EMTPY misspelling in email package versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 02:41:51 2016 From: report at bugs.python.org (Ammar Askar) Date: Wed, 27 Jul 2016 06:41:51 +0000 Subject: [New-bugs-announce] [issue27631] .exe is appended to python executable based on filesystem case insensitivity Message-ID: <1469601711.28.0.541702866764.issue27631@psf.upfronthosting.co.za> New submission from Ammar Askar: I encountered some odd behavior today, I compiled python inside VirtualBox, however, I compiled it inside a shared folder. The OS outside of VirtualBox is Windows, so the shared folder naturally is case-insensitive. The actual virtual OS is Debian Linux. Upon running make, I found that oddly enough the executable created was called `python.exe`. Running `make install` still installs it to the correct python name. I did some digging around and from what I can tell this is the change that makes the built python executable have an exe extension or not depending on file system case insensitivity. https://hg.python.org/cpython/rev/d64dfbdc5f8c It's from way long ago from 2001 and I can't figure out why exactly this change was made. The commit message hints that it has something to do with Mac's file system. I asked a friend who used MacOS back then and he reports that it had no file extensions back then either. As far as I know, the only OS that really requires file extension is windows, and besides, this exact situation is what the https://www.gnu.org/software/automake/manual/html_node/EXEEXT.html variable is for, which is used in the configure.ac file already. It seems a little odd that whether or not to put .exe in the build executable is based on file system case insensitivity. ---------- components: Build messages: 271436 nosy: ammar2 priority: normal severity: normal status: open title: .exe is appended to python executable based on filesystem case insensitivity versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 04:28:32 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 27 Jul 2016 08:28:32 +0000 Subject: [New-bugs-announce] [issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix Message-ID: <1469608112.86.0.803958819971.issue27632@psf.upfronthosting.co.za> New submission from Michael Felt: Note: - Only examined on Python 2.7, but expect the same issue (from Python 3.4.X, 3.5.X and 3.6.X based on earlier attempts to use a separate builddir SUMMARY: * when builddir==srcdir build completes normally, (see DETAILS2:) * when builddir!=srcdir ... ** "configure" completes, no error messages ** "make" completes: some warnings, and I am surprised that make does not stop when message "unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory" appears The ./python executable can be executed (no other tests done yet) root at x064:[/data/prj/aixtools/python/Python-2.7.12]./python Python 2.7.12 (default, Jul 27 2016, 07:26:36) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information. >>> * make install DESTDIR=/some/where/for/packaging - FAILS * in DETAILS3: I show that 'helping' by setting a symbolic link (messages continue), then a hard-link (ld_so_aix messages go away) also fails COMMENTS: * the Bitfield messages are 'known' and occur in all versions of Python (2.7.X, 3.3.X, 3.4.X, 3.5.X and 3.6.X - 3.2.X, (3.1.X and 3.0.X never tried)) * I hae no idea what all the "Skipping" is about, leaving in details as FYI DETAILS (verbatum): root at x064:[/data/prj/aixtools/python/Python-2.7.12]buildaix --without-computed-gotos VRMF 2.7.12.0 xlc is /usr/vacpp/bin/xlc + [[ 0 -eq 0 ]] + CC=xlc_r + export CC + CC=xlc_r CPPFLAGS="-I/opt/include -I/opt/buildaix/include" CFLAGS="-I/opt/include -O2 -qmaxmem=-1 -I/opt/buildaix/includes"\ ../src/Python-2.7.12/configure\ --prefix=/opt \ --sysconfdir=/var/Python/etc\ --sharedstatedir=/var/Python/com\ --localstatedir=/var/Python\ --mandir=/usr/share/man\ --infodir=/opt/share/info/Python --without-computed-gotos\ > .buildaix/configure.out + make > .buildaix/make.out "../src/Python-2.7.12/Objects/typeobject.c", line 6243.26: 1506-068 (W) Operation between types "void*" and "struct _object*(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6290.22: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6490.18: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/pyexpat.c", line 1538.27: 1506-068 (W) Operation between types "void*" and "void(*)(void*,const char*,int)" is not allowed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3406.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3954.31: 1506-280 (W) Function argument assignment between types "int(*)(void)" and "void*" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5695.63: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5696.62: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5697.65: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5698.60: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5700.66: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const unsigned short*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/callproc.c", line 837.32: 1506-280 (W) Function argument assignment between types "void(*)(void)" and "void*" is not allowed. Assembler: /tmp/xlcS0JTuaqd.s: line 160: 1252-149 Instruction extsb is not implemented in the current assembly mode COM. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory + make install DESTDIR=/var/aixtools/python/Python/2.7.12.0 > .buildaix/install.out unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/pyexpat.c", line 1538.27: 1506-068 (W) Operation between types "void*" and "void(*)(void*,const char*,int)" is not allowed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3406.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3954.31: 1506-280 (W) Function argument assignment between types "int(*)(void)" and "void*" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5695.63: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5696.62: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5697.65: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5698.60: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5700.66: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const unsigned short*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/callproc.c", line 837.32: 1506-280 (W) Function argument assignment between types "void(*)(void)" and "void*" is not allowed. Assembler: /tmp/xlcS0dZucqd.s: line 160: 1252-149 Instruction extsb is not implemented in the current assembly mode COM. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" /usr/include/netinet/in.h Skipping: __restrict__ = restrict Skipping: __restrict__ = Skipping: __bool__ = _Bool Skipping: __bool__ = unsigned char Skipping: INT64_MIN = (INT64_C(-9223372036854775807)-1) Skipping: INT64_MAX = (INT64_C(9223372036854775807)) Skipping: UINT8_MAX = (255U) Skipping: UINT16_MAX = (65535U) Skipping: UINT32_MAX = (4294967295U) Skipping: UINT64_MAX = (UINT64_C(18446744073709551615)) Skipping: INT_LEAST64_MIN = INT64_MIN Skipping: INT_LEAST64_MAX = INT64_MAX Skipping: UINT_LEAST8_MAX = UINT8_MAX Skipping: UINT_LEAST16_MAX = UINT16_MAX Skipping: UINT_LEAST32_MAX = UINT32_MAX Skipping: UINT_LEAST64_MAX = UINT64_MAX Skipping: INT_FAST64_MIN = INT64_MIN Skipping: INT_FAST64_MAX = INT64_MAX Skipping: UINT_FAST8_MAX = UINT8_MAX Skipping: UINT_FAST16_MAX = UINT16_MAX Skipping: UINT_FAST32_MAX = UINT32_MAX Skipping: UINT_FAST64_MAX = UINT64_MAX Skipping: INTMAX_MIN = INT64_MIN Skipping: INTMAX_MAX = INT64_MAX Skipping: UINTMAX_MAX = UINT64_MAX Skipping: UINTMAX_MAX = UINT32_MAX Skipping: INTPTR_MIN = INT64_MIN Skipping: INTPTR_MAX = INT64_MAX Skipping: UINTPTR_MAX = UINT64_MAX Skipping: UINTPTR_MAX = UINT32_MAX Skipping: PTRDIFF_MIN = INT64_MIN Skipping: PTRDIFF_MAX = INT64_MAX Skipping: WCHAR_MAX = UINT32_MAX Skipping: WCHAR_MAX = UINT16_MAX Skipping: SIZE_MAX = UINT64_MAX Skipping: SIZE_MAX = UINT32_MAX Skipping: strtoumax = _strtoumax32 Skipping: wcstoimax = _wcstoimax32 Skipping: wcstoumax = _wcstoumax32 Skipping: imaxabs = _imaxabs32 Skipping: imaxdiv = _imaxdiv32 Skipping: UINTFAST_MAX = UINT32_MAX Skipping: def ADSP_MASK(_x): return ((1U << 31) >> (_x)) Skipping: def P64(X): return ( *((ptr64 *)&(X)) ) Skipping: fsid_dev = val[0] Skipping: fsid_type = val[1] Skipping: fh_dev = fh_fsid.fsid_dev Skipping: fh_type = fh_fsid.fsid_type Skipping: fh_len = fh_fid.fid_len Skipping: fh_ino = fh_fid.fid_ino Skipping: fh_gen = fh_fid.fid_gen Skipping: __NFDBITS = (sizeof(long) * 8) Skipping: __NUM_ENTRIES = (FD_SETSIZE/__NFDBITS+1) Skipping: def FD_ZERO(p): return { fd_set *__q=p; \ Skipping: NS_PER_TICK = (NS_PER_SEC/HZ) Skipping: TIMEBASE_SZ = (sizeof (struct timebasestruct)) Skipping: def ntimerisset(tvp): return ((tvp)->tv_sec || (tvp)->tv_nsec) Skipping: def ntimerclear(tvp): return (tvp)->tv_sec = (tvp)->tv_nsec = 0 Skipping: def timerisset(tvp): return ((tvp)->tv_sec || (tvp)->tv_usec) Skipping: def timerclear(tvp): return (tvp)->tv_sec = (tvp)->tv_usec = 0 Skipping: CLOCK_REALTIME = ((clockid_t) 9) Skipping: CLOCK_MONOTONIC = ((clockid_t) 10) Skipping: CLOCK_PROCESS_CPUTIME_ID = ((clockid_t) 11) Skipping: CLOCK_THREAD_CPUTIME_ID = ((clockid_t) 12) Skipping: _H_STDDEF = Skipping: offsetof = __offsetof Skipping: NFDBITS = __NFDBITS Skipping: s6_addr32 = s6_addr.s6_addr32 Skipping: s6_addr64 = s6_addr.s6_addr64 Skipping: s6_addr16 = s6_addr.s6_addr16 Skipping: s6_addr8 = s6_addr.s6_addr8 Skipping: s6_addr = s6_addr.s6_addr8 Skipping: INADDR_ANY = (uint32_t)0x00000000 Skipping: INADDR_BROADCAST = (uint32_t)(-1) Skipping: INADDR_UNSPEC_GROUP = (uint32_t)(-536870912) Skipping: INADDR_ALLHOSTS_GROUP = (uint32_t)(-536870911) Skipping: INADDR_ALLRTRS_GROUP = (uint32_t)(-536870910) Skipping: INADDR_MAX_LOCAL_GROUP = (uint32_t)(-536870657) Skipping: MSR_HYPERVISOR = (1152921500311879680)L Skipping: DSCR_PROP_VER0_SIZE = (offsetof(struct dscr_properties, dscr_res)) Skipping: DSCR_PROP_SIZE = (sizeof(struct dscr_properties)) Skipping: FP_IE_IMPL = (fp_ie_impl != 0) Skipping: ASR_VALID = (1LL) Skipping: SLB_PSIZE_MASK = 0x170UL Skipping: def VALID_HANDLE_SSLB(_handle): return (!((_handle) & 0x0f)) Skipping: HANDLE_CLASS_SSLB = 0x80UL Skipping: def htons(hostshort): return (unsigned short)(hostshort) Skipping: def ntohs(netshort): return (unsigned short)(netshort) Skipping: INADDR_LOOPBACK = (uint32_t)0x7f000001 Skipping: s6_addr32 = u6_addr.u6_addr32 Skipping: s6_addr64 = u6_addr.u6_addr64 Skipping: s6_addr16 = u6_addr.u6_addr16 Skipping: s6_addr8 = u6_addr.u6_addr8 Skipping: s6_addr = u6_addr.u6_addr8 Skipping: def HTONLL(x): return (x) = htonll((x)); Skipping: def HTONL(x): return (x) = htonl((x)); Skipping: def HTONS(x): return (x) = htons((x)); Skipping: def NTOHLL(x): return (x) = ntohll((x)); Skipping: def NTOHL(x): return (x) = ntohl((x)); Skipping: def NTOHS(x): return (x) = ntohs((x)); Skipping: def IPV6_GET_VERSION(x): return ((*((u_char *)&(x)) >> 4) & 0xf) Skipping: def IN6_ADDR_V6_TO_V4(a): return ((struct in_addr *)&(a)->s6_addr[12]) Skipping: def satosin(sa): return ((struct sockaddr_in *)(sa)) Skipping: def sintosa(sin): return ((struct sockaddr *)(sin)) Skipping: def ifatoia(ifa): return ((struct in_ifaddr *)(ifa)) Skipping: def satosin6(sa): return ((struct sockaddr_in6 *)(sa)) Skipping: def sin6tosa(sin6): return ((struct sockaddr *)(sin6)) Skipping: def ifatoia6(ifa): return ((struct in6_ifaddr *)(ifa)) Traceback (most recent call last): File "/var/aixtools/python/Python/2.7.12.0/opt/lib/python2.7/compileall.py", line 16, in import struct File "/var/aixtools/python/Python/2.7.12.0/opt/lib/python2.7/struct.py", line 1, in from _struct import * ImportError: No module named _struct make: 1254-004 The error code from the last command is 1. Stop. make install returned an error root at x064:[/data/prj/aixtools/python/Python-2.7.12] DETAILS2: root at x064:[/data/prj/aixtools/python/python-2.7.12]buildaix --without-computed-gotos VRMF 2.7.12.0 xlc is /usr/vacpp/bin/xlc + [[ 0 -eq 0 ]] + CC=xlc_r + export CC + CC=xlc_r CPPFLAGS="-I/opt/include -I/opt/buildaix/include" CFLAGS="-I/opt/include -O2 -qmaxmem=-1 -I/opt/buildaix/includes"\ ./configure\ --prefix=/opt \ --sysconfdir=/var/python/etc\ --sharedstatedir=/var/python/com\ --localstatedir=/var/python\ --mandir=/usr/share/man\ --infodir=/opt/share/info/python --without-computed-gotos\ > .buildaix/configure.out + make > .buildaix/make.out "Objects/typeobject.c", line 6243.26: 1506-068 (W) Operation between types "void*" and "struct _object*(*)(struct _object*)" is not allowed. "Objects/typeobject.c", line 6290.22: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "Objects/typeobject.c", line 6490.18: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12/Modules/pyexpat.c", line 1538.27: 1506-068 (W) Operation between types "void*" and "void(*)(void*,const char*,int)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 3406.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 3954.31: 1506-280 (W) Function argument assignment between types "int(*)(void)" and "void*" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 5695.63: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 5696.62: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 5697.65: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const char*,int)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 5698.60: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/_ctypes.c", line 5700.66: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const unsigned short*,int)" is not allowed. "/data/prj/aixtools/python/python-2.7.12/Modules/_ctypes/callproc.c", line 837.32: 1506-280 (W) Function argument assignment between types "void(*)(void)" and "void*" is not allowed. Assembler: /tmp/xlcS0YSYiqd.s: line 160: 1252-149 Instruction extsb is not implemented in the current assembly mode COM. + make install DESTDIR=/var/aixtools/aixtools/python/2.7.12.0 > .buildaix/install.out + mkinstallp.ksh /var/aixtools/aixtools/python/2.7.12.0 > .buildaix/mkinstallp.out ============================== aixtools.python:aixtools.python.man.en_US:2.7.12.0::I:T:::::N:man pages::::0:: aixtools.python:aixtools.python.rte:2.7.12.0::I:T:::::N:built 27-Jul-2016 0744 UTC::::0:: ============================== root at x064:[/data/prj/aixtools/python/python-2.7.12] DETAILS3: root at x064:[/data/prj/aixtools/python/Python-2.7.12]buildaix --without-computed-gotos VRMF 2.7.12.0 xlc is /usr/vacpp/bin/xlc + [[ 0 -eq 0 ]] + CC=xlc_r + export CC + CC=xlc_r CPPFLAGS="-I/opt/include -I/opt/buildaix/include" CFLAGS="-I/opt/include -O2 -qmaxmem=-1 -I/opt/buildaix/includes"\ ../src/Python-2.7.12/configure\ --prefix=/opt \ --sysconfdir=/var/Python/etc\ --sharedstatedir=/var/Python/com\ --localstatedir=/var/Python\ --mandir=/usr/share/man\ --infodir=/opt/share/info/Python --without-computed-gotos\ > .buildaix/configure.out + make > .buildaix/make.out root at x064:[/data/prj/aixtools/python/Python-2.7.12]find . -name ld_so_aix ./Modules/ld_so_aix root at x064:[/data/prj/aixtools/python/Python-2.7.12]ls ../src/Python-2.7.12/Modules Setup.config.in _heapqmodule.c _ssl_data.h bz2module.c datetimemodule.c gdbmmodule.c main.c posixmodule.h shamodule.c testcapi_long.h yuvconvert.c Setup.dist _hotshot.c _struct.c cPickle.c dbmmodule.c getaddrinfo.c makesetup puremodule.c signalmodule.c threadmodule.c zipimport.c _bisectmodule.c _io _testcapimodule.c cStringIO.c dlmodule.c getbuildinfo.c makexp_aix pwdmodule.c socketmodule.c timemodule.c zlib _bsddb.c _json.c _tkinter.c cdmodule.c errnomodule.c getnameinfo.c mathmodule.c pyexpat.c socketmodule.h timing.h zlibmodule.c _codecsmodule.c _localemodule.c _weakref.c cgen.py expat getpath.c md5.c python.c spwdmodule.c timingmodule.c _collectionsmodule.c _lsprof.c addrinfo.h cgensupport.c fcntlmodule.c glmodule.c md5.h readline.c sre.h tkappinit.c _csv.c _math.c almodule.c cgensupport.h flmodule.c grpmodule.c md5module.c resource.c sre_constants.h tkinter.h _ctypes _math.h ar_beos cjkcodecs fmmodule.c imageop.c mmapmodule.c rotatingtree.c stropmodule.c unicodedata.c _curses_panel.c _multiprocessing arraymodule.c clmodule.c fpectlmodule.c imgfile.c nismodule.c rotatingtree.h sunaudiodev.c unicodedata_db.h _cursesmodule.c _randommodule.c audioop.c cmathmodule.c fpetestmodule.c itertoolsmodule.c operator.c selectmodule.c svmodule.c unicodename_db.h _elementtree.c _sqlite binascii.c config.c.in future_builtins.c ld_so_aix.in ossaudiodev.c sgimodule.c symtablemodule.c xxmodule.c _functoolsmodule.c _sre.c bsddb.h cryptmodule.c gc_weakref.txt ld_so_beos parsermodule.c sha256module.c syslogmodule.c xxsubtype.c _hashopenssl.c _ssl.c bsddbmodule.c cstubs gcmodule.c linuxaudiodev.c posixmodule.c sha512module.c termios.c yuv.h root at x064:[/data/prj/aixtools/python/Python-2.7.12]ln -s ./Modules/ld_so_aix ../src/Python-2.7.12/Modules root at x064:[/data/prj/aixtools/python/Python-2.7.12]ls -l ../src/Python-2.7.12/Modules/ld_so_aix lrwxrwxrwx 1 root system 19 Jul 27 08:00 ../src/Python-2.7.12/Modules/ld_so_aix -> ./Modules/ld_so_aix root at x064:[/data/prj/aixtools/python/Python-2.7.12] This fails as a symbolic link: root at x064:[/data/prj/aixtools/python/Python-2.7.12]buildaix --without-computed-gotos VRMF 2.7.12.0 do_configure: using existing Makefile do_configure: run distclean to get a standard AIX configure -rw-r----- 1 root system 52350 Jul 27 07:57 ./Makefile -rw-r----- 1 root system 732150 Jul 27 07:57 config.log -rwxr-x--x 1 root system 39198 Jul 27 07:57 config.status + > .buildaix/make.out "../src/Python-2.7.12/Objects/typeobject.c", line 6243.26: 1506-068 (W) Operation between types "void*" and "struct _object*(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6290.22: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6490.18: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory unable to execute '../src/Python-2.7.12/Modules/ld_so_aix': No such file or directory interruptedroot at x064:[/data/prj/aixtools/python/Python-2.7.12] root at x064:[/data/prj/aixtools/python/Python-2.7.12]ln -f ./Modules/ld_so_aix ../src/Python-2.7.12/Modules root at x064:[/data/prj/aixtools/python/Python-2.7.12]ls -l ../src/Python-2.7.12/Modules/ld_so_aix -rwxr-x--x 2 root system 6208 Jul 27 07:57 ../src/Python-2.7.12/Modules/ld_so_aix Trying again as a hard-link - fewer messages, but it still fails. root at x064:[/data/prj/aixtools/python/Python-2.7.12]make clean find ../src/Python-2.7.12 -name '*.py[co]' -exec rm -f {} ';' find . -name '*.[oa]' -exec rm -f {} ';' find . -name '*.s[ol]' -exec rm -f {} ';' find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' find build -name 'fficonfig.h' -exec rm -f {} ';' || true find build -name 'fficonfig.py' -exec rm -f {} ';' || true rm -f Lib/lib2to3/*Grammar*.pickle rm -rf build root at x064:[/data/prj/aixtools/python/Python-2.7.12]buildaix --without-computed-gotos VRMF 2.7.12.0 do_configure: using existing Makefile do_configure: run distclean to get a standard AIX configure -rw-r----- 1 root system 52350 Jul 27 07:57 ./Makefile -rw-r----- 1 root system 732150 Jul 27 07:57 config.log -rwxr-x--x 1 root system 39198 Jul 27 07:57 config.status + > .buildaix/make.out "../src/Python-2.7.12/Objects/typeobject.c", line 6243.26: 1506-068 (W) Operation between types "void*" and "struct _object*(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6290.22: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "../src/Python-2.7.12/Objects/typeobject.c", line 6490.18: 1506-068 (W) Operation between types "void*" and "long(*)(struct _object*)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/pyexpat.c", line 1538.27: 1506-068 (W) Operation between types "void*" and "void(*)(void*,const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3406.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3954.31: 1506-280 (W) Function argument assignment between types "int(*)(void)" and "void*" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5695.63: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5696.62: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5697.65: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5698.60: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5700.66: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const unsigned short*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/callproc.c", line 837.32: 1506-280 (W) Function argument assignment between types "void(*)(void)" and "void*" is not allowed. Assembler: /tmp/xlcS0Jxigid.s: line 160: 1252-149 Instruction extsb is not implemented in the current assembly mode COM. + make install DESTDIR=/var/aixtools/python/Python/2.7.12.0 > .buildaix/install.out "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/pyexpat.c", line 1538.27: 1506-068 (W) Operation between types "void*" and "void(*)(void*,const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3406.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 3954.31: 1506-280 (W) Function argument assignment between types "int(*)(void)" and "void*" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5695.63: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5696.62: 1506-280 (W) Function argument assignment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5697.65: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const char*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5698.60: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/_ctypes.c", line 5700.66: 1506-280 (W) Function argument assignment between types "void*" and "struct _object*(*)(const unsigned short*,int)" is not allowed. "/data/prj/aixtools/python/src/Python-2.7.12/Modules/_ctypes/callproc.c", line 837.32: 1506-280 (W) Function argument assignment between types "void(*)(void)" and "void*" is not allowed. Assembler: /tmp/xlcS0hxAmMd.s: line 160: 1252-149 Instruction extsb is not implemented in the current assembly mode COM. Traceback (most recent call last): File "/var/aixtools/python/Python/2.7.12.0/opt/lib/python2.7/compileall.py", line 16, in import struct File "/var/aixtools/python/Python/2.7.12.0/opt/lib/python2.7/struct.py", line 1, in from _struct import * ImportError: No module named _struct make: 1254-004 The error code from the last command is 1. Stop. make install returned an error root at x064:[/data/prj/aixtools/python/Python-2.7.12] ---------- components: Installation messages: 271440 nosy: Michael.Felt priority: normal severity: normal status: open title: build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 05:30:33 2016 From: report at bugs.python.org (Florian Preinstorfer) Date: Wed, 27 Jul 2016 09:30:33 +0000 Subject: [New-bugs-announce] [issue27633] Doc: Add missing version info to email.parser Message-ID: <1469611833.34.0.859096267207.issue27633@psf.upfronthosting.co.za> New submission from Florian Preinstorfer: The versionchanged field has no version info for message_from_string(). ---------- files: email-parser-add_version_info.patch keywords: patch messages: 271442 nosy: notizblock priority: normal severity: normal status: open title: Doc: Add missing version info to email.parser type: enhancement versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43908/email-parser-add_version_info.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 07:54:56 2016 From: report at bugs.python.org (Przemyslaw Wegrzyn) Date: Wed, 27 Jul 2016 11:54:56 +0000 Subject: [New-bugs-announce] [issue27634] selectors.SelectSelectors fails if select.select was patched Message-ID: <1469620496.01.0.933139136376.issue27634@psf.upfronthosting.co.za> New submission from Przemyslaw Wegrzyn: The SelectSelector makes a local copy of select.select() built-in and calls it via self._select later on. It no longer works if select.select() built-in is replaced with function (something gevent's monkey patching does). Currently gevent employs a workaround - it overwrites SelectSelector._select. It wouldn't be necessary if SelectSelector could cope with select.select() being a regular function. Attached is a file reproducing the issue. ---------- components: Library (Lib) files: t_s.py messages: 271446 nosy: Przemyslaw Wegrzyn priority: normal severity: normal status: open title: selectors.SelectSelectors fails if select.select was patched type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file43909/t_s.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 13:07:25 2016 From: report at bugs.python.org (July Tikhonov) Date: Wed, 27 Jul 2016 17:07:25 +0000 Subject: [New-bugs-announce] [issue27635] pickle documentation says that unpickling may not call __new__ Message-ID: <1469639245.7.0.966654223743.issue27635@psf.upfronthosting.co.za> New submission from July Tikhonov: A note just below object.__setstate__() documentation https://docs.python.org/3.6/library/pickle.html#object.__setstate__ says that """ ? the type should implement __getnewargs__() or __getnewargs_ex__() to establish such an invariant; otherwise, neither __new__() nor __init__() will be called. """ I believe that note about not calling __new__() was relevant in python2. I could not find case in python3 in which __new__() would not be called. And __init__() is not called anyway, as far as I understand (unless explicitly by __setstate__() or something). Python 3.6.0a3+ (default:da9898e7e90d, Jul 27 2016, 19:51:12) [GCC 4.9.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class C: ... def __getstate__(self): return {'foo' : self.foo} ... def __setstate__(self, state): self.foo = state['foo'] ... def __new__(cls): ... print('__new__ is called'); return super().__new__(cls) ... def __init__(self): ... print('__init__ is called'); self.foo = None; super().__init__() ... >>> c = C(); c.foo = 'bar' __new__ is called __init__ is called >>> import pickle >>> c2 = pickle.loads(pickle.dumps(c)) __new__ is called >>> c2.foo 'bar' ---------- assignee: docs at python components: Documentation messages: 271465 nosy: docs at python, july priority: normal severity: normal status: open title: pickle documentation says that unpickling may not call __new__ versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 23:04:28 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 28 Jul 2016 03:04:28 +0000 Subject: [New-bugs-announce] [issue27636] Refactor IDLE htest Message-ID: <1469675068.09.0.412407912627.issue27636@psf.upfronthosting.co.za> New submission from Terry J. Reedy: idlelib.idle_test.htest Extract a App(Tk) subclass from run function and nested function. Pass that as master instead of bare root. Extract HTest(Toplevel) class with the common code in files with an htest function. Attach HTest to App as an attribute so htest functions can instantiate or subclass. ---------- assignee: terry.reedy components: IDLE messages: 271486 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Refactor IDLE htest type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 23:15:12 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 28 Jul 2016 03:15:12 +0000 Subject: [New-bugs-announce] [issue27637] int.to_bytes(-1, ...) should automatically choose required count of bytes Message-ID: <1469675712.56.0.174576481029.issue27637@psf.upfronthosting.co.za> New submission from ???? ?????????: It will be nice if `int.to_bytes` be able to automatically choose number of bytes to serialize. If so, I could write serialisation code: def serialize(value: int, signed=True) -> bytes: x = value.to_bytes(-1, 'big', signed=signed) l = value.to_bytes(4, 'big', signed=False) return l + x assert len(serialize(0)) == 4 + 0 # see Issue27623 assert len(serialize(120)) == 4 + 1 assert len(serialize(130)) == 4 + 2 assert len(serialize(130), False) == 4 + 1 ---------- components: Library (Lib) messages: 271488 nosy: mmarkk priority: normal severity: normal status: open title: int.to_bytes(-1, ...) should automatically choose required count of bytes type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 27 23:32:33 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 28 Jul 2016 03:32:33 +0000 Subject: [New-bugs-announce] [issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders Message-ID: <1469676753.14.0.293041836709.issue27638@psf.upfronthosting.co.za> New submission from ???? ?????????: int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders. I will provide a patch. ---------- messages: 271490 nosy: mmarkk priority: normal severity: normal status: open title: int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 02:15:07 2016 From: report at bugs.python.org (Anton Backer) Date: Thu, 28 Jul 2016 06:15:07 +0000 Subject: [New-bugs-announce] [issue27639] UserList.__getitem__ doesn't account for slices Message-ID: <1469686507.89.0.362648270021.issue27639@psf.upfronthosting.co.za> New submission from Anton Backer: The docs for UserList say: > List operations which return a new sequence attempt to create an instance of the actual implementation class. However, UserList([])[:] returns a list, not a UserList. ---------- components: Library (Lib) files: patch messages: 271503 nosy: staticshock priority: normal severity: normal status: open title: UserList.__getitem__ doesn't account for slices type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file43914/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 06:05:17 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 28 Jul 2016 10:05:17 +0000 Subject: [New-bugs-announce] [issue27640] add the '--disable-test-suite' option to configure Message-ID: <1469700317.99.0.84265252625.issue27640@psf.upfronthosting.co.za> New submission from Xavier de Gaye: Do not install the Python test suite when configure is run with '--disable-test-suite'. This about divides by two the size of the installed standard library. Related to issue 26852: add the '--enable-legacy-pyc-files' option to configure. The attached listdirs.py script may be used to check that the set of sub-directories in the std library is not changed by the patch. ---------- assignee: xdegaye components: Build files: disable-test-suite.patch keywords: patch messages: 271514 nosy: doko, martin.panter, xdegaye priority: normal severity: normal stage: patch review status: open title: add the '--disable-test-suite' option to configure type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43917/disable-test-suite.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 07:04:44 2016 From: report at bugs.python.org (Thomas Perl) Date: Thu, 28 Jul 2016 11:04:44 +0000 Subject: [New-bugs-announce] [issue27641] Do not build Programs/_freeze_importlib when cross-compiling Message-ID: <1469703884.83.0.465404999691.issue27641@psf.upfronthosting.co.za> New submission from Thomas Perl: Based on http://bugs.python.org/issue27490 and http://bugs.python.org/msg271495, here is a patch that makes sure Programs/_freeze_importlib is only built when not cross-compiling. ---------- components: Cross-Build files: python-freeze-importlib-cross-compiling.patch keywords: patch messages: 271519 nosy: Alex.Willmer, Thomas Perl, martin.panter priority: normal severity: normal status: open title: Do not build Programs/_freeze_importlib when cross-compiling type: behavior versions: Python 2.7, Python 3.6 Added file: http://bugs.python.org/file43920/python-freeze-importlib-cross-compiling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 07:58:25 2016 From: report at bugs.python.org (Decorater) Date: Thu, 28 Jul 2016 11:58:25 +0000 Subject: [New-bugs-announce] [issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace. Message-ID: <1469707105.59.0.0648357664764.issue27642@psf.upfronthosting.co.za> New submission from Decorater: So, I have some code. I tried to make a 'plugin' for my bot I made in python. However it seems to not be able to import it which it should be able to. The code I used is here: https://bpaste.net/show/e4445c47490d I dont even know why it is not addign it to the file's namespace or even adding it to sys.modules either. ---------- messages: 271533 nosy: Decorater priority: normal severity: normal status: open title: import and __import__() fails silently without a ImportError and does not add the module to the file's namespace. versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 11:01:29 2016 From: report at bugs.python.org (Michael Felt) Date: Thu, 28 Jul 2016 15:01:29 +0000 Subject: [New-bugs-announce] [issue27643] test_ctypes fails on AIX with xlc Message-ID: <1469718089.88.0.404760174195.issue27643@psf.upfronthosting.co.za> New submission from Michael Felt: I am preparing a system with gcc to see if it is compiler related, i.e., goes away with gcc. On the one hand, fingers crossed - but on the other, having bitfields working regardless of the compiler should be preferred. This issue is similar to a Solaris (C compiler) http://bugs.python.org/issue16275 During the build using clc _ get these messages - which make me hope it is an unexpected compiler issue. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for M is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for N is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for O is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for P is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for Q is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for R is not valid. Type unsigned assumed. "/data/prj/aixtools/python/python-2.7.12.1/Modules/_ctypes/_ctypes_test.c", line 382.5: 1506-159 (E) Bit field type specified for S is not valid. Type unsigned assumed. Note: I modified test_bitfields to do an additional print. Maybe this gives an idea about what the issue is (when considering the compiler messages) root at x064:[/data/prj/aixtools/python/python-2.7.12.1/Lib/ctypes/test]../../../python ./runtests.py A 0x1001f 0 B 0x2001d 0 C 0x3001a 0 D 0x40016 0 E 0x50011 0 F 0x6000b 0 G 0x70004 0 H 0x80018 4 I 0x9000f 4 M 0x1000e 6 N 0x2000c 6 O 0x30009 6 P 0x40005 6 Q 0x50000 6 R 0x6000a 8 S 0x70003 8 .............s....................ssss............................ssssssssssssssssssssssssssss...s.......s.....................sssssssssssssssssssss......s...........s....s.....................FF...s...............................................s.............sssss.ss....s.......ss..sss...................s......s.....................s..................................................s...........ss.sssss................s.s.............s. ====================================================================== FAIL: test_ints (ctypes.test.test_bitfields.C_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/prj/aixtools/python/python-2.7.12.1/Lib/ctypes/test/test_bitfields.py", line 41, in test_ints self.assertEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name))) AssertionError: Tuples differ: ('A', 1, -1) != ('A', 1, 1) First differing element 2: -1 1 - ('A', 1, -1) ? - + ('A', 1, 1) ====================================================================== FAIL: test_shorts (ctypes.test.test_bitfields.C_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/prj/aixtools/python/python-2.7.12.1/Lib/ctypes/test/test_bitfields.py", line 48, in test_shorts self.assertEqual((name, i, getattr(b, name)), (name, i, func(byref(b), name))) AssertionError: Tuples differ: ('M', 1, -1) != ('M', 1, 1) First differing element 2: -1 1 - ('M', 1, -1) ? - + ('M', 1, 1) ---------------------------------------------------------------------- Ran 440 tests in 0.883s (0 modules skipped) Unavailable resources: printing, refcount FAILED (failures=2) root at x064:[/data/prj/aixtools/python/python-2.7.12.1/Lib/ctypes/test] ---------- messages: 271555 nosy: Michael.Felt priority: normal severity: normal status: open title: test_ctypes fails on AIX with xlc versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 13:29:04 2016 From: report at bugs.python.org (Michael Lee) Date: Thu, 28 Jul 2016 17:29:04 +0000 Subject: [New-bugs-announce] [issue27644] Expand documentation about type aliases and NewType in the typing module Message-ID: <1469726944.72.0.582694680461.issue27644@psf.upfronthosting.co.za> New submission from Michael Lee: This is a patch to update the documentation on the typing module. It expands the section on type aliases and adds a section on [NewType][0]. Since support for NewType was [recently added][1] to mypy, it seemed like a prudent time to update the docs to describe this new feature. The section on type aliases was mainly expanded because the distinction between type aliases and NewType could be potentially confusing, so adding extra clarification seemed like a good idea. [0]: https://www.python.org/dev/peps/pep-0484/#newtype-helper-function [1]: https://github.com/python/mypy/pull/1939 ---------- assignee: docs at python components: Documentation files: document_newtype.patch keywords: patch messages: 271572 nosy: docs at python, michael0x2a priority: normal severity: normal status: open title: Expand documentation about type aliases and NewType in the typing module versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43926/document_newtype.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 13:48:18 2016 From: report at bugs.python.org (Lele Gaifax) Date: Thu, 28 Jul 2016 17:48:18 +0000 Subject: [New-bugs-announce] [issue27645] Supporting native backup facility of SQLite Message-ID: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> New submission from Lele Gaifax: It would be nice if the sqlite3 stdlib module could expose the SQLite Online Backup API. I'm willing to implement it, as encouraged by Paul Moore. See also: https://mail.python.org/pipermail/python-dev/2016-July/145570.html ---------- components: Extension Modules messages: 271574 nosy: lelit priority: normal severity: normal status: open title: Supporting native backup facility of SQLite type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 14:30:50 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 28 Jul 2016 18:30:50 +0000 Subject: [New-bugs-announce] [issue27646] yield from expression can be any iterable Message-ID: <1469730650.89.0.176012351897.issue27646@psf.upfronthosting.co.za> New submission from Terry J. Reedy: https://docs.python.org/3/reference/expressions.html#yield-expressions says "When yield from is used, it treats the supplied expression as a subiterator. All values produced by that subiterator ...". To me "treats..expression as a subiterator" means that the expression must *be* an iterator, such as returned by iter or calling a generator function. Hence I was surprised upon reading "yield from " in stdlib code. I confirmed that this usage is correct by trying >>> def g(): yield from (1,2) >>> i = g() >>> next(i), next(i) (1, 2) and then reading the PEP380 Formal Semantics, which begins with "_i = iter(EXPR)". Hence I suggest the following replacement for the quote above: "When yield from is used, the expression must be an iterable. A subiterator is obtained with iter(). All values produced by that subiterator ...". Note that 'subiterator' is spelled in the following sentences 'underlying iterable' (which I am not sure I like) and 'sub-iterator' (and 'sub-generator'). I think we should be consistent for at least the two short 'yield from' paragraphs. ---------- assignee: docs at python components: Documentation messages: 271577 nosy: docs at python, terry.reedy priority: normal severity: normal stage: patch review status: open title: yield from expression can be any iterable type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 28 16:19:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 28 Jul 2016 20:19:54 +0000 Subject: [New-bugs-announce] [issue27647] Update Windows build to Tcl/Tk 8.6.6 Message-ID: <1469737194.88.0.144648917966.issue27647@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Current Tcl/Tk version in Windows build is 8.6.4.2. Tcl/Tk 8.6.6 was released yesterday. https://sourceforge.net/p/tcl/mailman/message/35246302/ ---------- components: Tkinter, Windows messages: 271581 nosy: paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Update Windows build to Tcl/Tk 8.6.6 versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 29 00:54:43 2016 From: report at bugs.python.org (=?utf-8?b?6rmA7YOc7ZmY?=) Date: Fri, 29 Jul 2016 04:54:43 +0000 Subject: [New-bugs-announce] [issue27648] Message of webbrowser.py something wrong. Message-ID: <1469768083.59.0.550605115431.issue27648@psf.upfronthosting.co.za> New submission from ???: I'm using Python 3.5.1+ and Ubuntu 16.04. When I open new tab to Chrome using 'webbrowser.open()'. Some message prints next to shell prompt like below. ``` asd ???? ???????... ? ?? ???? ??? ?? Save Page ??? ?????! ['asd'] (Shell prompt) $ ?? ???? ??? ? ?? ??????. ``` First three line is my program's message, please don't care about them. Problem happened at final line. '?? ???? ??? ? ?? ??????.' means Program created new window to existing browser session. I think that message is for webbrowser.py and it prints with shell prompt. So, I was reading webbrowser.py simply but I cannot find where it prints message. Thanks. ---------- components: Library (Lib) messages: 271603 nosy: ??? priority: normal severity: normal status: open title: Message of webbrowser.py something wrong. type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 29 06:54:15 2016 From: report at bugs.python.org (Ian Cordasco) Date: Fri, 29 Jul 2016 10:54:15 +0000 Subject: [New-bugs-announce] [issue27649] multiprocessing on Windows does not properly manage class attributes Message-ID: <1469789655.87.0.612290090536.issue27649@psf.upfronthosting.co.za> New submission from Ian Cordasco: In trying to add support for multiprocessing on Windows in Flake8, I found that the behaviour of the module is significantly different than on Unix. If you have a class that has class-level attributes on Unix, and you change them, put the class into a Queue (or have it attached to an object that moves through a Queue) then the values you set will be preserved [1]. On Windows [2], the attributes are reset. As a minimal reproduction, I've thrown together this project: https://github.com/sigmavirus24/windows-multiprocessing-bug which is running tox on AppVeyor (https://ci.appveyor.com/project/sigmavirus24/windows-multiprocessing-bug) and Travis CI (https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug) so the behaviours can be compared. For application developers, it would be wonderful if we could rely on the standard library behaving the same way in this case across both operating systems. [1] https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276925#L158 https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276926#L158 https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276927#L157 [2] https://ci.appveyor.com/project/sigmavirus24/windows-multiprocessing-bug/build/1.0.2#L24 ---------- components: Windows messages: 271618 nosy: icordasc, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: multiprocessing on Windows does not properly manage class attributes type: behavior versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 29 16:09:25 2016 From: report at bugs.python.org (Ram Rachum) Date: Fri, 29 Jul 2016 20:09:25 +0000 Subject: [New-bugs-announce] [issue27650] Implement `__repr__` methods for logging.Logger and others Message-ID: <1469822965.14.0.109412472968.issue27650@psf.upfronthosting.co.za> New submission from Ram Rachum: A while ago I was debugging through code that uses the `logging` module, and I was looking at `Logger` objects and possibly other kinds of objects (maybe handlers? It was a while ago.) I was frustrated because I was trying to figure out what a particular logger was, but typing `logger` in the shell just showed the opaque ``. I would like to know the name of the logger without bothering to do `logger.name`. I suggest that we do a run over the `logging` module and see which classes could have a helpful `__repr__` added to them. I might have time to do this, but first I want to know whether there is a general agreement that such a patch would be welcome. ---------- components: Library (Lib) messages: 271646 nosy: cool-RR, vinay.sajip priority: normal severity: normal status: open title: Implement `__repr__` methods for logging.Logger and others type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 05:54:42 2016 From: report at bugs.python.org (eatrawmeat391) Date: Sat, 30 Jul 2016 09:54:42 +0000 Subject: [New-bugs-announce] [issue27651] About bytearray Message-ID: <1469872482.04.0.0838783144311.issue27651@psf.upfronthosting.co.za> New submission from eatrawmeat391: I converted a function name yuke_bpe from C and ran into an unknown issue after running it.The code works but it emptied all of my bytearray. You can reproduce the problem by doing it in the command line from unbpe import yuke_bpe a = bytearray("This is a byte array") b = yuke_bpe(a, 100 ,1) You'll see that bytearray a is empty after the yuke_bpe function calling but the function never touches that variable ---------- components: Windows files: unbpe.py messages: 271674 nosy: eatrawmeat391, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: About bytearray versions: Python 2.7 Added file: http://bugs.python.org/file43947/unbpe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 06:43:39 2016 From: report at bugs.python.org (Ed Schouten) Date: Sat, 30 Jul 2016 10:43:39 +0000 Subject: [New-bugs-announce] [issue27652] [Patch] Make use of non-standard error number ESHUTDOWN optional Message-ID: <1469875419.81.0.269942843817.issue27652@psf.upfronthosting.co.za> New submission from Ed Schouten: While porting Python over to CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html), we noticed that the core Python code maps ESHUTDOWN over to BrokenPipeError. This is fine, except for the fact that ESHUTDOWN is used unconditionally. It's not part of POSIX. Attached is a patch to make its use optional. ---------- components: Interpreter Core files: patch-no-eshutdown messages: 271678 nosy: EdSchouten priority: normal severity: normal status: open title: [Patch] Make use of non-standard error number ESHUTDOWN optional versions: Python 3.6 Added file: http://bugs.python.org/file43948/patch-no-eshutdown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 06:50:24 2016 From: report at bugs.python.org (Ed Schouten) Date: Sat, 30 Jul 2016 10:50:24 +0000 Subject: [New-bugs-announce] [issue27653] [Patch] Also disable the use of on CloudABI Message-ID: <1469875824.89.0.74501910418.issue27653@psf.upfronthosting.co.za> New submission from Ed Schouten: While porting Python over to CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html), we stumbled upon a small issue that caused the build to fail. As CloudABI is a sandboxed environment, there currently isn't any support for modifying low-level network properties, such as TCP socket attributes. For this reason is missing, just like on a couple of other platforms (Symbian, Cygwin, etc). The attached patch extends the current '#ifndef' to also take CloudABI into consideration. ---------- components: Extension Modules files: patch-no-netinet-tcp_h messages: 271679 nosy: EdSchouten priority: normal severity: normal status: open title: [Patch] Also disable the use of on CloudABI versions: Python 3.6 Added file: http://bugs.python.org/file43949/patch-no-netinet-tcp_h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 06:56:14 2016 From: report at bugs.python.org (Ed Schouten) Date: Sat, 30 Jul 2016 10:56:14 +0000 Subject: [New-bugs-announce] [issue27654] [Patch] Use arc4random_buf() on CloudABI Message-ID: <1469876174.92.0.881098138709.issue27654@psf.upfronthosting.co.za> New submission from Ed Schouten: While porting Python over to CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html), we stumbled upon a small issue that caused the build to fail. As CloudABI is a sandboxed runtime environment, there is no support for accessing the global filesystem namespace. This means that dev_urandom_noraise()/dev_urandom_python() are not capable of accessing /dev/urandom. The attached change extends these functions to use CloudABI's arc4random_buf() function, which is also present on a lot of other operating systems (the BSDs, Mac OS X, etc). I'm not enabling the use of arc4random_buf() on those operating systems yet, as that should likely be decided by the people responsible for those ports. Alternatively, if we do think arc4random_buf() should be used on all operating systems that support it, we can extend Autoconf to test for its presence. Be sure to let me know and I'll update the patch accordingly. ---------- components: Interpreter Core files: patch-arc4random messages: 271680 nosy: EdSchouten priority: normal severity: normal status: open title: [Patch] Use arc4random_buf() on CloudABI versions: Python 3.6 Added file: http://bugs.python.org/file43950/patch-arc4random _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 10:30:54 2016 From: report at bugs.python.org (Ed Schouten) Date: Sat, 30 Jul 2016 14:30:54 +0000 Subject: [New-bugs-announce] [issue27655] [Patch] Don't require presence of POLLPRI Message-ID: <1469889054.78.0.928788503913.issue27655@psf.upfronthosting.co.za> New submission from Ed Schouten: RFC 6093 states that applications "SHOULD NOT" make use of TCP's out-of-band data. For this reason, CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) does not provide support for it. This means that its poll() function does provide support for POLLIN and POLLOUT, but not for POLLPRI. Attached is a patch that patches up the selectmodule to not define POLLPRI in case the host environment does not support it. ---------- components: Extension Modules files: pollpri.diff keywords: patch messages: 271689 nosy: EdSchouten priority: normal severity: normal status: open title: [Patch] Don't require presence of POLLPRI versions: Python 3.6 Added file: http://bugs.python.org/file43951/pollpri.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 11:49:07 2016 From: report at bugs.python.org (Ed Schouten) Date: Sat, 30 Jul 2016 15:49:07 +0000 Subject: [New-bugs-announce] [issue27656] [Patch] Make presence of SCHED_* optional Message-ID: <1469893747.69.0.209169490868.issue27656@psf.upfronthosting.co.za> New submission from Ed Schouten: The SCHED_* constants that are part of POSIX's are all optional: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html Python already declares the SCHED_SPORADIC constant as part of the POSIX module optionally, depending on whether it is present in C, but doesn't do this for the other SCHED_* constants. This is problematic for CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html), which doesn't support any scheduler interaction at all. Attached is a patch to only define these if present. ---------- components: Extension Modules files: sched.diff keywords: patch messages: 271697 nosy: EdSchouten priority: normal severity: normal status: open title: [Patch] Make presence of SCHED_* optional versions: Python 3.6 Added file: http://bugs.python.org/file43952/sched.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 15:57:17 2016 From: report at bugs.python.org (=?utf-8?q?Bj=C3=B6rn_Lindqvist?=) Date: Sat, 30 Jul 2016 19:57:17 +0000 Subject: [New-bugs-announce] [issue27657] urlparse fails if the path is numeric Message-ID: <1469908637.82.0.696114480311.issue27657@psf.upfronthosting.co.za> New submission from Bj?rn Lindqvist: This affects both Python 2 and 3. This is as expected: >>> urlparse('abc:123.html') ParseResult(scheme='abc', netloc='', path='123.html', params='', query='', fragment='') >>> urlparse('123.html:abc') ParseResult(scheme='123.html', netloc='', path='abc', params='', query='', fragment='') >>> urlparse('abc:123/') ParseResult(scheme='abc', netloc='', path='123/', params='', query='', fragment='') This is NOT: >>> urlparse('abc:123') ParseResult(scheme='', netloc='', path='abc:123', params='', query='', fragment='') Expected is path='123' and scheme='abc'. At least according to my reading of the rfc (https://tools.ietf.org/html/rfc1808.html) that is what should happen. ---------- components: Library (Lib) messages: 271702 nosy: Bj?rn.Lindqvist priority: normal severity: normal status: open title: urlparse fails if the path is numeric type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 30 18:19:49 2016 From: report at bugs.python.org (Mario Grgic) Date: Sat, 30 Jul 2016 22:19:49 +0000 Subject: [New-bugs-announce] [issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently. Message-ID: <1469917189.39.0.985531249644.issue27658@psf.upfronthosting.co.za> New submission from Mario Grgic: I am on Mac OS X 10.11.6 trying to build and install Python 3.5.2 from source. I only have system Python 2.7.10 , and no other instances of Python 3.x. I configure the build as follows: ./configure --prefix=/Volumes/ramdisk/python3.5.2 The code is built without errors, but when I issue make install I get: cd /Volumes/ramdisk/python3.5.2/share/man/man1; ln -s python3.5.1 python3.1) if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ ./python.exe -E -m ensurepip \ $ensurepip --root=/ ; \ fi Ignoring indexes: https://pypi.python.org/simple Collecting setuptools Collecting pip Installing collected packages: setuptools, pip /bin/sh: line 7: 15831 Segmentation fault: 11 ./python.exe -E -m ensurepip $ensurepip --root=/ Makefile:1059: recipe for target 'install' failed make: *** [install] Error 139 which crashes the system Python 2.7.10: Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: EXC_I386_GPFLT Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libcrypto.1.0.0.dylib 0x0000000108c82d51 EVP_PKEY_CTX_free + 17 1 libcrypto.1.0.0.dylib 0x0000000108c77742 EVP_MD_CTX_cleanup + 130 2 libcrypto.1.0.0.dylib 0x0000000108c77a9d EVP_DigestFinal + 29 3 _hashlib.cpython-35m-darwin.so 0x0000000108c05d6b EVP_digest + 155 (_hashopenssl.c:148) 4 python.exe 0x000000010835493e PyEval_EvalFrameEx + 24110 (ceval.c:4684) 5 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 6 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 7 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 8 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 9 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 10 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 11 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 12 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 13 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 14 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 15 python.exe 0x000000010834eaee PyEval_EvalCodeEx + 78 (ceval.c:4039) 16 python.exe 0x00000001082b743d function_call + 381 (funcobject.c:627) 17 python.exe 0x000000010828ddd5 PyObject_Call + 101 (abstract.c:2162) 18 python.exe 0x00000001083556a0 PyEval_EvalFrameEx + 27536 (ceval.c:5034) 19 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 20 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 21 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 22 python.exe 0x0000000108359ee2 fast_function + 338 (ceval.c:4803) 23 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 24 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 25 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 26 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 27 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 28 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 29 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 30 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 31 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 32 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 33 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 34 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 35 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 36 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 37 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 38 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 39 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 40 python.exe 0x000000010834ea91 PyEval_EvalCode + 81 (ceval.c:777) 41 python.exe 0x000000010834c2e0 builtin_exec + 528 (bltinmodule.c:957) 42 python.exe 0x00000001082d6ea5 PyCFunction_Call + 165 (methodobject.c:121) 43 python.exe 0x0000000108354f00 PyEval_EvalFrameEx + 25584 (ceval.c:4705) 44 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 45 python.exe 0x0000000108359f60 fast_function + 464 (ceval.c:4818) 46 python.exe 0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 47 python.exe 0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 48 python.exe 0x000000010834eaee PyEval_EvalCodeEx + 78 (ceval.c:4039) 49 python.exe 0x00000001082b743d function_call + 381 (funcobject.c:627) 50 python.exe 0x000000010828ddd5 PyObject_Call + 101 (abstract.c:2162) 51 python.exe 0x00000001083976e3 RunModule + 147 (main.c:208) 52 python.exe 0x00000001083970fe Py_Main + 2526 (main.c:709) 53 python.exe 0x00000001082831cd main + 237 (python.c:65) 54 libdyld.dylib 0x00007fff9523b5ad start + 1 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x149dd2af96bf4325 rcx: 0x00000000000fc080 rdx: 0x0000000000031db0 rdi: 0x149dd2af96bf4325 rsi: 0x000000010856be00 rbp: 0x00007fff5797b130 rsp: 0x00007fff5797b120 r8: 0x0000000000000003 r9: 0x00007fb96b5ba1f0 r10: 0x00000000072e2888 r11: 0x00007fb96b500000 r12: 0x0a0061d3943a3792 r13: 0x0000000109a59fc0 r14: 0x0000000000000001 r15: 0x00007fff5797b1a0 rip: 0x0000000108c82d51 rfl: 0x0000000000010202 cr2: 0x0000000108c82d40 Logical CPU: 2 Error Code: 0x00000000 Trap Number: 13 -------------------------------------------------------- If I add partially installed python 3.5.2 on the system PATH and add alias python=python3 so the makefile calls python3 instead, then installation completes successfully. However, if I now try running pip3 from python3.5.2/bin installation I get another crash in python3 now Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000011 VM Regions Near 0x11: --> __TEXT 00000001025cd000-0000000102778000 [ 1708K] r-x/rwx SM=COW /Volumes/VOLUME/*/*.5 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libcrypto.1.0.0.dylib 0x0000000103301f79 EVP_PKEY_CTX_dup + 25 1 libcrypto.1.0.0.dylib 0x00000001032f692a EVP_MD_CTX_copy_ex + 282 2 _hashlib.cpython-35m-darwin.so 0x0000000103284e03 EVP_hexdigest + 99 (_hashopenssl.c:113) 3 python3.5 0x000000010269f93e PyEval_EvalFrameEx + 24110 (ceval.c:4684) 4 python3.5 0x00000001026a4ee2 fast_function + 338 (ceval.c:4803) 5 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 6 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 7 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 8 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 9 python3.5 0x00000001026a4ee2 fast_function + 338 (ceval.c:4803) 10 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 11 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 12 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 13 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 14 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 15 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 16 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 17 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 18 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 19 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 20 python3.5 0x00000001026a4ee2 fast_function + 338 (ceval.c:4803) 21 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 22 python3.5 0x00000001026a4ee2 fast_function + 338 (ceval.c:4803) 23 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 24 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 25 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 26 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 27 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 28 python3.5 0x00000001026a4f60 fast_function + 464 (ceval.c:4818) 29 python3.5 0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730) 30 python3.5 0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018) 31 python3.5 0x0000000102699a91 PyEval_EvalCode + 81 (ceval.c:777) 32 python3.5 0x00000001026ca581 PyRun_FileExFlags + 209 (pythonrun.c:976) 33 python3.5 0x00000001026c9c7c PyRun_SimpleFileExFlags + 668 (pythonrun.c:396) 34 python3.5 0x00000001026e23f4 Py_Main + 3284 (main.c:318) 35 python3.5 0x00000001025ce1cd main + 237 (python.c:65) 36 libdyld.dylib 0x00007fff9523b5ad start + 1 Thread 1: 0 libsystem_kernel.dylib 0x00007fff83afb5e2 __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff95a85578 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff95a83341 start_wqthread + 13 Thread 2:: Dispatch queue: com.apple.libdispatch-manager 0 libsystem_kernel.dylib 0x00007fff83afbefa kevent_qos + 10 1 libdispatch.dylib 0x00007fff956af165 _dispatch_mgr_invoke + 216 2 libdispatch.dylib 0x00007fff956aedcd _dispatch_mgr_thread + 52 Thread 3: 0 libsystem_kernel.dylib 0x00007fff83afb5e2 __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff95a85578 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff95a83341 start_wqthread + 13 Thread 4: 0 libsystem_kernel.dylib 0x00007fff83afb5e2 __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff95a85578 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff95a83341 start_wqthread + 13 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000001 rbx: 0x0000000103b75f48 rcx: 0x0000000000000010 rdx: 0xffffffffffffffd4 rdi: 0x00007fdb83c51140 rsi: 0x00007fdb83ca1410 rbp: 0x00007fff5d630c40 rsp: 0x00007fff5d630c30 r8: 0x0000000000000006 r9: 0x0000000000000000 r10: 0x00000000ffffffff r11: 0x00000000000027c0 r12: 0x990018d2e679ec80 r13: 0x0000000103c78288 r14: 0x00007fff5d630c80 r15: 0x00007fdb83ca3b80 rip: 0x0000000103301f79 rfl: 0x0000000000010202 cr2: 0x0000000000000011 Logical CPU: 2 Error Code: 0x00000004 Trap Number: 14 ---------- components: Installation messages: 271710 nosy: Mario Grgic priority: normal severity: normal status: open title: python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently. type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 31 03:04:38 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sun, 31 Jul 2016 07:04:38 +0000 Subject: [New-bugs-announce] [issue27659] Check for the existence of crypt() Message-ID: <1469948678.43.0.816389049938.issue27659@psf.upfronthosting.co.za> New submission from Chi Hsuan Yen: On Android the crypt() function is missing, causing ugly linking errors when compiling the _crypt module. This patch handles it elegantly. A question: should I include changes to configure and pyconfig.h.in in the patch? ---------- components: Cross-Build files: check-crypt.patch keywords: patch messages: 271727 nosy: Alex.Willmer, Chi Hsuan Yen, xdegaye priority: normal severity: normal status: open title: Check for the existence of crypt() type: compile error versions: Python 3.6 Added file: http://bugs.python.org/file43954/check-crypt.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 31 13:40:09 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 31 Jul 2016 17:40:09 +0000 Subject: [New-bugs-announce] [issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize Message-ID: <1469986809.78.0.371731130003.issue27660@psf.upfronthosting.co.za> New submission from Xiang Zhang: In list_resize, new_allocated is of type size_t but I think don't have to be now since it finally have to assign back to self->allocated which is of type Py_ssize_t. With Py_ssize_t, we can check some overflows in the first overflow check and don't need the second overflow check. ---------- components: Interpreter Core files: list_resize.patch keywords: patch messages: 271746 nosy: martin.panter, xiang.zhang priority: normal severity: normal status: open title: Replace size_t with Py_ssize_t as the type of local variable in list_resize type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file43957/list_resize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 31 18:12:21 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 31 Jul 2016 22:12:21 +0000 Subject: [New-bugs-announce] [issue27661] Add tzinfo= argument to datetime.combine Message-ID: <1470003141.22.0.331878271067.issue27661@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: Add an optional tzinfo argument to datetime.combine() so that datetime.combine(d, t, info) returns the same object as datetime.combine(d, t).replace(tzinfo=info) but without creating an intermediate naive instance. Guido's LGTM: https://mail.python.org/pipermail/datetime-sig/2016-July/000993.html ---------- assignee: belopolsky messages: 271751 nosy: belopolsky priority: normal severity: normal status: open title: Add tzinfo= argument to datetime.combine type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________